Jump to content
  • Advertisement
Sign in to follow this  
punmaster

OpenGL Separate index for position, normal, texture coordinate

This topic is 3614 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 read that OpenGL 2.0 has added support for having multiple indices for each face, allowing me to separately index arrays containing position, normal, and texture coordinate data. Which extensions (I'm on Windows) would I need to use to take advantage of this functionality? Are there any samples / tutorials showing how to do this? Thank you. :)

Share this post


Link to post
Share on other sites
Advertisement
Hmm. I thought is was described in an article detailing new support for geometry sharers. Maybe they were implying that you could write a shader to do this, but it is not supported natively. Either way, thank you. Guess I'll stick with repeated vertices for now. :)

Share this post


Link to post
Share on other sites
Quote:
Original post by punmaster
Hmm. I thought is was described in an article detailing new support for geometry sharers. Maybe they were implying that you could write a shader to do this, but it is not supported natively. Either way, thank you. Guess I'll stick with repeated vertices for now. :)


Well what exactly are you trying to do? Maybe we can help you get what you want.

Share this post


Link to post
Share on other sites
I am writing a cross-platform game engine for the PC and the Wii. For the most part, the PC side of things has been much easier because, unlike the Wii's libraries, OpenGL is very well documented and relatively easy to debug. Still, the Wii does have some interesting features. One in particular, that I recently discovered, is the ability to use separate indices for each vertex component (position, normal, texture, etc.). Given the Wii's very limited memory and graphics resources, this seemed like a feature I wanted to take advantage of, especially given that most modeling programs store data in this format anyway. The catch is that if I am going to encode my models like this, the PC version will need to be able to handle them too. Likewise, I went in search for some way to do this in OpenGL, and stumbled upon a few short articles talking about some new types of shaders supported in OpenGL 2.0. The article briefly mentioned that one thing they could be used for is the multiple index system stated above. I came here with the hope that somebody could help point me in the right direction as far as implementing it. I apologize if this sounds crazy, and I can always stick with the old system if nothing can be done, but I was hoping someone would have some ideas. Either way, thanks for your help. :)

Share this post


Link to post
Share on other sites
Quote:
Original post by punmaster
I am writing a cross-platform game engine for the PC and the Wii. For the most part, the PC side of things has been much easier because, unlike the Wii's libraries, OpenGL is very well documented and relatively easy to debug. Still, the Wii does have some interesting features. One in particular, that I recently discovered, is the ability to use separate indices for each vertex component (position, normal, texture, etc.). Given the Wii's very limited memory and graphics resources, this seemed like a feature I wanted to take advantage of, especially given that most modeling programs store data in this format anyway. The catch is that if I am going to encode my models like this, the PC version will need to be able to handle them too. Likewise, I went in search for some way to do this in OpenGL, and stumbled upon a few short articles talking about some new types of shaders supported in OpenGL 2.0. The article briefly mentioned that one thing they could be used for is the multiple index system stated above. I came here with the hope that somebody could help point me in the right direction as far as implementing it. I apologize if this sounds crazy, and I can always stick with the old system if nothing can be done, but I was hoping someone would have some ideas. Either way, thanks for your help. :)


First off let me say, I am jelious :[ I want to program for the wii soooo bad, but dont have the money..

But, If the values are only being used in the given shader why wont varying work? If you need to pass the values to multiple shaders, only method I know is using frame buffer objects (fbo). This is used a lot in gaming, and shouldn't cause much memory issues on moderner hardware. Now, I don't know how much memory the wii has, and I have believed it to hold at least 512mb if not 1gig, but by your post im guessing not a lot, so you should already be making it in a low memory way, so adding fbo's should be much of a pain.

Hope this helps.

Share this post


Link to post
Share on other sites
Quote:
Original post by punmaster
I am writing a cross-platform game engine for the PC and the Wii. For the most part, the PC side of things has been much easier because, unlike the Wii's libraries, OpenGL is very well documented and relatively easy to debug. Still, the Wii does have some interesting features. One in particular, that I recently discovered, is the ability to use separate indices for each vertex component (position, normal, texture, etc.). Given the Wii's very limited memory and graphics resources, this seemed like a feature I wanted to take advantage of, especially given that most modeling programs store data in this format anyway. The catch is that if I am going to encode my models like this, the PC version will need to be able to handle them too. Likewise, I went in search for some way to do this in OpenGL, and stumbled upon a few short articles talking about some new types of shaders supported in OpenGL 2.0. The article briefly mentioned that one thing they could be used for is the multiple index system stated above. I came here with the hope that somebody could help point me in the right direction as far as implementing it. I apologize if this sounds crazy, and I can always stick with the old system if nothing can be done, but I was hoping someone would have some ideas. Either way, thanks for your help. :)


One alternative to run-time support on the PC is to have your toolchain automatically convert from the Wii approach to the PC limitation by automatically creating extra vertices that contain each required combination of attributes (pos, norm, UV, etc).

Most games I've worked on generate completely separate data files for each platform (mostly because of endianness but also for other reasons), so this is not out of the ordinary.

This is very similar to the problem of converting a DAG (directed acyclic graph) like those in Maya to a tree and then into a list.

Share this post


Link to post
Share on other sites
Quote:
Original post by cherryyosh
Now, I don't know how much memory the wii has, and I have believed it to hold at least 512mb if not 1gig, but by your post im guessing not a lot, so you should already be making it in a low memory way, so adding fbo's should be much of a pain.


From what I understand, the Wii has a TOTAL of 88MB of RAM (some of that is reserved for different things, like texture and audio memory, and I'm sure someone else can be more specific). It sounds like it'd be tough to develop for...

I second Nypren's approach. For a quick hack, you can have your PC and Wii builds optimize the data structure of the models when they get loaded up. However, in my experience, you get the best results by generating platform-specific content at compile-time. Most major cross-platform engines have this functionality (Cryengine 2, Unreal 3, Source [I think]). Since iterating on the PC is so much faster, I always just build all the content in the preferred PC format (Windows, I assume), and then build a utility to convert to the other platform-specific data types.

Share this post


Link to post
Share on other sites
Quote:
Original post by generaleskimo
Quote:
Original post by cherryyosh
Now, I don't know how much memory the wii has, and I have believed it to hold at least 512mb if not 1gig, but by your post im guessing not a lot, so you should already be making it in a low memory way, so adding fbo's should be much of a pain.


From what I understand, the Wii has a TOTAL of 88MB of RAM (some of that is reserved for different things, like texture and audio memory, and I'm sure someone else can be more specific). It sounds like it'd be tough to develop for...


Oh man, that's insane. I could see most of the fun little party games not needing much, but a game like zelda, or okami (only ones I can comment on).. How?? But that value really does seem small, s this just for the wii? or are the other consoles as low or near as low on the memory?

PS. I dont mean to hijack, but hardware specs are hard to find, and I really am intrested in programming for consoles once I can afford it.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!