Guest User

Untitled

a guest
May 24th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. shader shapedLight(float Temperature = 1500.0, float Strength = 1.0, float Anisotropy = 0.0, float Fac = 0.5, float Lower = 0.0, float Upper = 1.0, output closure color Shader = holdout(), output color Color = 1.0, output float W = 0.0, output float Threshold = 0.0) {
  2. Color = blackbody(Temperature);
  3. Threshold = threshold(Fac, Lower, Upper);
  4.  
  5. // From OSL documentation:
  6. // For surface emission, If you divide emission() by surfacearea()
  7. // * M PI, then you can easily specify the total emissive power
  8. // of the light (e.g., W), regardless of its physical size.
  9. W = Strength / (surfacearea() * M_PI);
  10. Shader = mix(holdout(), Color * W * emission(), Threshold);
  11. Color = mix(0.0, Color, Threshold);
  12. }
Add Comment
Please, Sign In to add comment