Merging colors of 2+ Projectors

Hello,

I am creating a game where the player is able to throw paint upon objects in the game world to reveal it. Initially the game world is mostly white, so they throw their colored paint to reveal walls, objects, etc.

Right now I create a projector to apply paint to surfaces, and these projectors are of red/blue/yellow color paint splats. However when two or more projectors hit any given area, the colors are not merging as I would expect them to.

My desired effect is to have the colors merge to their correct color when the projectors intersect, so red + yellow = orange, yellow + blue = green, etc. The current observed effects are:

  • red + blue = black
  • red + yellow = red
  • yellow + blue = black
  • all three together = black

9146-splatter.png

I am currently using the Projector/Multiply shader on my material being projected. I know I have to use shaders to apply these rules, however I have no idea where to start, as I don’t have much training or knowledge in shaders.

Could somebody please give me some references where I could learn to get my desired effect, or help me find a shader which already does this?

Thanks for your time.

Personally I don’t have much experience with shaders either, but I think this can be achieved in a shader.

What you probably are looking for is blending colors. Perhaps in your current shader you are using additive color, which mean you have to go into that shader and change it to blending colors.

ShaderLab syntax: Blending

This is the best shot I can give you, but I may be wrong.