PDA

View Full Version : Specular lighting from 3D Studio Max



10-29-2002, 12:36 PM
I am importing ASE files (3D Studio Max's export file format) and I am just implementing specular lighting. The materials have two parameters to set the intensity and glossity of the specular lighting:

*MATERIAL_SHINE 0.5300
*MATERIAL_SHINESTRENGTH 0.4900

Does anybody know what to do so that the specular looks exactly the same as it looks in 3D Studio Max? I tried

glMaterialf(GL_FRONT, GL_SHININESS, shine);
(shine == *MATERIAL_SHINE)

but that is wrong. It's probably the same as with .3ds files. Does anybody know how to do that?

Thanks,
Thomas

yakuza
10-29-2002, 06:16 PM
My understanding is that those parameters are a percent value. So you'd need to correspond those percent values into values OpenGl can properly use, probably floats. Perhaps a lookup table might help? Regardless, I think you'll have to experiment with different settings in OpenGL to get your desired effect, unless you're able to figure out how they map the percents to OpenGL values in 3DSMax.

Hope that helps.

Nutter
11-03-2002, 06:19 AM
It's been quite a while since I used ASE files, but if I remember correctly, the closest approximation (exact?) to what 3DS shows is achieved by multiplying the two values together.


-Nutter

11-05-2002, 11:07 AM
Try this
glMaterialf(GL_FRONT,GL_SHININESS,shini*128.0f);
glMaterialfv(GL_FRONT,GL_SPECULAR,(spec.r*shinistr ength,spec.g*shinistrength,spec.b*shinistrength));
where spec is the materials specularcolor