pouët.net

Physical ' ish based Lighting question!

category: code [glöplog]
 
Is specular the same thing as reflection?

As in if I render a light to a cubemap and use it has an environment map for some object will it look the same as if I render the same object with just the specular component of that light?
added on the 2011-05-28 05:52:13 by xernobyl xernobyl
depends.
added on the 2011-05-28 06:01:04 by las las
Go on...
added on the 2011-05-28 06:19:37 by xernobyl xernobyl
Forget the cubemap, think about reflections in general.
added on the 2011-05-28 06:26:37 by xernobyl xernobyl
specular is only the rendering of the lightsource reflexion.
added on the 2011-05-28 08:23:57 by Bartoshe Bartoshe
xernobyl, in general: no.

"Specular" conventionally just refers to the component of a material's BRDF that's not constant - or, if you're using more realistic diffuse BRDF models such as Oren-Nayar, the component that's not strongly directional, though that's of course not a precise definition.

If your BRDF happens to be of a perfect reflector (i.e. idealized mirror), each outgoing direction receives light from exactly a single incoming direction (i.e. if you fix any outgoing direction, the BRDF is a delta function with a single pulse in the direction of the reflection vector).

In that case (and only in that case!) will specular be the same as ideal reflection (also note that a Cubemap does not give you correct reflections; it's a simplification that assumes the environment is infinitely far away!).

For usual shading models, the specular lobe isn't a dirac impulse, but rather a smoother function with a wider peak (e.g. for Blinn-Phong, the exponent controls the narrowness), so the outgoing radiance will be a weighted integral of the incoming radiance over a wider area. If your BRDF is isotropic, you can actually approximate that by convolving your environment cubemap with your BRDF. For most BRDFs commonly used in CG, this is basically a blur. :)
added on the 2011-05-28 08:37:32 by ryg ryg
Another question:

Does it make sense that the diffuse (surface normal dot light direction) and specular sum at a point is more than 1?
added on the 2011-06-25 20:11:17 by xernobyl xernobyl
Being 1 the light value at that point
added on the 2011-06-25 20:11:54 by xernobyl xernobyl
i dont think cube maps have any specular reflectance angle
added on the 2011-06-25 23:15:57 by rudi rudi
xernobyl, at a point: yes. materials can have fine-scale structures that effectively focus incoming light; most of the total incoming energy is reflected in a single direction.

what you can't have in reality (and by extension true physically-based rendering) is a surface that "reflects" more light than it receives :). that means the integral over the reflected energy in all directions needs to be <= the integral over incoming energy (with the rest being absorbed) - this is just conservation of energy.

that said, a lot of popular models like blinn-phong aren't energy-conserving in their standard formulation; you need to add a normalization factor if you want to get this right.
added on the 2011-06-26 07:38:32 by ryg ryg
Let's say say I'm using bling phong, and I have the normalized specular multiplying it by (n+8)/(8 PI), and the diffuse (N dot L) multiplied by 1/PI (I'm not sure that's the right value, integral of cos theta), that would make the specular 1 over a sphere, same as the diffuse.
If I sum both of them I end up emitting twice the receiving light, right? As light values are relative I don't think it makes a difference if the difference is the same for all materials.
added on the 2011-06-26 15:28:42 by xernobyl xernobyl
1/pi is the right value for diffuse.

In physically-based rendering, reflection is either diffuse or specular; so per channel, you must have diffuse>=0, specular>=0, diffuse+specular<=1.
added on the 2011-06-27 09:40:29 by ryg ryg
thank you, again. don't miss next week's episode, when I'll have one more physical'ish based lighting question! bye!
added on the 2011-06-27 10:21:00 by xernobyl xernobyl

login