Jump to content
  • Advertisement
Sign in to follow this  
Schmedly

Multitexure + Cubemapping

This topic is 4736 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've spent the better part of the weekend poking around with texture combiners, and almost everything is working correctly. The only problem I have to solve deals with texture coordinates. I'm using vertex arrays an setting things up for texturing as follows: TEXTURE0 Base texture + lighting Tex coords provided TEXTURE1 Environment cube map Tex coords generated (Texgen for GL_REFLECTION_MAP set on S, T and R, and they're enabled) When I don't explicitly provide texcoord data for TMU1, the DrawElements call fails. Providing TMU1 with the same texcoords as TMU0 allows it to run, but of course it doesn't look very good. Shouldn't texcoord generation provide the necessary data for the second TMU?

Share this post


Link to post
Share on other sites
Advertisement
Have you made sure the texture coordinate array is disabled for texture unit 1?
_How_ does the DrawElements call fail? (An OpenGL error? A crash?)

Share this post


Link to post
Share on other sites
also, (a common mistake) when you call glTexEnv it should be subsequent to
a glClientActiveTexture call (so it gets applied to the correct MTU [multi-texture-unit]) eg.
glClientActiveTexture( GL_TEXTURE1 )
glTexEnvi(...)

Share this post


Link to post
Share on other sites
Yes, the DrawElements call did crash. And yes TomasH, the second texture unit had a client state left open by a previous render call. Spent too much time pouring over the combiner code to notice it. Thanks to both of you for the replies.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!