Page 1 of 1

Can't use SpecularColor properly

Posted: Wed May 21, 2008 1:58 pm
by raytaller
Hello,
It's horrible to fail on such a ridiculous problem.
I have 1 MeshSceneNode that has some material properties specified, including SpecularColor. It works.

Then, I draw some triangles with this code :

Code: Select all

	SMaterial mate;
	mate.SpecularColor = SColor(0x0);
	driver->setMaterial(mate);	

	driver->drawIndexedTriangleList(
		&gbverts[0], nverts,
		&gbindices[0],  ntris);

Guess what : the triangles have the same SpecularColor that my MeshSceneNode.
All the others flags and material properties are ok, except SpecularColor.
If I write :

Code: Select all

	SMaterial mate;
	mate.SpecularColor = SColor(0x0);
	mate.Wireframe = true;
	mate.DiffuseColor = SColor(0xff00ff00);
	driver->setMaterial(mate);	
Please believe that they are displayed in wireframe, with the right diffuse color..... but the wrong specular color (ie : the MeshSceneNode specular color).

Does someone know what is wrong here ?
I'm using the 1.4 release

Posted: Wed May 21, 2008 3:58 pm
by arras
I did come across some similar problem (may be it was right the same one) when doing some tests. Unfortunately I did not payed too much attention to it back then so I do not have that code anymore. It was 1.4 too.

Posted: Wed May 21, 2008 4:35 pm
by hybrid
An important information would be the driver used...

Posted: Fri May 23, 2008 6:55 am
by raytaller

Code: Select all

Irrlicht Engine version 1.4
Microsoft Windows XP Professional Service Pack 2 (Build 2600)
Using renderer: OpenGL 2.1.1
Quadro FX 360M/PCI/SSE2: NVIDIA Corporation
OpenGL driver version is 1.2 or better.
GLSL version: 1.3

Posted: Fri May 23, 2008 7:32 am
by hybrid
Ok, I guess it's a problem with the still not properly used specular color model in the opengl driver. I'll move this thread to bugs forum - I already filed a topic on my development todos month ago, but did not get to working on this issue, yet.
Maybe someone could tell me a proper way of enabling specular colors with and without the separate sepcular color extension. Maybe setting it to zero in the else case would help already?!

Posted: Mon May 26, 2008 6:02 pm
by marcos
I'm not a OpenGL specialist. But, as far as I know, to enable and disable the specular color extension you have to use glEnable and glDiable over GL_COLOR_SUM_EXT.

I think that changing GL_LIGHT_MODEL_COLOR_CONTROL_EXT should allow using specular color without the extension itself.

By the way. Wasn't the specular color extension already integrated into the OpenGL Core in version 1.2?