pvsneslib icon indicating copy to clipboard operation
pvsneslib copied to clipboard

Make transparency effect work on top of sprites (on Mode 3)

Open diegoleao opened this issue 5 years ago • 4 comments
trafficstars

Hi, I didn't find in the documentation a way to make transparency effects work on top of sprites, like the water in Secret of Mana: transparency-secret-of-mana-2 1

Actually, I don't know yet how to put any background layer on top of sprites, I just looked in the examples folder but I don't think there is an example for it (we do have the "Transparency" example of course, but the clouds pass below sprites, only being on top of the background layers).

[EDIT] I included a zip in my next post with an example of sprite between bgs, but still no transparency... :(

So my two questions are:

  • How can I put sprites in-between background layers? [Solved]
  • How do I make high priority Backgrounds (which are on top of sprites) transparent? What are the parameters in this specific instance? [Not solved : P]

Thank you!

diegoleao avatar Oct 22 '20 13:10 diegoleao

Hi,

To put sprite between 2 layers on background, you need to use priority flag on sprite (in oamSet function, the 4th parameter) but the value depend the mode you use and the priority of your backgrounds too. The priority of each tile is defined when you create your map. You will have better explanations here : https://wiki.superfamicom.org/backgrounds

For transparency, i do not know but i am interested too (or for other effects like the flash screen when you use the cannon in secret of mana).

hoit avatar Oct 23 '20 22:10 hoit

Thank you! ;) Well, even so, after I made that layer top priority, it didn't work with transparency...

Here is what I did (obs: I'm using Mode 3):

  • Changed the gfx2snes parameters of BG2 (16 colors) to include "-mp" which according to the documentation, converts the entire picture to high priority mode (I'm assuming all tiles). $(GFXCONV) -n -pr -mp -pc16 -gs8 -pe1 -fbmp $<

  • Put my sprite at priority 1, because according to SFC Development Wiki, in mode 3 this is the first priority in which my character shows above BG1, but below BG2: oamSet(spriteLayer, xPos, yPos, 1, ...

SFC Development Wiki: image

However...

This is how the clouds looked before: image

This is the how the clouds look after: image


Zips Attached:

  1. Project with Mode 3 and transparency, but always under sprite: Mode3_Transparency_NoPriorityForBG.zip

  2. Project with Mode 3 and transparency, but "clouds.pic" is built with high priority flag ( -mp ): Mode3_TransparencyIssue_CloudsWithPriority.zip

diegoleao avatar Oct 24 '20 06:10 diegoleao

From https://wiki.superfamicom.org/transparency

"Remember that the effect can be enabled separately for all layers of the main screen, with the exception of sprites. For sprites, the effect is either always disabled, or if enabled only sprites using palettes 4, to 7 have the effect applied to them. Sprites with palettes 0-3 are still part of the main screen, but you can't apply a transparent effect to them. One way around this is to make palettes 4-7 mirrors of 0-3 so that you can select individually on each sprites, but in most cases there is a work around this annoying limitation (see below for more details)."

Did you checked the sprites palettes ?

lintbe avatar Oct 27 '21 12:10 lintbe

Yes, unfortunately, the result was the same :(

diegoleao avatar Oct 27 '21 12:10 diegoleao