Page 1 of 2

[SOLVED]problem with displaying a bsp map

Posted: Sun Apr 09, 2006 8:31 pm
by Belshamaroth
hello everyone,

i started designing a fps game with this engine a few time ago. i thought using .bsp maps would be an amazing solution for the level creation as i have designed some levels in gtkradient before.
but everytime i load them into the engine (like described in the tutorial) there are many very strange display errors where planes that lie behind others are drawn in front of them and so on. additionally some of my mesh-planes even dissappeared if the lightmap has drawn them nearly black.

you know that error? i searched the whole forum two days but found nothing.

mfg
Jonas

ps: i add an screenshot below:
<img>http://loretta-with.no-ip.org/screenshot.jpg</img>

(if the image is not sightable the server may be down)

Posted: Mon Apr 10, 2006 8:32 am
by bearSoft
use http://imageshack.us/ to post the screenshot.
noone know what wrong now..

Posted: Mon Apr 10, 2006 2:06 pm
by Belshamaroth
ok i uploaded it to a different server.
hope you can identify the error now.
normaly you should see only the corridor with the red wall to the right.
but the wall out of grey stones which lies far behind this is shining through.

Image

Posted: Tue Apr 11, 2006 12:48 pm
by Belshamaroth
why does nobody answer?
is my question not definite enough to be handled?
or should i add my own way to solve this problem?

Posted: Tue Apr 11, 2006 12:56 pm
by sudi
Sry but the image is really dark and i really can barely see anything.....maybe post some code....or upload the source and the bsp and I will try to solve it.

Posted: Tue Apr 11, 2006 1:04 pm
by Belshamaroth
ok i packed my whole project dir:

http://loretta-with.no-ip.org/learning_by_doing.rar

Posted: Tue Apr 11, 2006 2:22 pm
by etcaptor
Hi, to avoid this you can change to false backface culling flag for each material of your bsp node. I just tryed this and bsp node displays well.

Posted: Tue Apr 11, 2006 2:49 pm
by hybrid
So this means that the normals of your project are not correct. Check with your exporter if you can change this, or try to recalculate all of them in Irrlicht using the MeshManipulator. I'm not aware of a bug in the bsp loader, although many file formats are not very explicit about their normal orientation.

Posted: Tue Apr 11, 2006 4:01 pm
by Belshamaroth
i tried all of your suggestions but all of them failed.
i tried loading an official quake3 map but the problem is still existing even there.

Posted: Tue Apr 11, 2006 5:35 pm
by etcaptor
I'm accept to hybrid's opinion.
-You can correct normals with your 3d modeling tools.
- using of Irrlicht MeshManipulator.
- Another way is to change backface culling in Irrlicht for these materials which disappears.

Posted: Tue Apr 11, 2006 9:16 pm
by Belshamaroth
ok i tried it with recalculating the normals.
now every wall is sightable.
but now there is another problem.
the faces are solid but you can see objects and walls which are behind them.
(i have a zombie scene node which is following the player's cam)

how to fix that?

i played a little bit with the material properties but didnt get it

Posted: Tue Apr 11, 2006 10:23 pm
by hybrid
Your material should be EMT_SOLID and your should leave the z-buffer enabled (which is the default). Then, all walls should show up correctly. If you have another screenshot it could also help. And some lines of code.

Posted: Tue Apr 11, 2006 11:20 pm
by Belshamaroth
Image

i fixed all normals with my 3d program. (i used a less complicated room)

to load the bsp map i use following code:

Code: Select all

scene::IAnimatedMesh* q3levelmesh = smgr->getMesh("test.bsp");
	scene::ISceneNode* q3node = 0;
	smgr->getMeshManipulator()->recalculateNormals(q3levelmesh->getMesh(0));	
	if (q3levelmesh)
		q3node = smgr->addAnimatedMeshSceneNode(q3levelmesh);
		
	q3node->setMaterialType(video::EMT_SOLID); 
	q3node->setMaterialFlag(video::EMF_LIGHTING, false);
	q3node->setMaterialFlag(video::EMF_FOG_ENABLE, true);
	q3node->setMaterialFlag(video::EMF_BACK_FACE_CULLING , false);
		
	q3node->setDebugDataVisible(true);

Posted: Wed Apr 12, 2006 9:31 am
by hybrid
Try to enable the backface culling. Maybe your room has some artifacts in between. And you mentioned lightmaps. Do you use lightmap textures? Then your material must change to something with _LIGHTMAP.

Posted: Thu Apr 13, 2006 5:08 pm
by Belshamaroth
hm i tried it with backface culling on and off but nothing happens.
changing the material types is making no difference. i dont think its something with the materials but something with the drawing order as the walls behind are drawn in front of the walls which should be in front.