double sided faces?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Blender3D
Posts: 7
Joined: Thu Aug 14, 2008 11:24 am

double sided faces?

Post by Blender3D »

Hallo, guys

I have a short question about the engine. I modified the 08.SpecialFX example so that only the light with his billboard an the room was left. Then I added a tree made by myself to test shadows. Therefore I used the *.3ds fileformat exported from Blender. And everything works well but the shaows do not look good enought. I guess that double sided faces would solve my problem. Does anyone know if Irrlicht supports them and/or how they are activated?

--Blender3D

PS:
I know my english is horrible.
cat /dev/brain | sort
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

you can turn back face culling on/off on a nodes material with something along the lines of node->setMaterialFlag(EMF_CULL_FACE, false);

Is it a shadow volume you're using? They're quite poor and have bad performance, you're better off using a shader, there are a few in the projects forum that you can use, so try one of those out.
Image Image Image
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You mean material.BackFaceCulling=false?
Blender3D
Posts: 7
Joined: Thu Aug 14, 2008 11:24 am

Post by Blender3D »

Yes, I am using addShadowVolumeSceneNode(); but it does not compile with
anode->setMaterialFlag(EMF_CULL_FACE, false); because it says that EMF_CULL_FACE was not declared in that scope.

--Blender3D
cat /dev/brain | sort
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

That was a guess on my part, either it needs video:: in front of it or i just remember the name wrong, check the docs for the correct parameter.
Image Image Image
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

EMF_BACK_FACE_CULLING is the proper enum value. And it's in video namespace.
Blender3D
Posts: 7
Joined: Thu Aug 14, 2008 11:24 am

Post by Blender3D »

Thanks for replying guys...

I can tell you: The model looks much better now, but the shadow is as bad as before. The Shadow looks better, if I take the model twice: once with normals outside an once with normals flipped. But that gives very very poor performance.

Another question: How can faces be smoothed in Irrlicht?

--Blender3D
cat /dev/brain | sort
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The 3ds file format is loaded with duplicated vertices in Irrlicht. This means that no vertices or edges are shared among the faces. The shadow calculation relies on this fact, though. Hence, problems are expected. You can try to use a different format. Another way could be the MeshManipulator method createMeshWeldedVertices. You can also set a separate, simplified mesh for shadow generation in the latest SVN trunk version of Irrlicht (upcoming for Irrlicht 1.5). This could help if you have problems with material properties when exporting to other file formats.
Blender3D
Posts: 7
Joined: Thu Aug 14, 2008 11:24 am

Post by Blender3D »

Thanks for replying guys...

--Blender3D
cat /dev/brain | sort
Post Reply