[SOLVED]problem with displaying a bsp map

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.
Belshamaroth
Posts: 24
Joined: Sun Apr 09, 2006 8:19 pm

[SOLVED]problem with displaying a bsp map

Post 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)
Last edited by Belshamaroth on Mon Apr 10, 2006 2:06 pm, edited 1 time in total.
bearSoft
Posts: 165
Joined: Fri Apr 01, 2005 9:55 pm
Location: Denmark

Post by bearSoft »

use http://imageshack.us/ to post the screenshot.
noone know what wrong now..
Regards.
Tech: win98se| 320mb ram| abitbe6| 433mhzceleron| atiRadeon7000.64mb| soundblaster125| dx9.0b | devCPP | IRR 0.12.0 |
Belshamaroth
Posts: 24
Joined: Sun Apr 09, 2006 8:19 pm

Post 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
Belshamaroth
Posts: 24
Joined: Sun Apr 09, 2006 8:19 pm

Post 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?
sudi
Posts: 1686
Joined: Fri Aug 26, 2005 8:38 pm

Post 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.
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
Belshamaroth
Posts: 24
Joined: Sun Apr 09, 2006 8:19 pm

Post by Belshamaroth »

ok i packed my whole project dir:

http://loretta-with.no-ip.org/learning_by_doing.rar
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

Post 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.
ImageImage
Site development -Rock and metal online
--- etcaptor.com ------freenetlife.com
hybrid

Post 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.
Belshamaroth
Posts: 24
Joined: Sun Apr 09, 2006 8:19 pm

Post 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.
etcaptor
Posts: 871
Joined: Fri Apr 09, 2004 10:32 pm
Location: Valhalla
Contact:

Post 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.
ImageImage
Site development -Rock and metal online
--- etcaptor.com ------freenetlife.com
Belshamaroth
Posts: 24
Joined: Sun Apr 09, 2006 8:19 pm

Post 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
hybrid

Post 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.
Belshamaroth
Posts: 24
Joined: Sun Apr 09, 2006 8:19 pm

Post 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);
hybrid

Post 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.
Belshamaroth
Posts: 24
Joined: Sun Apr 09, 2006 8:19 pm

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