PDA

View Full Version : Help with Reflection cube maps on glass transparent surface.


Nicholas Christopher
07-15-2007, 10:20 AM
My title says it all.

Trying to get Reflection cube maps to work on a transparent 'glass' like surface.

Anyone know of an example of this to help me find my errors, or to literally change my approach.

Having numerous issues, here are two of them:

I got the cube map extension working, and rendering it to a surface.
The problem is when I rotate the camera, at a certain point the texture will flip, or change abruptly the way it is being projected onto the surface.

The other is the texture scale is constant to the camera. no matter how far
I move away from the surface the reflected result is the same.



NC

Reedbeta
07-15-2007, 11:56 AM
I have a dynamic reflection/refraction demo in OpenGL on my website (http://pages.pomona.edu/~nrr02004/opengl.html), but it's a little dated (uses pbuffers instead of framebuffer objects, and GLSL instead of Cg, I believe).

gz0
07-16-2007, 06:33 AM
Your demo is nice reed, on my computer the cube map textures are somewhat fubared though ;)

op, how are you setting your texture coordinates? Are you using shaders?

Here are some resources that might help:
http://www.ozone3d.net/tutorials/glsl_texturing_p04.php
http://developer.nvidia.com/object/cube_map_ogl_tutorial.html
http://developer.nvidia.com/object/Projective_Texture_Mapping.html

gl

Reedbeta
07-16-2007, 09:43 AM
on my computer the cube map textures are somewhat fubared though

Yeah, I've seen that problem too, the cube map textures aren't rendered but are full of randomish bits. Seems to happen with nVidia cards (I originally developed the demo on ATI). I guess I'm setting up the pbuffers wrong somehow. Anyway, I'm not too inclined to fix it, seeing as no one uses pbuffers anymore... ;)

Nicholas Christopher
07-16-2007, 06:50 PM
thanks RB, gz0.

btw RB: "textures are somewhat fubared" same for me on my NV.



how are you setting your texture coordinates? Are you using shaders?


I assume this is aimed at me, and not RB. no shaders, and no coords either.

Most examples I have found let opengl deal with texture coords when using cubemaps.

btw: I have tried texture coords to no avail.