Horde3D
http://horde3d.org/forums/

Cubemaps/reflections
http://horde3d.org/forums/viewtopic.php?f=2&t=365
Page 1 of 1

Author:  Manny [ 10.06.2008, 16:05 ]
Post subject:  Cubemaps/reflections

Hi,

I'm currently trying to implement some reflections on objects (dynamic objects, and also water). For the dynamic objects I'd like to render a cubemap so I was wondering if there any support planned for dynamic cubemaps? I've had a brief look into it and it doesn't look like it would take too much to add it but I just wanted to check I'm on the right track.

- Create 6 pipeline xmls - one for each camera required to render the cubemap. Presumably there would be some additions to Horde here to configure the rendertarget to be a face in a cubemap. I'm fairly new to openGL so I'm thinking in terms of DirectX until I actually look into how rendering to a cubemap actually works in openGL.

- At runtime, before the main scene is rendered, set the cameras up appropriately and render the scene from each camera.

- Bind the rendered cubemap as a global texture allowing objects with reflective shaders to assume the cubemap is there, similar to the shadowmap ...?



For water I was intending to render the reflected geometry into a texture which is then used when rendering the water (based on this article) but due to a few issues like having to set user clip planes etc. which would again involve adding various things to Horde, it doesn't seem like the ideal approach. Has anyone else done any water rendering? I notice one of the projects (Aerosion Demo) done with an early version of Horde has water. Is anyone aware of how it was implemented? Perhaps just having the scene actually duplicated under the water?

Anyone have any thoughts on either of the above?

Thanks

Author:  marciano [ 14.06.2008, 13:42 ]
Post subject:  Re: Cubemaps/reflections

You don't need six different pipelines. I would do it analogous to the current 2D render-to-texture mechanism.

- Add a function createTexureCube (analogous to createTexture2D)
- Modify CameraNodeParams::OutputTex to accept cube maps
- Use CameraNodeParams::OutputBufferIndex as the cube map face index

Due to our deadline coming closer, the water rendering for Aerosion was directly hacked into the engine. But I think this presentation could be very interesting for you:

http://www.terathon.com/gdc07_lengyel.ppt

It shows how to modify the projection matrix to get a user clip plane for e.g. water rendering.

Author:  Manny [ 17.06.2008, 15:18 ]
Post subject:  Re: Cubemaps/reflections

Cool, I'll have a look at that when I have a chance :)

Thanks.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/