encounter weird problem when turn on the color blending.

Started by
23 comments, last by L. Spiro 9 years, 9 months ago

Looking at those images, I don't think sorting the meshes will help.

It looks like some of them actual wrap around the other sub meshes.

If that is the case then you have a much more complex problem.

I would suggest using volume rendering, but as you stated you a newb at OpenGL, that's going to be a big issue for you. You might be able to just grab an existing OpenGL volume renderer and use it without understanding it though.

Have a look at http://idav.ucdavis.edu/~okreylos/ResDev/VolVis/MainPage.html

If that seems too much for you, then see if you can split the meshes that cause problems into two, then sort them before rendering.

Hope this gives you some ideas.

Advertisement

you mean glDisable(GL_CULL_FACE) ?

never diable cullling, instead reverse what "front face" is.

You have a well defined geometry (veru well :)) so:

gl.enable(this.m_pGL.CULL_FACE); // yes, I wish to cull
gl.cullFace(this.m_pGL.BACK); // I want to cull back face
gl .frontFace(this.m_pGL.CCW); // the front face is counter clock wise face

... so if after this you change fronts face difintion to

gl .frontFace(this.m_pGL.CW);

you will establish front faces as the back faces, thus getting culled front faces "the back faces"

and back faces as front faces, being processed, with their vertex attributes in take

was this scaned from ultra sound device, or an arbitrary artificial model being?

mind yet, that if you shade back faces with general set up of lighting or other parameters, you may get stranger results, unless you realy understand the geometry with its attributes. (you cannot observe back faces through culled front faces, if you get what I mean- very metaphysical stuff)

was this scaned from ultra sound device, or an arbitrary artificial model being?

It is just a 3DS model generated by 3DS MAX.

so did you make any tests?

so did you make any tests?

I am working on it. I am sorry to say that what you mentioned did not solve my problem.

Now it seems like not that easy to solve this issue. Some of you guys recommend me to resort all objects in a proper way, but even if only a single organ displayed in the scene, the problem still remains. And the thing is, in my case, each object is mapping to other stuff, resorting means changing everything. It does take time to solve this. Seems like a major problem to a rookie like me.

I think Ohforf sake is right, Transparency is not as simple as enabling color blending, maybe this is the key point here!

Thanks anyway!smile.png smile.png


Now it seems like not that easy to solve this issue. Some of you guys recommend me to resort all objects in a proper way, ...

Yep. Or else you try depth peeling as is suggested above by LS.


... but even if only a single organ displayed in the scene, the problem still remains. ...

Maybe this is because of the already mentioned concavity of the meshes? Question is, if you simplify the scene down to a single organ, do you have a chance to notice whether the problem occurs only if you look through a concavity. If so, then we are on the right track when suspecting the drawing order. A solution then will be to use sub-meshes.

But if concavity is not the cause, then we need to investigate further.


… And the thing is, in my case, each object is mapping to other stuff, resorting means changing everything. It does take time to solve this. ...

This isn't a problem solely related to yours. It is common in game engines and elsewhere. And hence there is a solution :)

It is possible to have more than a single order on objects. Notice that it is recommended to have several organizing structures, one for each task to do. It is absolutely fine to have a logical organization of the objects, a spatial organization (if collision or proximity is an issue), a render order, and perhaps more. Don't stuck with the über scene graph approach, or you will be lost sooner or later!

For example, you iterate the scene description and detect all objects that need to be rendered. You insert each object into a list (which is emptied before the scene is iterated). After finishing, you sort the list by some criterion, in your case using the distance from the current camera. Object rendering then is done in the order given by the list. So rendering has no influence on other aspects of object organization, and nevertheless is done in the required way.


I think Ohforf sake is right, Transparency is not as simple as enabling color blending, maybe this is the key point here!

Absolutely.

Now it seems like not that easy to solve this issue. Some of you guys recommend me to resort all objects in a proper way, but even if only a single organ displayed in the scene, the problem still remains.

can you upload somewhere this model i want to see it (one organ that is not properly displayed), maybe some face normals are reversed

Now it seems like not that easy to solve this issue. Some of you guys recommend me to resort all objects in a proper way, but even if only a single organ displayed in the scene, the problem still remains.

can you upload somewhere this model i want to see it (one organ that is not properly displayed), maybe some face normals are reversed

you mean the 3DS model? I am sure that all my 3DS model are accurate.

Is there any possibility that when I render a 3DS model into an OpenGL scene, the normals are reversed by some inconspicuous mistakes somehow?

I upload more detail images, you can check it out.rolleyes.gif rolleyes.gif

This topic is closed to new replies.

Advertisement