Horde3D

Next-Generation Graphics Engine
It is currently 22.11.2024, 18:36

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Reflection (cube) maps
PostPosted: 09.08.2008, 11:38 
Offline

Joined: 03.07.2008, 01:23
Posts: 50
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


Top
 Profile  
Reply with quote  
PostPosted: 09.08.2008, 16:03 
Offline

Joined: 08.11.2006, 03:10
Posts: 384
Location: Australia
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.


Top
 Profile  
Reply with quote  
PostPosted: 09.08.2008, 19:49 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 22 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group