poor shadow on complex structure

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
manurung
Posts: 10
Joined: Mon Jun 11, 2012 2:38 pm

poor shadow on complex structure

Post 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
Klunk
Posts: 264
Joined: Mon Jan 10, 2011 5:21 pm

Re: poor shadow on complex structure

Post 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.
manurung
Posts: 10
Joined: Mon Jun 11, 2012 2:38 pm

Re: poor shadow on complex structure

Post 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?
manurung
Posts: 10
Joined: Mon Jun 11, 2012 2:38 pm

Re: poor shadow on complex structure

Post 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.
Klunk
Posts: 264
Joined: Mon Jan 10, 2011 5:21 pm

Re: poor shadow on complex structure

Post 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.
manurung
Posts: 10
Joined: Mon Jun 11, 2012 2:38 pm

Re: poor shadow on complex structure

Post 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.
Klunk
Posts: 264
Joined: Mon Jan 10, 2011 5:21 pm

Re: poor shadow on complex structure

Post 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);
manurung
Posts: 10
Joined: Mon Jun 11, 2012 2:38 pm

Re: poor shadow on complex structure

Post by manurung »

Yes, thank a lot! It works. I can get rid off the unwanted shading around the sharp edges.

Thanks again!
Klunk
Posts: 264
Joined: Mon Jan 10, 2011 5:21 pm

Re: poor shadow on complex structure

Post 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.
Post Reply