In a scene in unity, we have a terrain. Because of the variety of levels, this terrain on each level load gets a new heightmap applied to it and a new texture projected onto it with a projector using the FX/Projector Multiply shader.
However, I’ve noticed a limitation with this setup and was curious if there was a work around or a better way to project something light onto the terrain? A large part of the terrain is a dark green, but it doesn’t seem to be possible to project a texture onto the terrain to create a lighter color than was previously there.
To my very basic understanding, multiply does less as a value approaches 1 (which is why projecting a completely white texture does nothing, much like in photoshop). Is there another route I can take?
The final goal was to be able to place a building onto the terrain and project a texture around the building to mimic a parking lot type thing, but I didn’t want to use geometry because the terrain is not very level and z fighting may cause problems.
You’ll have to use a different shader for that. If you want to project something with color onto a surface, multiply will never get you a proper result.
I believe you want a projector shader that uses a regular blend instead. Something like this one:
Thanks for the help, tomvds! I’ll try it later when I’m back at work.
Since I haven’t had much of any experience with shaders, I don’t know the result of using two projectors at once. Will I have issues with more than one projector casting on the same surface? Is there any sort of ordering I can handle?
Although the results are almost exactly what i was aiming for, I’ve found a snag and was curious if there was a way around it.
Although projecting multiple things onto a terrain works fine (as long as I active them in the right order so they draw in the right order), the color is a complete wash on the terrain and loses any sense of depth. The multiply shader was nice because it still took light into account, but the projector blend shader seems self-lit.
Anyone have an idea of where I can go with this projector, or am I asking for too much?
EDIT: Nevermind! It seems I can use a multiply shader for the terrain texture itself, and the fx blend shader on top of that for separate projectors putting images onto the terrain. I just need to make sure that the base multiply shader is on first to make sure things are drawn in the correct order.