diff options
author | Oz Linden <oz@lindenlab.com> | 2012-04-03 11:28:56 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2012-04-03 11:28:56 -0400 |
commit | fa6add3fcd300b21142e3381f35851b3404ee02a (patch) | |
tree | b61b7264e152b2e356393ed9a7fcc7e73a1c6ba7 /indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl | |
parent | caa780e49740e8e9d707ad8ba6a302be8d4d20d9 (diff) | |
parent | 224217dae82ad5f5127c511de6c7237fa81f36bb (diff) |
merge changes for drtvwr-132
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl index 01e3505359..a425e5062e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/dofCombineF.glsl @@ -26,7 +26,9 @@ #extension GL_ARB_texture_rectangle : enable #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor #endif uniform sampler2DRect diffuseRect; @@ -37,14 +39,24 @@ uniform vec2 screen_res; uniform float max_cof; uniform float res_scale; +uniform float dof_width; +uniform float dof_height; VARYING vec2 vary_fragcoord; +vec4 dofSample(sampler2DRect tex, vec2 tc) +{ + tc.x = min(tc.x, dof_width); + tc.y = min(tc.y, dof_height); + + return texture2DRect(tex, tc); +} + void main() { vec2 tc = vary_fragcoord.xy; - vec4 dof = texture2DRect(diffuseRect, vary_fragcoord.xy*res_scale); + vec4 dof = dofSample(diffuseRect, vary_fragcoord.xy*res_scale); vec4 diff = texture2DRect(lightMap, vary_fragcoord.xy); @@ -63,5 +75,5 @@ void main() diff = mix(diff, col*0.25, a); } - gl_FragColor = mix(diff, dof, a); + frag_color = mix(diff, dof, a); } |