|
DeleD Community Edition Forums
|
View previous topic :: View next topic |
Author |
Message |
mbr4 Member
Joined: 10 Feb 2010 Posts: 1
|
Posted: Wed Feb 10, 2010 10:35 pm Post subject: Materials question |
|
|
How to map DeleD material properties to OpenGL material parameters:
GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION, GL_SHININESS
No texture is used. |
|
Back to top |
|
|
Paul-Jan Site Admin
Joined: 08 Aug 2004 Posts: 3066 Location: Lage Zwaluwe
|
Posted: Thu Feb 11, 2010 7:13 am Post subject: |
|
|
Assuming a single-layer material, the general properties only contain a single color, which maps onto DIFFUSE. The other properties can be tweaked to your liking, DeleD's visualization leaves them at the OpenGL defaults.
The raytracing properties contain explicit ambient, diffuse and specular components.. However, they are not used in DeleD's visualization, so how you want to map them is up to you. I wouldn't advise using the (still young and experimental) DeleD raytracer itself as a reference vizualization for realtime rendering.
One tricky part would be correctly mapping specular amount, exponent and color onto GL_SHININESS.
- GL_SHININESS is clamed to [0, 128]
- GL_SHININESS is interpreted as the Blinn-phong exponent, while the raytracer interprets the specular amount as classic phong and then does a post-scale with the specular amount.
This might be trivial to convert using the formula in the red book and the formula as used in the raytracer, but my right arm is in plaster atm so I can't write (or even type properly) AND as said before, I wouldn't suggest using the raytracer as a reference implementation as it might be erroneous and/or subject to change.
What I would do is
- feed specular exponent straight into GL_SHININESS
- multiply color with specular amount, then use that for GL_SPECULAR |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|