Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

To apply my effect, I should draw only several specific objects into a RenderTexture, with their material, and then use the RenderTexture as a texture for an another object. I think Graphics.DrawMesh() and Graphics.SetRenderTarget() would be helpful.

In other words: I want to create a refractive water, which will refract only specified GameObjects, not layers. How can I do this?

share|improve this question

1 Answer 1

I'd probably use layers for this: put all objects that you want to reflect onto a 'Reflectable' layer. You can set the regular scene camera to render that layer like any other, but then you set the camera that renders your RenderTexture to only be able to see that layer.

share|improve this answer
    
Okay, it seems to be right. But if I have, for example two pools at the stage, then I have to draw both of them into each RenderTexture. So I will have a n^2 - n redundant draw calls, where n is the number of water planes. –  Netherwire Jul 20 at 9:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.