diff options
author | Irie Shinsuke <irieshinsuke@yahoo.co.jp> | 2013-11-12 14:59:40 +0400 |
---|---|---|
committer | Irie Shinsuke <irieshinsuke@yahoo.co.jp> | 2013-11-12 14:59:40 +0400 |
commit | ba7fd8cd5c173730c8c2250eac7ea48fafd519c7 (patch) | |
tree | f2228ea2e83dcc04fb965c36197579008716e921 /source/blender/gpu/shaders | |
parent | e177ac100ba83c9f53d715aed86a092106554088 (diff) |
Change the behavior of AO pass in Blender internal's shader/render node tree so that it becomes (1.0, 1.0, 1.0) when AO is disabled.
For materials using AO pass, this makes the material preview and the GLSL
preview more accurate, but shouldn't affect final rendering in most cases
because we usually enable AO when using the AO pass in node tree.
Thanks to Brecht for code review.
Diffstat (limited to 'source/blender/gpu/shaders')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_material.glsl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index 78664f3b539..5e5fac3049c 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -393,11 +393,21 @@ void set_rgb_zero(out vec3 outval) outval = vec3(0.0); } +void set_rgb_one(out vec3 outval) +{ + outval = vec3(1.0); +} + void set_rgba_zero(out vec4 outval) { outval = vec4(0.0); } +void set_rgba_one(out vec4 outval) +{ + outval = vec4(1.0); +} + void brightness_contrast(vec4 col, float brightness, float contrast, out vec4 outcol) { float a = 1.0 + contrast; |