Inverted Alpha (material) Please help!

Hello,

I’m currently trying to make it so that my sprite that I drew in piskel (full cave, 2dsidescroller), has a moving rainbow texture because of nausea in the game. The problem I have is that rather than the opaque areas of the cave png becoming a moving rainbow material like I made it, only the png parts are becoming the moving rainbow. so basically the background behind the character rather than the walls. I tried using OneMinus node but it just removes the material completely. The walls don’t change color. Here’s a picture of the code.

I put the OneMinus with the Alpha for the opacity mask.

Thank you in advance.

still haven’t found a solution for this, 1- removes the texture completely

What you’ve shown is a material of a moving rainbow.

There is no cave .png no character nor background. It is just a material which you need to apply to the background plane to achieve your result.

Drop a plane behind your character, slap that rainbow on it, and you are in business! :wink:

P.S.
Connecting the alpha channel in your opacity map would have no effect as your rainbow texture probably has no alpha (or its all 1s).

I’m really sorry, I should have been clearer haha.

This is before-

and this is after the material is applied

What I want is for the walls to become the rainbow rather than the background.

Keep in mind the objects you see like the icicles, plants, and nuclear crates aren’t a part of the cave png, they’re separate sprites. So are the rocks in the background - all separate sprites other than the cave. The cave is just in front of them on the y axis, that’s why the rainbow covers them.

What I want is for the rainbow to go over the opaque areas, not the transparent ones (the insides of the cave).

Thank you for responding though, I know you’re probably really busy.

Ok, I think I got it now.

  • In your rainbow material make another Texture Sample.
  • In it, take the cave png.
  • Get only the cave’s alpha (A) and plug it into the Opacity Mask leaving the Emissive Color coming from the rainbow.

You will probably need to align them later so you should make an offset parameter for your your cave UVs.

YOU’RE A GENIUS TYSM