diff options
author | Thomas Dinges <blender@dingto.org> | 2013-12-08 15:20:15 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2013-12-08 15:20:15 +0400 |
commit | 28d5f2ab6054c26865c655bb1f82534b83c773ce (patch) | |
tree | bc349aa76d77ee2c2633347a90614ae8fb588bd3 /intern | |
parent | 2069606dc51d84b6db96eee5b82cdcb385079f01 (diff) |
Cycles: Update stdosl.h to OSL 1.4.0. (includes new aastep functions).
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/kernel/shaders/stdosl.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/intern/cycles/kernel/shaders/stdosl.h b/intern/cycles/kernel/shaders/stdosl.h index 47c5dc27f2b..d1d1222af44 100644 --- a/intern/cycles/kernel/shaders/stdosl.h +++ b/intern/cycles/kernel/shaders/stdosl.h @@ -412,13 +412,27 @@ matrix transpose (matrix m) BUILTIN; // Pattern generation -float step (float edge, float x) BUILTIN; color step (color edge, color x) BUILTIN; point step (point edge, point x) BUILTIN; vector step (vector edge, vector x) BUILTIN; normal step (normal edge, normal x) BUILTIN; +float step (float edge, float x) BUILTIN; float smoothstep (float edge0, float edge1, float x) BUILTIN; +float aastep (float edge, float s, float dedge, float ds) { + // Box filtered AA step + float width = fabs(dedge) + fabs(ds); + float halfwidth = 0.5*width; + float e1 = edge-halfwidth; + return (s <= e1) ? 0.0 : ((s >= (edge+halfwidth)) ? 1.0 : (s-e1)/width); +} +float aastep (float edge, float s, float ds) { + return aastep (edge, s, filterwidth(edge), ds); +} +float aastep (float edge, float s) { + return aastep (edge, s, filterwidth(edge), filterwidth(s)); +} + // Derivatives and area operators |