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?
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?
depends.
Go on...
Forget the cubemap, think about reflections in general.
specular is only the rendering of the lightsource reflexion.
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. :)
"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. :)
Another question:
Does it make sense that the diffuse (surface normal dot light direction) and specular sum at a point is more than 1?
Does it make sense that the diffuse (surface normal dot light direction) and specular sum at a point is more than 1?
Being 1 the light value at that point
i dont think cube maps have any specular reflectance angle
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.
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.
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.
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.
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.
In physically-based rendering, reflection is either diffuse or specular; so per channel, you must have diffuse>=0, specular>=0, diffuse+specular<=1.
thank you, again. don't miss next week's episode, when I'll have one more physical'ish based lighting question! bye!