I've always been kind of confused by this:
Which colors in materials are affected by lights vs. when there is no lighting (lighting is off)?
Like when lighting is off, can I influence color with diffuse? Or is it ambient? I need a cheat sheet to recall this every time because I simply can't remember...
Different colors in materials
Re: Different colors in materials
Yeah, I get the confusion, was the main reason I wrote the MaterialViewer example. But it's pretty simple - if you turn of light _none_ of those colors affects the material anymore. They _all_ only work with lighting. The only color which affects polygons without lighting are the vertex colors. And how and if the vertex colors affect the polygons depends on the SMaterial::ColorMaterial setting. And... there is a chance I miss something and what I said is wrong (or one of the drivers is wrong), so please correct me if you find a case where it's different.
So... what if you want to use one of the colors in SMaterial instead? Enable Lighting. But what if you don't want light to affect it? Only use EmissiveColor (self-lighting) and set the rest to 0. Or set some global light and use diffuse color in combination with it (kinda depends what you use it for). What if you want transparency? I think I found some trick once described here: viewtopic.php?p=309119 but in general that's when I start using a shader.
So... what if you want to use one of the colors in SMaterial instead? Enable Lighting. But what if you don't want light to affect it? Only use EmissiveColor (self-lighting) and set the rest to 0. Or set some global light and use diffuse color in combination with it (kinda depends what you use it for). What if you want transparency? I think I found some trick once described here: viewtopic.php?p=309119 but in general that's when I start using a shader.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Different colors in materials
Ahhh ok. I recall in the past I had used lighting but made the ambient color or something bright so a directional light added like a pseudo rim light to some objects. Thank you!