Sign in to follow this  
Kyall

glDrawElements - textures or whatnot

Recommended Posts

I'm making a gl engine for my game. And I've been reading continious things about this glDrawElements thing. I only have a vague idea how to use it so I would like someone to explain it to me. But more importantly... does texturing work in glDrawElements. Basically, for my game I have textured terrains and characters. Will using the glDrawElements function allow me to keep my textures correct or not? If not I can't use it, but if so.. how? please explain.

Share this post


Link to post
Share on other sites
Yes you can use textures with glDrawElements but you will need to look up vertex arrays or VBO. Look into a tutorial on how to use/setup vertex arrays.

Share this post


Link to post
Share on other sites
The only thing to keep in mind if you're having more than one set of texture coordinates is that vertices with different tex coords are different vertices. However, you can give each vertex a whole lot of texture coords, but will have to look up on how to get them to be blended and used the way you want. Once you get past the initial hassle of changing to shaders or vertex/fragment programs it is a lot more comfortable and giving a lot more control and options, anyway.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this