Non-square mosaics

Discussion of hardware and software development for Super NES and Super Famicom. See the SNESdev wiki for more information.

Moderator: Moderators

Forum rules
  • For making cartridges of your Super NES games, see Reproduction.
Post Reply
User avatar
jeffythedragonslayer
Posts: 344
Joined: Thu Dec 09, 2021 12:29 pm

Non-square mosaics

Post by jeffythedragonslayer »

Does anyone know of any games that use a non-square mosaic effect? Any videos of these effects in action?

I think the "XxX" on this page should probably be changed to "N1xN2" as the triple X is a little confusing, and there seems to be a way of making N different for the horizontal and vertical directions on BG2 in EXTBG mode of mode 7:

https://wiki.superfamicom.org/rendering-the-screen
Last edited by jeffythedragonslayer on Sun Jun 19, 2022 10:24 pm, edited 1 time in total.
User avatar
jeffythedragonslayer
Posts: 344
Joined: Thu Dec 09, 2021 12:29 pm

Re: Non-square mosaics

Post by jeffythedragonslayer »

Here is something I found in fullsnes:
Mosaic is always counted in full-pixels; so a mosaic size of 1x1 (which is normally same as mosaic disabled) acts as 2x1 half-pixels in true h-hires mode (and as 2x2 half-pixels in true hv-hires mode, reportedly?) (and as 1x2 in pseudo v-hires, presumably?).
User avatar
Nikku4211
Posts: 569
Joined: Sun Dec 15, 2019 1:28 pm
Location: Florida
Contact:

Re: Non-square mosaics

Post by Nikku4211 »

[pedantry]
Due to the SNES' non-square pixel aspect ratio, all mosaics (unless you somehow do 7x8 or 14x16 in NTSC) are output as non-square mosaics by the console itself.
[/pedantry]

As for non-square mosaics that don't rely on the pixel aspect ratio to be non-square, I think it might be possible to do 1x2 (and taller) mosaics through HDMA/h-blank without using SNES' mosaic hardware.

Castlevania Bloodlines on Mega Drive imitates this effect.
I have an ASD, so empathy is not natural for me. If I hurt you, I apologise.
User avatar
TmEE
Posts: 960
Joined: Wed Feb 13, 2008 9:10 am
Location: Norway (50 and 60Hz compatible :P)
Contact:

Re: Non-square mosaics

Post by TmEE »

It is seen in Pier Solar intro too : https://www.youtube.com/watch?v=gaYQP5A4QFw

SNES will definitely be able to that
User avatar
jeffythedragonslayer
Posts: 344
Joined: Thu Dec 09, 2021 12:29 pm

Re: Non-square mosaics

Post by jeffythedragonslayer »

That's a god tier comment right there Nikku - all mosiac effects create non-square rectangles unless the developer somehow compensates for the SNES' 8:7 aspect ratio. By drawing the art in 7px by 8px blocks of solid colors, which visually take up 7*8 = 56 pixels each, we have an effective "56-pixel block" aspect ratio of

(7 pixels * 8 units) / (8 pixels * 7 units)

or simply, unity.

Now of course I can software render everything in mode 3 and program whatever crazy pixel shaders I want, but there may be a way to use HDMA/hblank to keep the PPU sampling colors from an old scanline. I think we should try manipulating the vertical scroll offset like this:

Code: Select all

Sub DrawFrame

	Let S = the current scanline number
	Let M = the current height of a mosaicked block (this typically goes from 1 (no mosaic effect) to something big (lots of mosaic) like in Super Mario World or something big to 1 over time, like the intros for Castlevania: Bloodlines and Pier Solar, but typically stays the same while a frame is being rendered)

	For n = 1 to 4
		Let SS = the (usually previous, if M>2) scanline who's pixel color we will sample, calculated by floor(S / M)*M
		Use HDMA to scroll BGnVOFS such that the color at SS will again be drawn at S
	Next n

EndSub
Post Reply