   Deferred Rendering and Reflections
  I've recently made the switch from a forward rendering system to a defered pipeline, and so far so good... until I came to my water reflections.In my forward renderer I transformed and lit all my geometry twice, once for the main screen, and once for the reflection map.Do I have to do the same in deferred rendering by producing a second Gbuffer for the reflections then lighting that seperately? That seems like a poor use of GPU memory to me.Is there a better approach to doing reflections than producing a reflection map in this way?   
  Hi,I'm not using water in my deferred renderer but using dynamic reflections/refractions.I'm writing diffuse info into my GBuffer with reflections and/or refractions. And with this technique, reflection/refraction process stops to be a problem in shading pass.You can see some of my results here:http://www.gamedev.net/community/forums/topic.asp?topic_id=538264There's another idea that I'm working on now:I think that water reflection/refraction can be done using z-map, normal map and diffuse map. Render your whole scene without water. During your water rendering pass, you can perform a reflection/refraction by using water's normal vectors and with the result vector, z-map and some math, you can determine a sampling coord (tx, ty) to sample your diffuse map. And you can put a reflection/refraction image on your water.A picture shows the idea here:Hope you can understand :)Rohat.[Edited by - programci_84 on June 18, 2009 5:19:42 AM];Quote:Original post by programci_84Hi,I'm not using water in my deferred renderer but using dynamic reflections/refractions.I'm writing diffuse info into my GBuffer with reflections and/or refractions. And with this technique, reflection/refraction process stops to be a problem in shading pass.You can see some of my results here:http://www.gamedev.net/community/forums/topic.asp?topic_id=538264Is that using a cubemap? I'm not sure cubemap is really suitable for water (someone correct me if I'm wrong).Quote:Original post by programci_84There's another idea that I'm working on now:I think that water reflection/refraction can be done using z-map, normal map and diffuse map. Render your whole scene without water. During your water rendering pass, you can perform a reflection/refraction by using water's normal vectors and with the result vector, z-map and some math, you can determine a sampling coord (tx, ty) to sample your diffuse map. And you can put a reflection/refraction image on your water.A picture shows the idea here:Problem with this method is that if you look straight down into water, your diffuse map has no information about what is above the water.I'm currently rendering my refractions like this as a post-process, but I think it's impossible for reflections.;Quote:Is that using a cubemap?Yes. I'm generating low-quality (i.e. 100x100) dynamic cubemaps for every reflective/refractive objects. Quote:I'm not sure cubemap is really suitable for water (someone correct me if I'm wrong).You're right. Cubemaps are never suitable for plain surfaces like walls, floors etc.Quote:Problem with this method is that if you look straight down into water, your diffuse map has no information about what is above the water....but I think it's impossible for reflections.Yes, you're right. It can work only if viewer looks onto water surface with 0..45 degrees of angle. For example, viewer is on a bridge and looking onto the water with approx 30 degrees of angle. Objects behind the viewer or outside the view frustum is not important here. We can perform mountain and/or sun reflections easily. This reflection algorithm will fail on showing reflections behind the viewer, I know. But this algorithm is nice for especially refractions :)   