Shadow Volume Issue with Quake Level 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.
Post Reply
Aptos
Posts: 7
Joined: Sat May 15, 2010 6:39 pm

Shadow Volume Issue with Quake Level Map

Post by Aptos »

I'm having an issue where I can't get the shadow volume to work on the quake level mesh included in the tutorials.

Here's the relevant code:

Code: Select all

device->getFileSystem()->addZipFileArchive("../../media/map-20kdm2.pk3");
IAnimatedMesh* q3levelmesh = smgr->getMesh("20kdm2.bsp");
IAnimatedMeshSceneNode* q3node = smgr->addAnimatedMeshSceneNode(q3levelmesh);
q3node->setMaterialType(EMT_SOLID);
q3node->setMaterialFlag(EMF_LIGHTING, true);
q3node->setMaterialFlag(EMF_NORMALIZE_NORMALS, true);
q3node->addShadowVolumeSceneNode();
The level is being dynamically lit "correctly," as in triangle faces are darker if the light scene node is in the negative half space of the face, but I can't get the shadow volume to cast shadows.

Any advice?

note that the level mesh is about 90,000 faces.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

I guess a node can't cast shadows on itself... :?
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Aptos
Posts: 7
Joined: Sat May 15, 2010 6:39 pm

Post by Aptos »

It definitely can; my character's cast shadows on themselves.

I think it might have something to do with very large (in terms of number of faces) meshes. I have a treasure chest mesh with a really large number of faces and I get a white screen when I try to add a shadow volume to that, which is the same behavior I get when I try and do

Code: Select all

q3node->addShadowVolume(q3levelmesh->getMesh(0));
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

I find Volume Shadows are not so good with large level meshes like the Q3 one. You may want to just lightmap it in Blender.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Aptos
Posts: 7
Joined: Sat May 15, 2010 6:39 pm

Post by Aptos »

Yea, I've given up on the shadow volumes.

I did find your XEffects though BlindSide! They look like they might do the trick. Is there any more documentation beyond the example files?
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Ah yes, I would have mentioned it but I'm not a big fan of shameless self-promotion.

It doesn't really require any documentation outside the examples, the header files should contain sufficient comments for everything. The only problem is that it only supports spot lights and directional lights, not point lights so it'll only be useful if you want to do like a daytime simulation thing. Also I recommend if you do that for the Quake 3 level to enable VSM shadows.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Aptos
Posts: 7
Joined: Sat May 15, 2010 6:39 pm

Post by Aptos »

Yea I just tried with not much luck. It's cool and easy to use, just doesn't fit the need I have.

I tried to use a shadow light high up in the air with 180* FOV, and that worked, but it didn't play nice with the other effects I'm using: TGMs Shader Package radial blur, and rendering to textures for the GUI and minimap.
Post Reply