OpenGL

Moderators: Sephiroth
Number of threads: 103
Number of posts: 200

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Light & Wind Order Posted by Tommato on 25 Oct 2010 at 11:42 AM
Hi All

My work is software render and I use OpenGL for preview only, so sorry if my question is naive.

With cull=off I've some black (unlit) polygons and I realize it happens because they have reversed wind order and/or vertices normals. However "rebuild model" is an inconvenient and time-consuming solution for user, moreover often he rotates models and expects for rational preview for both sides of surface.

With software render it's not a problem: first I adjust polygon normal to view direction, then I adjust vertices normals to polygon normal. But how to solve this in OpenGL? I've tried glMaterial and glColorMaterial with GL_FRONT_AND_BACK but it has no effect ;-(

So my question: is there a standard way to solve this prob or I should flip normal and wind myself anytime before pass them to OpenGL?

Thanks

Tommato



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.