Page 1 of 1

poor shadow on complex structure

Posted: Wed Jan 02, 2013 2:26 pm
by manurung
Hi All,

I am not sure if this is the right section to ask about this question.

I am using Irrlicht for my research to visualize my robot. As you can see in the attachment, since I am trying to render very complex mechanical structure, Irrlicht gave me broken shadowing on connections and holes. Is this something common common in Irrlicht?

Image

Before I was trying Coin3D for this purpose, it was perfect. However, I found Irrlicht to be easier to use. If you guys know about Coin3D which is a clone of OpenInventor, and is widely use for scientific and research purpose, you will probably agree with me that it is not easy to use it, compared to Irrlicht of course.

Best,
Auralius

Re: poor shadow on complex structure

Posted: Wed Jan 02, 2013 3:27 pm
by Klunk
are we talking shading or shadowing ? but it looks like dodgey normals, it's difficult to tell what the arrow are pointing at on the blue and yellow thing though.

Re: poor shadow on complex structure

Posted: Thu Jan 03, 2013 12:19 pm
by manurung
Correct me if I am wrong. I had an object, an OBJ file. And than I added some lights. So probably this is what you call shading. Am I right?

Re: poor shadow on complex structure

Posted: Thu Jan 03, 2013 12:22 pm
by manurung
I forgot to tell that in the area where the lines are pointing, they are very sharp angle parts. For example: parts with holes or two separated part when you try to connect them but leaving very small unnoticeable gap in between.

Re: poor shadow on complex structure

Posted: Thu Jan 03, 2013 12:45 pm
by Klunk
yes that would be shading not shadow. As mentioned above the problem you hilite looks like an issue with normals being "bent" at the edges. I haven't used it myself but i think the IMeshManipulator class can be used to recalculate the normals, see if that helps.

Re: poor shadow on complex structure

Posted: Thu Jan 03, 2013 2:19 pm
by manurung
Sorry for another stupid question. I checked your suggestion and I found that recalculateNormals is a pure virtual funciton. Does it mean I have to derive IMeshManipulator class and implement my own normal recalculation routines?

Thanks.

Re: poor shadow on complex structure

Posted: Thu Jan 03, 2013 2:24 pm
by Klunk
I think you get a pointer for the IMeshManipulator from the scenemanager something like....

Code: Select all

IMeshManipulator  *mm = smg->getMeshManipulator();
mm->recalculateNormals(my_mesh_ptr);

Re: poor shadow on complex structure

Posted: Thu Jan 03, 2013 2:41 pm
by manurung
Yes, thank a lot! It works. I can get rid off the unwanted shading around the sharp edges.

Thanks again!

Re: poor shadow on complex structure

Posted: Thu Jan 03, 2013 2:53 pm
by Klunk
cool, probably an issue with the exporter/3d package or something and perhaps colin3d rebuilds the normals as a matter of course so the problem was hidden.