Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
diegoleao opened this issue Oct 22, 2020 · 4 comments
Open

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

diegoleao opened this issue Oct 22, 2020 · 4 comments

Comments

@diegoleao
Copy link

diegoleao commented Oct 22, 2020

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!

@hoit
Copy link
Collaborator

hoit commented Oct 23, 2020

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).

@diegoleao
Copy link
Author

diegoleao commented Oct 24, 2020

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 diegoleao changed the title Make transparency effect work on top of sprites Make transparency effect work on top of sprites (on Mode 3) Jun 6, 2021
@lintbe
Copy link

lintbe commented Oct 27, 2021

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 ?

@diegoleao
Copy link
Author

Yes, unfortunately, the result was the same :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants