Page 1 of 1

irrlicht 1.72 color is error

Posted: Fri Dec 24, 2010 12:30 pm
by jiedi123
In 1.4.2 the color is right,but in 1.7.2 color is error
please help me
my code

IAnimatedMesh* mesh = smgr->getMesh("body.b3d");
if (!mesh)
{
device->drop();
return 1;
}
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );

if (node)
{
node->setMaterialFlag(EMF_LIGHTING, false);
}

smgr->addCameraSceneNodeFPS();

while(device->run())
{

driver->beginScene(true, true, SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}

right in CopperCube 2.2 and 1.4.2
Image

error in 1.7.2
Image

Posted: Fri Dec 24, 2010 3:37 pm
by lazerblade
SColor takes it's arguments like this: 'SColor(Alpha, Red, Green, Blue)'.
When I created a color in GIMP where 100 is the red value, 101 is green
and 140 is blue, I get the same color you have in your second screenshot.

So my guess is that in 1.4.2 the alpha value comes last rather than first
like it does in 1.7.2. My recommendation is that you use GIMP or MS Paint
or photoshop or anything like that to try your color values before you
code them in 1.7.2.

Posted: Fri Dec 24, 2010 4:05 pm
by Bear_130278
It looks to me, that you have some emitting color on the first shot, and a plain diffuse on the second.
Are you sure, you did not change the ambient light color?

P.S. I like 2nd one better BTW 8)))

Posted: Fri Dec 24, 2010 8:20 pm
by macron12388
lazerblade wrote:SColor takes it's arguments like this: 'SColor(Alpha, Red, Green, Blue)'.
When I created a color in GIMP where 100 is the red value, 101 is green
and 140 is blue, I get the same color you have in your second screenshot.

So my guess is that in 1.4.2 the alpha value comes last rather than first
like it does in 1.7.2. My recommendation is that you use GIMP or MS Paint
or photoshop or anything like that to try your color values before you
code them in 1.7.2.
:shock: Wait... are you sure? I thought it was SColor(r, g, b, a)

*checking one sec*

Oh wait you're right, :lol: Oh ok nevermind SColorf(r, g, b, a) SColor(a, r, g, b)

Posted: Sat Dec 25, 2010 2:08 pm
by jiedi123
thanks
I am not change the ambient light,
I use the irrlicht example code “09.Meshviewer” load the mesh
in 1.4.2 is right
in 1.7.2 is error

Posted: Sat Dec 25, 2010 2:20 pm
by Fury.
are you sure that alpha is handled the same way in irrlicht 1.4 and 1.7?

maybe in one is used 1-alpha as trasparency and in the other one is used alpha as trasparency.

just try to change the alpha of 1 model from
Alpha

to

255-Alpha and see what appens ;-)

Posted: Sun Dec 26, 2010 1:55 pm
by hybrid
The beginScene works correct, the transparency settings and parameters to SColor have not changed in any version. The blue background in the Irrlicht screenshot should be expected (because blue value is a little higher than the others).
The problem with the mesh seems to be the vertex color support which has been added in one of the latter versions of Irrlicht's b3d loader. You should make the vertex colors white, or try to change the color material to ECM_NONE for the mesh.