How do i make my mesh all black?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
POi

How do i make my mesh all black?

Post by POi »

I have tried for a while now to set my mesh all black. I have set setMaterialFlag(video::EMF_LIGHTING, false) on the node and i have NO TEXTURE at the moment.
I also tried changing all the material colors (specular, ambient and so on) but for the love of it i cannot get it from all white to all black.
(I'm loading an .X model)

Do i have to change vertex colors? How do i do that ?
POi

Post by POi »

I just realized i cannot do
node->getMaterial(0).AmbientColor.set
.... and so on when there is no texture :D ... but how do i change the vertex color ... the model is still all WHITE and i want it to be BLACK.
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

If you have no dynamic lights then you could do:

node->setMaterialFlag(video::EMF_LIGHTING, true);

to make the node all black.
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
POi

Post by POi »

Actually i want to have dyn. lights later on. So i would rather like to change the vertex col. from the beginning ... maybe i need to modify the engine ?
MasterD
Posts: 153
Joined: Sun Feb 15, 2004 4:17 pm
Location: Lübeck, Germany
Contact:

Post by MasterD »

Can't you use textures? Why not trying a small plain black texture? This should fix this.
jikbar
Posts: 62
Joined: Wed Aug 25, 2004 4:48 pm
Location: Canada
Contact:

Post by jikbar »

set the diffuse and emmisive colors to black. you can change the specular color to black for a pitch black model or to white for a black model with a white shine to it.

diffuse = the color the material emmits when struck by light
emmisive = the color the material emmits even without light
specular = the color the material emmits when hit by light at a certain angle to give your mesh a reflective look

all of these values are combined on a per-vertex level to calculate the effects of dynamic lighting. these values only work when EMF_LIGHTING is set to true.
bal
Posts: 829
Joined: Fri Jun 18, 2004 5:19 pm
Location: Geluwe, Belgium

Post by bal »

Hmm, interesting. And what does ambient do then?
General Tools List
General FAQ
System: AMD Barton 2600+, 512MB, 9600XT 256MB, WinXP + FC3
roninmagus
Posts: 91
Joined: Fri Oct 31, 2003 5:03 am

Post by roninmagus »

http://sjbaker.org/steve/omniv/opengl_lighting.html

That is the website that taught me about lighting, it explains the different types of light well, including ambient light
daveandrews.org - A Christian Programmer's Weblog | Dusty Engine - A Task Engine for Irrlicht
Post Reply