Hi folks… I’m trying to achieve a layered material effect in my project, so I can modify the top material texture without affecting the GameObject’s objects main material / look / feel.
- To do this I have 2 materials on an GameObject.
- Material index 0 is the base model material, and index 1 is the target material to modify, via a Blit on RenderTexture.
- This works to some extent, however where things fail is transparency, the material at index 1 must have a transparent background, so that you can still see the base model material at index 0 behind it.
- I’ve tried to modify how the RenderTexture is created to be transparent, by changing the camera culling and clear flags with a transparent background. Also passing in a transparent texture for the starting texture that I Blit to setup… I think I did this at the code level successfully, however visually this still did not work correctly, as I can no longer see the material underneath at index 0.
- Also worth noting that I’m using a modified ‘Standard’ shader to move the z-index of the material at index 1 forward a little to ensure it’s visible.
Hope the above makes sense, if anyone can let me know if what I’m trying to achieve is actually possible? Can you layer materials with transparency in a dynamically generated RenderTexture?
Any help / points greatly appreciated, thanks!
// WildStyle