Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualCryZe

Posted 14 September 2012 - 06:01 AM

By the way, the other attenuation parameters (constant and linear) are just for artistic purposes. Squared attenuation would be most correct, since the irradiance of a point light is:
E = max(0, cosAngle) * vLightIntensity / (squaredDistance);
For a diffuse surface the radiance then becomes:
L = E * vSurfaceColor / Pi;
You got it right, except for the division by Pi. (It is there for the energy conservation.)

If anything it would be:





The does not appear in the shader code though, as it cancels out with most BRDF's. For example lambert:

Whether needs to be in the shader code depends on the implementation. It depends on what his light is storing. It could either be radiance or radiant intensity. The way he is doing it now is storing radiant intensity, which is . Depending on whether his radiant intensity contains the multiplication by , the division by needs to be in the shader code or not.

#14CryZe

Posted 14 September 2012 - 06:01 AM

By the way, the other attenuation parameters (constant and linear) are just for artistic purposes. Squared attenuation would be most correct, since the irradiance of a point light is:
E = max(0, cosAngle) * vLightIntensity / (squaredDistance);
For a diffuse surface the radiance then becomes:
L = E * vSurfaceColor / Pi;
You got it right, except for the division by Pi. (It is there for the energy conservation.)

If anything it would be:





The does not appear in the shader code though, as it cancels out with most BRDF's. For example lambert:

Whether needs to be in the shader code depends on the implementation. It depends on what his light is storing. It could either be radiance, radiant intensity. The way he is doing it now is storing radiant intensity, which is . Depending on whether his radiant intensity contains the multiplication by , the division by needs to be in the shader code or not.

#13CryZe

Posted 14 September 2012 - 06:01 AM

By the way, the other attenuation parameters (constant and linear) are just for artistic purposes. Squared attenuation would be most correct, since the irradiance of a point light is:
E = max(0, cosAngle) * vLightIntensity / (squaredDistance);
For a diffuse surface the radiance then becomes:
L = E * vSurfaceColor / Pi;
You got it right, except for the division by Pi. (It is there for the energy conservation.)

If anything it would be:





The does not appear in the shader code though, as it cancels out with most BRDF's. For example lambert:

Whether needs to be in the shader code depends on the implementation. It depends on what his light is storing. It could either be radiance, radiant intensity. The way he is doing it now is storing radiant intensity, which is . Depending on whether his radiant intensity contains the multiplication by , the division by needs to be in the shader code or not.

#12CryZe

Posted 14 September 2012 - 03:39 AM

By the way, the other attenuation parameters (constant and linear) are just for artistic purposes. Squared attenuation would be most correct, since the irradiance of a point light is:
E = max(0, cosAngle) * vLightIntensity / (squaredDistance);
For a diffuse surface the radiance then becomes:
L = E * vSurfaceColor / Pi;
You got it right, except for the division by Pi. (It is there for the energy conservation.)

If anything it would be:





The does not appear in the shader code though, as it cancels out with most BRDF's. For example lambert:

#11CryZe

Posted 14 September 2012 - 03:38 AM

By the way, the other attenuation parameters (constant and linear) are just for artistic purposes. Squared attenuation would be most correct, since the irradiance of a point light is:
E = max(0, cosAngle) * vLightIntensity / (squaredDistance);
For a diffuse surface the radiance then becomes:
L = E * vSurfaceColor / Pi;
You got it right, except for the division by Pi. (It is there for the energy conservation.)

If anything it would be:





The does not appear in the shader code though, as it cancels out with most BRDF's. For example lambert:

#10CryZe

Posted 14 September 2012 - 03:35 AM

By the way, the other attenuation parameters (constant and linear) are just for artistic purposes. Squared attenuation would be most correct, since the irradiance of a point light is:
E = max(0, cosAngle) * vLightIntensity / (squaredDistance);
For a diffuse surface the radiance then becomes:
L = E * vSurfaceColor / Pi;
You got it right, except for the division by Pi. (It is there for the energy conservation.)

If anything it would be:





The does not appear in the shader code though, as it cancels out with most BRDF's. For example lambert:

PARTNERS