01-20-2023, 08:30 AM
Hi!
The effects you mention could be implemented in Tilengine right now, combining layer clipping and layer blending. The ability of the SNES to clip the portion of the layer that lies outside of a pair of x1 - x2 values is what's implemented in tilengine's clipping.
However the SNES can do much more, after watching the video you posted and reading this excellent documentation:
http://emudev.de/q00-snes/windows-bg-pri...-pipeline/
1. Inverse masking: draw what lies outside the x1 - x2 values and skip the inner section
2. Do color math (transparency) with the masked out portions and a fixed color
3. Build clipping masks composed of two rectangles and do bitwise math between them
Tilengine is not an SNES emulator. However I always seek for inspiration on classic systems to implement new features, and I think I could implement points 1 and 2 in Tilengine with relative ease without compromising performance. Point 3 will be left out for now.
Regarding the question about how to do the color trick without changing the palettes, you can do it with two layers in Tilengine:
1. Background layer without priority holds the basic background with standard palette
2. Foreground layer with priority enabled holds a vertical color gradient between black and half intensity red, and enable blending mode BLEND_ADD.
Additive blending of the foreground layer will cause the underlying elements to get progressively lighted with a red tint
The effects you mention could be implemented in Tilengine right now, combining layer clipping and layer blending. The ability of the SNES to clip the portion of the layer that lies outside of a pair of x1 - x2 values is what's implemented in tilengine's clipping.
However the SNES can do much more, after watching the video you posted and reading this excellent documentation:
http://emudev.de/q00-snes/windows-bg-pri...-pipeline/
1. Inverse masking: draw what lies outside the x1 - x2 values and skip the inner section
2. Do color math (transparency) with the masked out portions and a fixed color
3. Build clipping masks composed of two rectangles and do bitwise math between them
Tilengine is not an SNES emulator. However I always seek for inspiration on classic systems to implement new features, and I think I could implement points 1 and 2 in Tilengine with relative ease without compromising performance. Point 3 will be left out for now.
Regarding the question about how to do the color trick without changing the palettes, you can do it with two layers in Tilengine:
1. Background layer without priority holds the basic background with standard palette
2. Foreground layer with priority enabled holds a vertical color gradient between black and half intensity red, and enable blending mode BLEND_ADD.
Additive blending of the foreground layer will cause the underlying elements to get progressively lighted with a red tint