Sign in to follow this  
yakovm

accumulator and incostent winding

Recommended Posts

I have a mesh in which not all surfaces are winded consistently in same direction also I don't know the direction of any face if it is CW or CCW .In order to solve the problem I use accumulator buffer and two side lighting one time with false and then save it to accumulator and second time with "true" and send it to accumulator too. And finally return from it (I use following commands glLightModelf(GL_LIGHT_MODEL_TWO_SIDE glAccum(GL_ACCUM ) What you do think? What the possible pitfalls could be?

Share this post


Link to post
Share on other sites
I am trying to use culling but It seem it didn't work
what do you think

glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glCullFace(GL_FRONT);
glMaterialfv(GL_BACK, GL_DIFFUSE,matCol);
//render here .....(back faces)
glCullFace(GL_BACK);
glMaterialfv(GL_FRONT, GL_DIFFUSE,matCol);
//render her..(front faces)

Share this post


Link to post
Share on other sites
Can you explain more why you are trying to do all of this?

If your models are not wound properly than I think you can just disable backface culling and use two sided lighting and you should be fine.

Why are you trying to render your front faces and then render your back faces separately?

Share this post


Link to post
Share on other sites
Part of the normals are directed incorrectly.(And I don`t know
which of them)I need to use two-sided lighting model to render these faces and(concurrently) render other (with correctly defined normals) in the regular way.

Share this post


Link to post
Share on other sites
Potential dumb question: it's not possible to take the model back into whatever package it was created in and unify the surface normals so that they all face the right way?

Share this post


Link to post
Share on other sites
Quote:
Original post by faultymoose
Potential dumb question: it's not possible to take the model back into whatever package it was created in and unify the surface normals so that they all face the right way?

no,I can`t

Share this post


Link to post
Share on other sites
Quote:
Original post by karwosts
Can you explain more why you are trying to do all of this?

If your models are not wound properly than I think you can just disable backface culling and use two sided lighting and you should be fine.

Why are you trying to render your front faces and then render your back faces separately?


Because only part of the faces are wound incorrectly

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