Layers of ISceneNode

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
Dog-E
Posts: 28
Joined: Sun Mar 30, 2008 5:52 am

Layers of ISceneNode

Post by Dog-E »

Hey everyone,

I was going through the list of material types in Irrlicht and it's far less than what I need, though I could use them individually combined with my own shaders.

So if say I want a color map normal map, specular map, opacity map, luminosity map all for one model, can I:

create an ISceneNode that renders a luminosity map with an IMesh and make it the child of an empty (no mesh) ISceneNode that has an opacity map shader as it's material, then make that a child of another ISceneNode so on... to combine all different shaders that I have? Or do I have to combine my shaders inside the programs?

( Do I have to have a shader that is like OpacityLuminosityNormalSpecularMap.VERT / FRAG ?)

Thanks
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

I believe the way to go would probably be to combine it all into one shader. That will make things a lot easier for you.
TheQuestion = 2B || !2B
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Materials aren't passed down to children of a node...

As Halifax says you'll be much better off combining it into one node, it's probably the only way and no doubt more efficient than any other way someone might think of.
Image Image Image
Dog-E
Posts: 28
Joined: Sun Mar 30, 2008 5:52 am

Post by Dog-E »

So how would I go about giving the option to have all these maps or only some of those?

So in a custom material I wanna have a syntax like:

texture {
color "root/textures/bump/color.tga"
bump "root/textures/bump/bump.tga"
lum "root/textures/bump/lum.tga"
opacity "root/textures/bump/opacity.tga"
}

but it can also be like:

texture {
color "root/textures/bump/color.tga"
opacity "root/textures/bump/opacity.tga"
}

what would be the approach to separate those different layers yet combine them all in one shader?
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

You could possibly try and use BlindSide's shader preprocessor:
http://irrlicht.sourceforge.net/phpBB2/ ... eprocessor

It generates shaders on the fly based on defines that you can do from your client program. Sorry if that explanations sucks, but go check it out.
TheQuestion = 2B || !2B
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

You need to put your textures in to different layers in your material. There is limit of 4 layers in Irrlicht currently but your hardware might limit you to two (or hardware of user of your software). Material will pass those textures in to driver. There it is up to you and your shader what will happen to them.
Post Reply