Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Burning_Ice

OpenGL using OpenGL functions or write my own?

This topic is 6922 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 i''m about to start my very first 3D Engine and hav not yet very much knowledge about the whole stuff...so this may be a stupid question but i hope someone will show me the right way ;-) I read some tutorials about 3D coding stuff and OpenGL Many of the tutorials describe quite good how to implement things like Face culling and clipping against the view frustum or similar thing. My question now is, is it really useful to make all this calculation myself, when i can sinply make a call to glEnable ( GL_CULL_FACE ) or specify some clipping planes and let OpenGL do the stuff, which i think are way faster...or aren''t they?? And is there really a need to adjust all vertices to my FOV with my own calculations or is gluPerspective ok? I hope someone can tell me if there really is a need to write all these calculations myself, when i want my engine only to support OpenGL? Thanks for your time Burning_Ice

Share this post


Link to post
Share on other sites
Advertisement
The API is responsible of part the work.
You need to know how the engine do the stuff for you, to know if you can do it yourself in an optimized way.

For example OpenGL does (as Direct3D) 2D backface culling.
Thjis is all your vertices are processed, transformed, clipped and projected before seeing if they''re facing the right side to you.
I use my own software to kill the vertices backfacing the view frustrum using vertex normal before any transformation, speeding up the process.

For the transformation, I recommend you to let OpenGL do it, cause it''ll use hardware T&L if available, which will increase the speed of the renderin porcess.

Hope it helps.

-* Sounds, music and story makes the difference between good and great games *-

Share this post


Link to post
Share on other sites
If you''re just getting started with 3D, I''d suggest you forget about using a 3D API for now, and write a software renderer. That way, you will have a much more intimate understanding of what you''re doing, which can be a great benefit when it comes time to optimize. After you''ve learned how things work, THEN use the API''s to get hardware acceleration. Good books to get are Michael Abrash''s Graphics Programming Black Book, in addition to the usual theory books like Computer Graphics Principles and Practice and Real Time Rendering.

Share this post


Link to post
Share on other sites
Woah ... thats going to take a long time. I once wrote a wireframe perspective renderer with flat shading in GDI. Anyway, what kind of optimizations do U guys do ?

Share this post


Link to post
Share on other sites

  • 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!