Color without texture?

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
sourada
Posts: 5
Joined: Mon May 09, 2005 8:24 pm

Color without texture?

Post by sourada »

Hello,

Does Irrlicht support materials that have color but not texture? I have a project where I'm trying to import some DirectX (.x) format models that have colors but not textures. When I render these, I get just white (if I have lighting turned off) or just black (if I have lighting turned on and positioned properly).

It looks like the DiffuseColor member of the material is getting set. It's not always getting set right (some of the fields are swapped around), but even when I force this to some sane value after loading, I never get anything but the white/black mentioned above.

If I make a 1x1 texture with the associated color and attach that to the material without changing anything else, I get the colors I expect. However, I don't really wanna do that if I don't have to.

So, I have a workaround but I don't understand where the problem comes from. Can ya help me?

To demonstrate the problem, I've created a couple of files that are just a colored cube. Loading these into Meshviewer demonstrates the problem. See the 3DS, the the DirectX mesh, and the render from 3DS Max

Thanks,
Steven
AMAZINGAHMED
Posts: 8
Joined: Thu Apr 28, 2005 12:19 pm
Location: Egypt

Post by AMAZINGAHMED »

material.DiffuseColor=SColor(255,0,255,0); //green color
i thought this should do but it acted like you said.
But when i changed my device to OPENGL instead of DIRECTX9 it worked.
THERE IS ALWAYS A FIRST TIME
sourada
Posts: 5
Joined: Mon May 09, 2005 8:24 pm

Post by sourada »

Hmmm, I do get different results in OpenGL than in DirectX, though what I'm seeing there still doesn't make sense to me.

Oh, and I guess when I said 'or just black (if I have lighting turned on...', I was wrong. I get white with or without lighting turned on.
Post Reply