PDA

View Full Version : texture indirection methods



mogumbo
09-23-2003, 01:43 PM
I'm working on an app where I want to do some fancy environment mapping with cubemaps. I have already wrapped a surface with a normal cubemap using glTexGen. It's similar to a normalization cubemap, except that mine is animated with ripples so all the normals move around a bit.

I want to use these normals to calculate reflection vectors that point into my background cubemap. I already know how to do this with ARB_fragment_program and I assume I can do it with ARB_fragment_shader (I just haven't bothered to learn that one yet).

I'm just curious if there are other methods for doing this type of texture indirection without using fragment programs. Are there any? Maybe some sneaky multipass or multitexture tricks that I don't know about?

Korval
09-23-2003, 02:14 PM
I'm just curious if there are other methods for doing this type of texture indirection without using fragment programs. Are there any?

Not without render/copy-to-texture operations.

gumby
09-23-2003, 03:08 PM
Can you do what you want with dependent texture reads??

Eric Lengyel
09-23-2003, 03:11 PM
As long as you're not calculating the normals in the fragment program itself, the bump-mapped environment mapping can be accomplished using the GL_NV_texture_shader extension. In particular, you would use the GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV operation. See The OpenGL Extensions Guide (http://www.terathon.com/books/extensions.html) for details.

[This message has been edited by Eric Lengyel (edited 09-23-2003).]