diff options
author | Dave Parks <davep@lindenlab.com> | 2011-09-22 00:33:27 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-09-22 00:33:27 -0500 |
commit | e7b743d80bb6e7bde9c90eb0a7f0e0244bb41f8d (patch) | |
tree | fe796b7596b44ef16680182107cf7d2c226b3e33 /indra | |
parent | a2d08a6d80c4be7456d30f728da1838e63eb397f (diff) |
SH-2244 Fix for artifacts with L&S enabled when using core profile.
Diffstat (limited to 'indra')
14 files changed, 14 insertions, 16 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl index 585faf6cd5..5f83d06388 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl @@ -126,7 +126,7 @@ void main() if (sa > 0.0) { - sa = texture2D(lightFunc,vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0); + sa = texture2D(lightFunc,vec2(sa, spec.a)).r * min(dist_atten*4.0, 1.0); sa *= noise; col += da*sa*light_col[i].rgb*spec.rgb; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 6351a5ac0d..17955f32cd 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -37,7 +37,6 @@ uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; uniform samplerCube environmentMap; uniform sampler2D noiseMap; -uniform sampler2D lightFunc; uniform sampler2D projectionMap; uniform mat4 proj_mat; //screen space to light space diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl index 60f99fac15..b8ed398a81 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl @@ -107,7 +107,7 @@ void main() float sa = dot(normalize(lv-normalize(pos)),norm); if (sa > 0.0) { - sa = texture2D(lightFunc, vec2(sa, spec.a)).a * min(dist_atten*4.0, 1.0); + sa = texture2D(lightFunc, vec2(sa, spec.a)).r * min(dist_atten*4.0, 1.0); sa *= noise; col += da*sa*color.rgb*spec.rgb; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index e86b0445ed..0844e659b6 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -307,7 +307,7 @@ void main() // vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); float sa = dot(refnormpersp, sun_dir.xyz); - vec3 dumbshiny = vary_SunlitColor*texture2D(lightFunc, vec2(sa, spec.a)).a; + vec3 dumbshiny = vary_SunlitColor*texture2D(lightFunc, vec2(sa, spec.a)).r; // add the two types of shiny together vec3 spec_contrib = dumbshiny * spec.rgb; diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index 8eac16d3f0..93842e818f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -35,7 +35,6 @@ uniform sampler2DRect specularRect; uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; uniform sampler2D noiseMap; -uniform sampler2D lightFunc; uniform sampler2D projectionMap; uniform mat4 proj_mat; //screen space to light space diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 409db862e6..7ef2608841 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -36,7 +36,6 @@ uniform sampler2DRect normalMap; uniform samplerCube environmentMap; uniform sampler2DRect lightMap; uniform sampler2D noiseMap; -uniform sampler2D lightFunc; uniform sampler2D projectionMap; uniform mat4 proj_mat; //screen space to light space diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl index 9e7542c01c..c2d374d22c 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl @@ -38,7 +38,6 @@ uniform sampler2DMS depthMap; uniform sampler2DMS normalMap; uniform sampler2DRect lightMap; uniform sampler2D noiseMap; -uniform sampler2D lightFunc; uniform sampler2D projectionMap; uniform mat4 proj_mat; //screen space to light space diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 642145a856..c09e3bb6e6 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -313,7 +313,7 @@ void main() // vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); float sa = dot(refnormpersp, sun_dir.xyz); - vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; + vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).r; // add the two types of shiny together vec3 spec_contrib = dumbshiny * spec.rgb; diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl index ab187ccfa5..6d746ebbba 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl @@ -314,7 +314,7 @@ void main() // vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); float sa = dot(refnormpersp, vary_light.xyz); - vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; + vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).r; // add the two types of shiny together vec3 spec_contrib = dumbshiny * spec.rgb; diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index c2e36abbd6..93b385cbf5 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -38,7 +38,6 @@ uniform sampler2DRect normalMap; uniform samplerCube environmentMap; uniform sampler2DRect lightMap; uniform sampler2D noiseMap; -uniform sampler2D lightFunc; uniform sampler2D projectionMap; uniform mat4 proj_mat; //screen space to light space diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl index 50369cb205..1e3257d4a2 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl @@ -38,7 +38,6 @@ uniform sampler2DMS depthMap; uniform sampler2DMS normalMap; uniform sampler2DRect lightMap; uniform sampler2D noiseMap; -uniform sampler2D lightFunc; uniform sampler2D projectionMap; uniform mat4 proj_mat; //screen space to light space diff --git a/indra/newview/app_settings/shaders/class3/deferred/giF.glsl b/indra/newview/app_settings/shaders/class3/deferred/giF.glsl index dad62a074a..39975f8249 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/giF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/giF.glsl @@ -156,7 +156,7 @@ vec3 giAmbient(vec3 pos, vec3 norm) if (spec.a > 0.0) { float sa = dot(ha,lnorm); - da = texture2D(lightFunc, vec2(sa, spec.a)).a; + da = texture2D(lightFunc, vec2(sa, spec.a)).r; } else { @@ -171,7 +171,7 @@ vec3 giAmbient(vec3 pos, vec3 norm) if (c_spec.a > 0.0) { float sa = dot(ha, gi_norm); - da = dist_atten*texture2D(lightFunc, vec2(sa, c_spec.a)).a; + da = dist_atten*texture2D(lightFunc, vec2(sa, c_spec.a)).r; } else { diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index cc6d080344..338d289ab0 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -295,7 +295,7 @@ void main() { vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy); - da = texture2D(lightFunc, vec2(da, 0.0)).a; + da = texture2D(lightFunc, vec2(da, 0.0)).r; vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg; float scol = max(scol_ambocc.r, diffuse.a); @@ -314,7 +314,7 @@ void main() // vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); float sa = dot(refnormpersp, vary_light.xyz); - vec3 dumbshiny = vary_SunlitColor*scol*texture2D(lightFunc, vec2(sa, spec.a)).a; + vec3 dumbshiny = vary_SunlitColor*scol*texture2D(lightFunc, vec2(sa, spec.a)).r; // add the two types of shiny together vec3 spec_contrib = dumbshiny * spec.rgb; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 0ca28eb03b..0fbe030832 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -7472,6 +7472,7 @@ void LLPipeline::renderDeferredLighting() //correspond to their axis facing, with bit position 3,2,1 matching //axis facing x,y,z, bit set meaning positive facing, bit clear //meaning negative facing + mDeferredVB->getVertexStrider(vert); v[0].set(c[0]-s,c[1]-s,c[2]-s); // 0 - 0000 v[1].set(c[0]-s,c[1]-s,c[2]+s); // 1 - 0001 v[2].set(c[0]-s,c[1]+s,c[2]-s); // 2 - 0010 @@ -7506,6 +7507,7 @@ void LLPipeline::renderDeferredLighting() gDeferredLightProgram.uniform1f("falloff", volume->getLightFalloff()*0.5f); //gGL.diffuseColor4f(col.mV[0], col.mV[1], col.mV[2], volume->getLightFalloff()*0.5f); gGL.syncMatrices(); + mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); glDrawRangeElements(GL_TRIANGLE_FAN, 0, 7, 8, GL_UNSIGNED_BYTE, get_box_fan_indices_ptr(camera, center)); stop_glerror(); @@ -7562,6 +7564,7 @@ void LLPipeline::renderDeferredLighting() //correspond to their axis facing, with bit position 3,2,1 matching //axis facing x,y,z, bit set meaning positive facing, bit clear //meaning negative facing + mDeferredVB->getVertexStrider(vert); v[0].set(c[0]-s,c[1]-s,c[2]-s); // 0 - 0000 v[1].set(c[0]-s,c[1]-s,c[2]+s); // 1 - 0001 v[2].set(c[0]-s,c[1]+s,c[2]-s); // 2 - 0010 @@ -7577,6 +7580,7 @@ void LLPipeline::renderDeferredLighting() gDeferredSpotLightProgram.uniform3fv("color", 1, col.mV); gDeferredSpotLightProgram.uniform1f("falloff", volume->getLightFalloff()*0.5f); gGL.syncMatrices(); + mDeferredVB->setBuffer(LLVertexBuffer::MAP_VERTEX); glDrawRangeElements(GL_TRIANGLE_FAN, 0, 7, 8, GL_UNSIGNED_BYTE, get_box_fan_indices_ptr(camera, center)); } @@ -7585,6 +7589,7 @@ void LLPipeline::renderDeferredLighting() } //reset mDeferredVB to fullscreen triangle + mDeferredVB->getVertexStrider(vert); vert[0].set(-1,1,0); vert[1].set(-1,-3,0); vert[2].set(3,1,0); @@ -7632,7 +7637,6 @@ void LLPipeline::renderDeferredLighting() gDeferredMultiLightProgram.uniform1f("far_z", far_z); far_z = 0.f; count = 0; - mDeferredVB->drawArrays(LLRender::TRIANGLES, 0, 3); } } |