accumulator and incostent winding

Recommended Posts

yakovm    100
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 on other sites
yakovm    100
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 on other sites
karwosts    840
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 on other sites
yakovm    100
Part of the normals are directed incorrectly.(And I dont 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 on other sites
faultymoose    128
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 on other sites
yakovm    100
Quote:
 Original post by faultymoosePotential 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 cant

Share on other sites
yakovm    100
Quote:
 Original post by karwostsCan 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