Lighting only for one node?

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
JunkerKun
Posts: 97
Joined: Mon Jan 28, 2013 12:52 am

Lighting only for one node?

Post by JunkerKun »

Is there a way to enable lighting only for one node without managing the rendering queue?
Like when I want only character being lighted but not the room?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Lighting only for one node?

Post by CuteAlien »

You can enable/disable lighting per material. Each node usually has by default it's own materials so you can set those flags for each node.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
JunkerKun
Posts: 97
Joined: Mon Jan 28, 2013 12:52 am

Re: Lighting only for one node?

Post by JunkerKun »

CuteAlien wrote:You can enable/disable lighting per material. Each node usually has by default it's own materials so you can set those flags for each node.
Oh, silly me, should've said it clearer >__>

I need to apply lighting from one light to only one node. Like there is a light that only lightens the character but not the room.
Sorry for the inconvenience.
prodcake
Posts: 10
Joined: Thu Jun 23, 2011 9:53 am

Re: Lighting only for one node?

Post by prodcake »

check out the light manager example code(tutorial 20 i think), it shows you how to use seperate lighting managers to control which nodes are affected by what lights.

that should do the trick
JunkerKun
Posts: 97
Joined: Mon Jan 28, 2013 12:52 am

Re: Lighting only for one node?

Post by JunkerKun »

prodcake wrote:check out the light manager example code(tutorial 20 i think), it shows you how to use seperate lighting managers to control which nodes are affected by what lights.

that should do the trick
Totally forgot about that example...
Thanks, will take a look at it.
jiangcaiyang
Posts: 9
Joined: Tue Nov 12, 2013 3:24 pm

Re: Lighting only for one node?

Post by jiangcaiyang »

If I were not mistaken, let the room node have the material not to be lightened, like this:

Code: Select all

pRoomNode->setMaterialFlag( EMF_LIGHTING, false );
JunkerKun
Posts: 97
Joined: Mon Jan 28, 2013 12:52 am

Re: Lighting only for one node?

Post by JunkerKun »

jiangcaiyang wrote:If I were not mistaken, let the room node have the material not to be lightened, like this:

Code: Select all

pRoomNode->setMaterialFlag( EMF_LIGHTING, false );
Nono, the point was in making some nodes be affected by one light and other nodes by another light.
Post Reply