Semi-transparency

New to the Saturn, I started to write some programs using the SaturnRingLibrary devkit.

And of course I had to test half-transparency for myself. But one thing which surprised me is that, contrary to what I hear everywhere, when I draw a sprite using
SRL::Scene2D::SpriteEffect::HalfTransparency, it works with the sprites which are behind but not the VPC2 background. i.e. the sprite behind the half-transparent sprite is visible, but not the background.

I thought this was the other way around?
 
that's correct.
Sprite half-transparency is a form of VDP1 color calculation.
VDP1 has no clue what VDP2 is doing, but it does know what it is in its framebuffer.
So it can do color calculation between pixels written and being written to the framebuffer, but it can't do color calculation with anything VDP2 is doing.

This is contrast to VDP1 mesh drawing, which is effective on CRTs in all conditions.

It is also in contrast to VDP2 color calculation, which can get incredibly complicated but suffice to say is an effect that can be performed between layers and depending on how VDP2 is set up, it can perform that color calculation on select pixels in VDP1 framebuffer between its own layers (but importantly, not other pixels in the framebuffer) or (usually) an entire layer with other entire layers.
 
In Guardian Heroes, Nicole has a half-transparent cloak which shows the background but hides the sprites behind her. Do you know how this is achieved?
 
This is an indexed color sprite drawn in such a way where VDP1 draws pixel codes which VDP2 then interprets as color calculation symbols in the specific order of layers set up for that game\scene. The way Guardian Heroes manages its transparencies is pretty complex, but that's more or less what is happening in that example. Exactly how to set that up in SRL I do not know. With SGL, there's many stages to setting this up:
First you have to set the color calculation ratios for each specific layer with slColRate.
You also have to set the priority for each step with slPriority.
You have to initialize with settings to elucidate which background layers will receive transparency from the SPR (VDP1) layer:
slSpriteCCalcCond(CC_pr_CN); (color calculation condition)
slColorCalcOn(CC_RATE | CC_TOP | SPRON | BACKON); (example of color calculation from SPR to BACK layer)
You of course also have to manage the priority of the individual background layers as well. Example:
slPriorityNbg0(1); //Put NBG0 just above BACK
slPriorityNbg1(6); //
slPriorityNbg2(7);

Then, according to the Sprite Data Type setting (which I only know how to change by manually setting the register), you can place bits in the appropriate place for color calculation, provided the pixel being drawn is indexed color. This is done in the color bank field of the draw command.


To get any of this to work, you are going to have to reference the VDP1, VDP2, and SGL Function Reference manuals thoroughly.
 
Last edited:
Back
Top