Horde3D
http://horde3d.org/forums/

Reflection (cube) maps
http://horde3d.org/forums/viewtopic.php?f=2&t=457
Page 1 of 1

Author:  cantele [ 09.08.2008, 11:38 ]
Post subject:  Reflection (cube) maps

Have you tried these with Horde? Would it work with it currently or need new features? I think I understand the technique but is there some kind of middle phase in the process that isn't supported?

From Wikipedia I witness:

"Cube mapped reflection is done by determining the vector that the object is being viewed at. This camera ray is reflected about the surface normal of where the camera vector intersects the object. This results in the reflected ray which is then passed to the cube map to get the texel which the camera then sees as if it is on the surface of the object. This creates the effect that the object is reflective."

Isn't this whole process implementable in a geometry and fragment shader? What I mean basically is: are cube maps supported in this way? I know there is some support for cube maps but where have they been used...

Another question about the special cube map format... how to produce maps in that special format?

I just noticed another thread about this:
viewtopic.php?f=2&t=365&start=0&st=0&sk=t&sd=a&hilit=cube+map

Author:  DarkAngel [ 09.08.2008, 16:03 ]
Post subject:  Re: Reflection (cube) maps

Geometry shaders aren't needed to use cube-maps as a reflection texture like in your quote. Your fragment shader just needs to calculate a reflection ray and then use that to sample the cube-texture.

The parallax shader uses a cube-map as an ambient light source. To use a reflection map, you would want to reflect the eye-vector according to the surface normal, instead of just using the normal like the parallax code does here:
Code:
               // Transform normal from tangent space to world space
               vec3 normal = tsbMat * normalMap;
               
               gl_FragColor.rgb = albedo * textureCube( tex7, normal ).rgb;


That other thread is about rendering *to* a cube map, which would require a few changes to Horde AFAIK.

Author:  marciano [ 09.08.2008, 19:49 ]
Post subject:  Re: Reflection (cube) maps

You can check the skinning_metal shader of the Knight sample. It already uses static cube map reflections. The only thing not supported so far is render-to-texture for cube maps in order to create dynamic reflection maps.

The vertical cross format is supported by a few tools (I think also by the ATI cube map tool). But you can also place your cube faces in the cross layout by hand using Photoshop.

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