I have a simple .obj mesh whose material color is defined as yellow on the .mtl file. I've brought it into Irrlicht using the OpenGL option. I've then added ambient lighting as follows:
My understanding was the object would be lit by white ambient light, showing it as the yellow I defined for the material, but it renders as black. Is there some other setting or definition I need to use so all objects in the scene are uniformly lit?
Hmm. Thanks, but that didn't seem to make any difference. Puzzling.
I can get the color to show if I throw an explicit light into the scene with addLightSceneNode(), but it's shadowed and has to be placed and the size set. I'm just trying to get a universal, even lighting across all the surfaces of the model regardless of how large it is or where it's placed. Normally an ugly lighting situation, I know, but it's to test something out.
Okay, I officially feel silly now. The answer was in the "Movement" tutorial code. Without dynamic lighting you actually have to do the opposite of what I tried above:
Well, setting EMF_LIGHTING to false will make it so it will render in the full color of the original mesh and texture, but that is not the same as being lit by a full ambient light. I mean, if all you care about is seeing the mesh in full color, then that will work, but if you actually meant to use an ambient light (like so later you could use a different light color, perhaps) then that's not the way to fix it.
DeM0nFiRe wrote:Well, setting EMF_LIGHTING to false will make it so it will render in the full color of the original mesh and texture, but that is not the same as being lit by a full ambient light. I mean, if all you care about is seeing the mesh in full color, then that will work, but if you actually meant to use an ambient light (like so later you could use a different light color, perhaps) then that's not the way to fix it.
Spinland wrote:Okay, I officially feel silly now. The answer was in the "Movement" tutorial code. Without dynamic lighting you actually have to do the opposite of what I tried above:
This is wrong, with lighting enabled you shouldn't get a black scene node if you set the ambient color correctly. There may be some slight differences atm with the OpenGL and D3D implementations and the way they handle this. Although you could just use EmissiveColor if ambient is giving you troubles...
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net