• Advertisement
Sign in to follow this  

VBO indices problem...

This topic is 3446 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

Hi again, I'm having quite some struggle with VBO's, more precisly indexed VBOs. Could someone explain why this works...
                        for (int i=0; i < T->meshes[a]->indexCount; i++)
                        {
                            glTexCoord2fv(&T->meshes[a]->uvs.x);
                            glVertex3fv(&T->meshes[a]->vertices[T->meshes[a]->indices].x);
                        }

...while VBO's provides funky UV's? Vertices seem correct as the structure of the models are correct. I also tried to modify the loading, and that helps to some extent - but some areas of the model are still problematic:
                mesh->uvs = new var2<float>[mesh->uvCount];
                var2<float> *uvs = new var2<float>[mesh->uvCount];
                data.read((char *)(&uvs[0]), sizeof(var2<float>)*mesh->uvCount);

                for (int i=0; i < mesh->indexCount; i++)
                mesh->uvs[mesh->indices] = uvs;

Since the immediate mode rendering can be controlled to a higher extent, I suspect that my exporter is providing false uv-coords and that I "repair" these in code. But as VBO expect a more rigid structure, rendering gets messy. I'm getting both cross-eyed and grey-haired from this dilemma, and would be grateful for any tips. :) Thank you for your time! /Robert

Share this post


Link to post
Share on other sites
Advertisement
Do check what the values of UVs are, and make sure with glEnableClientState that the texcoord0 is enabled and properly bound.

Share this post


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

  • Advertisement