Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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) {
- Color = blackbody(Temperature);
- Threshold = threshold(Fac, Lower, Upper);
- // From OSL documentation:
- // For surface emission, If you divide emission() by surfacearea()
- // * M PI, then you can easily specify the total emissive power
- // of the light (e.g., W), regardless of its physical size.
- W = Strength / (surfacearea() * M_PI);
- Shader = mix(holdout(), Color * W * emission(), Threshold);
- Color = mix(0.0, Color, Threshold);
- }
Add Comment
Please, Sign In to add comment