I am trying to figure out the best way to tackle this problem I have. I am trying to figure out the easiest way (without impacting fps too much) of being able to have a vehicle “paint” what it runs over.
I asked HiggyB about this yesterday and was told “dynamically “draw” on the fly using a base “splat” texture, use some raycasting to determine what’s underneath your “painting spot” and then draw that into an overlying texture”.
Now, I’m a newbie who is normally an artist, so I have to admit what he suggested flew over my head, and so I found and asked CapnRat (from Blurst) how he did the Whitewash tech demo. It’s obviously the best way we could do this effect, but it requires Render Texture, which is a Pro-only feature.
Any insight to this would be wonderful, looking for a “new to coding” approach or I guess I should say “new to the engine”, as I’ve done the tutorials, but I am still unfamiliar with how I would effectively achieve this easily and efficiently.
The Unity reference guide says that Decals eat up moderate resources, and when you consider that your goal will be to paint an entire town, I have a feeling the game will come to a standstill
Other than shader reference, i dont see anything specifically pertaining to decals in the references.
As long as there arent too many GameObjects on the screen at one time (which would be achieved by for example combining decals into a single mesh) everything should be fine.
However, using a splat-map shader (so just like the current terrain shader, perhaps this could be a starting point: http://www.unifycommunity.com/wiki/index.php?title=LayerShader ) might be an easier route, if you can figure out how to adopt the shader to your needs. Once thats done its a matter of raycasting to find current position on surface and getting uv coordinates to figure out what portion of the splat map to paint ( Unity - Scripting API: RaycastHit.textureCoord ).