Can't use SpecularColor properly

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
raytaller
Posts: 17
Joined: Wed Feb 07, 2007 11:28 am

Can't use SpecularColor properly

Post 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
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post 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.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

An important information would be the driver used...
raytaller
Posts: 17
Joined: Wed Feb 07, 2007 11:28 am

Post 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
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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?!
marcos
Posts: 16
Joined: Fri May 16, 2008 5:38 pm

Post 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?
Post Reply