shadows with normal-maps?

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
xirtamatrix
Posts: 219
Joined: Fri Feb 19, 2010 4:03 pm
Location: Estonia

shadows with normal-maps?

Post by xirtamatrix »

Hi folks,

I'm trying to get stencil shadows and my scene have normal maps applied to it.

I see that addShadowSceneNode() works only with AnimatedMeshSceneNodes, but if I create my objects with AnimatedMeshSceneNode I cannot have normal maps on them.

Is there any way to get shadows from objects which have normal-maps applied to them? (i.e. for nodes created with OctreeSceneNode or MeshSceneNode)

Thanks for any help.

/regards
to live, is natural; to die, is not!
RuggJack93
Posts: 39
Joined: Mon Sep 06, 2010 5:09 pm
Location: Italy

Post by RuggJack93 »

Not with standard irrlicht, because, as you've pointed out, you can use stencil buffer shadows only on AnimatedMeshSceneNodes, but for normal maps you need to create a mesh with tangent with createMeshWithTangents(), which requires an IMesh and that's incompatible with the addAnimatedMeshSceneNode() function.

But you could use this shader posted here:

http://irrlicht.sourceforge.net/phpBB2/ ... p+animated

It allows to apply normal maps to animated meshes and stencil buffer shadows (at least theorically).

EDIT:
Tried it and works perfectly.
xirtamatrix
Posts: 219
Joined: Fri Feb 19, 2010 4:03 pm
Location: Estonia

Post by xirtamatrix »

RuggJack93 wrote:Not with standard irrlicht, because, as you've pointed out, you can use stencil buffer shadows only on AnimatedMeshSceneNodes, but for normal maps you need to create a mesh with tangent with createMeshWithTangents(), which requires an IMesh and that's incompatible with the addAnimatedMeshSceneNode() function.

But you could use this shader posted here:

http://irrlicht.sourceforge.net/phpBB2/ ... p+animated

It allows to apply normal maps to animated meshes and stencil buffer shadows (at least theorically).

EDIT:
Tried it and works perfectly.
Thanks RuggJack93, I had seen this before actually but pity it works only with OGL and I need a DX version. Sadly I'm a total noob when it comes to shaders so cant really do the conversion.

Thanks for reminding me of it though. I've written into that thread and hoping someone could comeup with a DX version of it :)

cheers!
to live, is natural; to die, is not!
Post Reply