Delgine 3D Tools & Content DeleD Community Edition
Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Materials question

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Development
View previous topic :: View next topic  
Author Message
mbr4
Member


Joined: 10 Feb 2010
Posts: 1

PostPosted: Wed Feb 10, 2010 10:35 pm    Post subject: Materials question Reply with quote

How to map DeleD material properties to OpenGL material parameters:
GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_EMISSION, GL_SHININESS Question

No texture is used.
Back to top
View user's profile Send private message
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Thu Feb 11, 2010 7:13 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Development All times are GMT
Page 1 of 1

 
Jump to:  
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