diff options
author | Dave Parks <davep@lindenlab.com> | 2011-05-12 18:50:22 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-05-12 18:50:22 -0500 |
commit | 8017900e7f536663153451ff788d8662427782ed (patch) | |
tree | f200e2bc13d8b9d02050835e7e4492aa63342144 /indra/newview | |
parent | 93696ac019865898d35d37d1e32d7a4b819a0c93 (diff) | |
parent | 2a843e9a6bb5cb70f69794419ab4a7d16ee3c6cb (diff) |
merge
Diffstat (limited to 'indra/newview')
21 files changed, 187 insertions, 280 deletions
diff --git a/indra/newview/app_settings/high_graphics.xml b/indra/newview/app_settings/high_graphics.xml index f1862f9d72..5bc2e1b7e6 100644 --- a/indra/newview/app_settings/high_graphics.xml +++ b/indra/newview/app_settings/high_graphics.xml @@ -4,15 +4,15 @@ <RenderAvatarCloth value="FALSE"/> <!--Default for now--> <RenderAvatarLODFactor value="1.0"/> - <!--Default for now--> - <RenderAvatarPhysicsLODFactor value="0.9"/> + <!--Default for now--> + <RenderAvatarPhysicsLODFactor value="0.9"/> <!--NO SHADERS--> <RenderAvatarVP value="TRUE"/> <!--Short Range--> <RenderFarClip value="128"/> <!--Default for now--> <RenderFlexTimeFactor value="1"/> - <!--256... but they don't use this--> + <!--256... but they do not use this--> <RenderGlowResolutionPow value="9"/> <!--Low number--> <RenderMaxPartCount value="4096"/> @@ -34,11 +34,10 @@ <VertexShaderEnable value="TRUE"/> <!--NO SHADERS--> <WindLightUseAtmosShaders value="TRUE"/> - <!--Deferred Shading--> - <RenderDeferred value="FALSE"/> - <!--SSAO Disabled--> - <RenderDeferredSSAO value="FALSE"/> - <!--Sun Shadows--> - <RenderShadowDetail value="0"/> - + <!--Deferred Shading--> + <RenderDeferred value="FALSE"/> + <!--SSAO Disabled--> + <RenderDeferredSSAO value="FALSE"/> + <!--Sun Shadows--> + <RenderShadowDetail value="0"/> </settings> diff --git a/indra/newview/app_settings/low_graphics.xml b/indra/newview/app_settings/low_graphics.xml index ad0073dfac..ca1dae0b86 100644 --- a/indra/newview/app_settings/low_graphics.xml +++ b/indra/newview/app_settings/low_graphics.xml @@ -4,17 +4,17 @@ <RenderAvatarCloth value="FALSE"/> <!--Default for now--> <RenderAvatarLODFactor value="0.5"/> - <!--Default for now--> - <RenderAvatarPhysicsLODFactor value="0.0"/> - <!--Default for now--> - <RenderAvatarMaxVisible value="3"/> + <!--Default for now--> + <RenderAvatarPhysicsLODFactor value="0.0"/> + <!--Default for now--> + <RenderAvatarMaxVisible value="3"/> <!--NO SHADERS--> <RenderAvatarVP value="FALSE"/> <!--Short Range--> <RenderFarClip value="64"/> <!--Default for now--> <RenderFlexTimeFactor value="0.5"/> - <!--256... but they don't use this--> + <!--256... but they do not use this--> <RenderGlowResolutionPow value="8"/> <!--Low number--> <RenderMaxPartCount value="1024"/> @@ -36,11 +36,10 @@ <VertexShaderEnable value="FALSE"/> <!--NO SHADERS--> <WindLightUseAtmosShaders value="FALSE"/> - <!--No Deferred Shading--> - <RenderDeferred value="FALSE"/> - <!--SSAO Disabled--> - <RenderDeferredSSAO value="FALSE"/> - <!--No Shadows--> - <RenderShadowDetail value="0"/> - + <!--No Deferred Shading--> + <RenderDeferred value="FALSE"/> + <!--SSAO Disabled--> + <RenderDeferredSSAO value="FALSE"/> + <!--No Shadows--> + <RenderShadowDetail value="0"/> </settings> diff --git a/indra/newview/app_settings/mid_graphics.xml b/indra/newview/app_settings/mid_graphics.xml index 6c4afbd7f0..01822fe64c 100644 --- a/indra/newview/app_settings/mid_graphics.xml +++ b/indra/newview/app_settings/mid_graphics.xml @@ -4,15 +4,15 @@ <RenderAvatarCloth value="FALSE"/> <!--Default for now--> <RenderAvatarLODFactor value="0.5"/> - <!--Default for now--> - <RenderAvatarPhysicsLODFactor value="0.75"/> + <!--Default for now--> + <RenderAvatarPhysicsLODFactor value="0.75"/> <!--NO SHADERS--> <RenderAvatarVP value="TRUE"/> <!--Short Range--> <RenderFarClip value="96"/> <!--Default for now--> <RenderFlexTimeFactor value="1"/> - <!--256... but they don't use this--> + <!--256... but they do not use this--> <RenderGlowResolutionPow value="8"/> <!--Low number--> <RenderMaxPartCount value="2048"/> @@ -34,11 +34,10 @@ <VertexShaderEnable value="TRUE"/> <!--NO SHADERS--> <WindLightUseAtmosShaders value="FALSE"/> - <!--No Deferred Shading--> - <RenderDeferred value="FALSE"/> - <!--SSAO Disabled--> - <RenderDeferredSSAO value="FALSE"/> - <!--No Shadows--> - <RenderShadowDetail value="0"/> - + <!--No Deferred Shading--> + <RenderDeferred value="FALSE"/> + <!--SSAO Disabled--> + <RenderDeferredSSAO value="FALSE"/> + <!--No Shadows--> + <RenderShadowDetail value="0"/> </settings> diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaF.glsl deleted file mode 100644 index 7d9d6cc0b2..0000000000 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaF.glsl +++ /dev/null @@ -1,70 +0,0 @@ -/** - * @file avatarAlphaF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * $/LicenseInfo$ - */ - -#version 120 - -uniform sampler2D diffuseMap; -uniform sampler2DShadow shadowMap0; -uniform sampler2DShadow shadowMap1; -uniform sampler2DShadow shadowMap2; -uniform sampler2DShadow shadowMap3; -uniform sampler2D noiseMap; - -uniform mat4 shadow_matrix[6]; -uniform vec4 shadow_clip; - -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -varying vec3 vary_ambient; -varying vec3 vary_directional; -varying vec4 vary_position; -varying vec3 vary_normal; - -void main() -{ - float shadow = 1.0; - vec4 pos = vary_position; - vec3 norm = normalize(vary_normal); - - vec3 nz = texture2D(noiseMap, gl_FragCoord.xy/128.0).xyz; - - if (pos.z > -shadow_clip.w) - { - - if (pos.z < -shadow_clip.z) - { - vec4 lpos = shadow_matrix[3]*pos; - shadow = shadow2DProj(shadowMap3, lpos).x; - } - else if (pos.z < -shadow_clip.y) - { - vec4 lpos = shadow_matrix[2]*pos; - shadow = shadow2DProj(shadowMap2, lpos).x; - } - else if (pos.z < -shadow_clip.x) - { - vec4 lpos = shadow_matrix[1]*pos; - shadow = shadow2DProj(shadowMap1, lpos).x; - } - else - { - vec4 lpos = shadow_matrix[0]*pos; - shadow = shadow2DProj(shadowMap0, lpos).x; - } - } - - - vec4 col = vec4(vary_ambient + vary_directional*shadow, gl_Color.a); - vec4 color = texture2D(diffuseMap, gl_TexCoord[0].xy) * col; - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - - gl_FragColor = color; -} diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl index 5dfbb91393..a2a7dea20d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl @@ -22,11 +22,36 @@ vec3 scaleUpLight(vec3 light); varying vec3 vary_position; varying vec3 vary_ambient; varying vec3 vary_directional; -varying vec3 vary_normal; varying vec3 vary_fragcoord; +varying vec3 vary_pointlight_col; uniform float near_clip; +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) +{ + //get light vector + vec3 lv = lp.xyz-v; + + //get distance + float d = length(lv); + + //normalize light vector + lv *= 1.0/d; + + //distance attenuation + float dist2 = d*d/(la*la); + float da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); + + // spotlight coefficient. + float spot = max(dot(-ln, lv), is_pointlight); + da *= spot*spot; // GL_SPOT_EXPONENT=2 + + //angular attenuation + da *= calcDirectionalLight(n, lv); + + return da; +} + void main() { gl_TexCoord[0] = gl_MultiTexCoord0; @@ -49,7 +74,6 @@ void main() gl_Position = frag_pos; vary_position = pos.xyz; - vary_normal = norm; calcAtmospherics(pos.xyz); @@ -57,18 +81,20 @@ void main() vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); - // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); - col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); - col.rgb = scaleDownLight(col.rgb); + // Collect normal lights + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a); + vary_pointlight_col = col.rgb*gl_Color.rgb; + + col.rgb = vec3(0,0,0); + // Add windlight lights - col.rgb += atmosAmbient(vec3(0.)); + col.rgb = atmosAmbient(vec3(0.)); vary_ambient = col.rgb*gl_Color.rgb; vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a))); diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl new file mode 100644 index 0000000000..2e3e84dd15 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl @@ -0,0 +1,20 @@ +/** + * @file multiPointLightV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +#version 120 + +varying vec4 vary_fragcoord; + +void main() +{ + //transform vertex + vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; + vary_fragcoord = pos; + + gl_Position = pos; + gl_FrontColor = gl_Color; +} diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl index 25ff958107..cd91351ad4 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl @@ -15,8 +15,6 @@ uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; uniform sampler2D noiseMap; -uniform sampler2D lightFunc; - // Inputs uniform mat4 shadow_matrix[6]; diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaF.glsl deleted file mode 100644 index 4671a54078..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaF.glsl +++ /dev/null @@ -1,100 +0,0 @@ -/** - * @file avatarAlphaF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * $/LicenseInfo$ - */ - -#version 120 - -#extension GL_ARB_texture_rectangle : enable - -uniform sampler2D diffuseMap; -uniform sampler2DRectShadow shadowMap0; -uniform sampler2DRectShadow shadowMap1; -uniform sampler2DRectShadow shadowMap2; -uniform sampler2DRectShadow shadowMap3; -uniform sampler2D noiseMap; - -uniform mat4 shadow_matrix[6]; -uniform vec4 shadow_clip; -uniform vec2 screen_res; -uniform vec2 shadow_res; - -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -varying vec3 vary_ambient; -varying vec3 vary_directional; -varying vec3 vary_position; -varying vec3 vary_normal; - -uniform float shadow_bias; - -float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) -{ - stc.xyz /= stc.w; - stc.z += shadow_bias; - - float cs = shadow2DRect(shadowMap, stc.xyz).x; - float shadow = cs; - - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(scl, scl, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(scl, -scl, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-scl, scl, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-scl, -scl, 0.0)).x, cs); - - return shadow/5.0; -} - -void main() -{ - float shadow = 1.0; - vec4 pos = vec4(vary_position, 1.0); - vec3 norm = normalize(vary_normal); - - //vec3 nz = texture2D(noiseMap, gl_FragCoord.xy/128.0).xyz; - - vec4 spos = pos; - - if (spos.z > -shadow_clip.w) - { - vec4 lpos; - - if (spos.z < -shadow_clip.z) - { - lpos = shadow_matrix[3]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap3, lpos, 1.5); - shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); - } - else if (spos.z < -shadow_clip.y) - { - lpos = shadow_matrix[2]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap2, lpos, 1.5); - } - else if (spos.z < -shadow_clip.x) - { - lpos = shadow_matrix[1]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap1, lpos, 1.5); - } - else - { - lpos = shadow_matrix[0]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap0, lpos, 1.5); - } - } - - - vec4 col = vec4(vary_ambient + vary_directional*shadow, gl_Color.a); - vec4 color = texture2D(diffuseMap, gl_TexCoord[0].xy) * col; - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - - gl_FragColor = color; -} diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl index 30954a8677..495e86c8db 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl @@ -22,13 +22,38 @@ vec3 scaleUpLight(vec3 light); varying vec3 vary_position; varying vec3 vary_ambient; varying vec3 vary_directional; -varying vec3 vary_normal; varying vec3 vary_fragcoord; +varying vec3 vary_pointlight_col; uniform float near_clip; uniform float shadow_offset; uniform float shadow_bias; +float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) +{ + //get light vector + vec3 lv = lp.xyz-v; + + //get distance + float d = length(lv); + + //normalize light vector + lv *= 1.0/d; + + //distance attenuation + float dist2 = d*d/(la*la); + float da = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); + + // spotlight coefficient. + float spot = max(dot(-ln, lv), is_pointlight); + da *= spot*spot; // GL_SPOT_EXPONENT=2 + + //angular attenuation + da *= calcDirectionalLight(n, lv); + + return da; +} + void main() { gl_TexCoord[0] = gl_MultiTexCoord0; @@ -51,7 +76,6 @@ void main() float dp_directional_light = max(0.0, dot(norm, gl_LightSource[0].position.xyz)); vary_position = pos.xyz + gl_LightSource[0].position.xyz * (1.0-dp_directional_light)*shadow_offset; - vary_normal = norm; calcAtmospherics(pos.xyz); @@ -59,18 +83,20 @@ void main() vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a); - // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].specular.a); - col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].specular.a); - col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].specular.a); - col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); - col.rgb = scaleDownLight(col.rgb); + // Collect normal lights + col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a); + col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a); + col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a); + col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a); + col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a); + col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a); + vary_pointlight_col = col.rgb*gl_Color.rgb; + + col.rgb = vec3(0,0,0); + // Add windlight lights - col.rgb += atmosAmbient(vec3(0.)); + col.rgb = atmosAmbient(vec3(0.)); vary_ambient = col.rgb*gl_Color.rgb; vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a))); diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index 26bc83e0d4..4369b3b34f 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -19,9 +19,6 @@ uniform sampler2DRectShadow shadowMap2; uniform sampler2DRectShadow shadowMap3; uniform sampler2DShadow shadowMap4; uniform sampler2DShadow shadowMap5; -uniform sampler2D noiseMap; - -uniform sampler2D lightFunc; // Inputs diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl index 08b16d787f..847b36b1ac 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -21,8 +21,6 @@ uniform sampler2DShadow shadowMap4; uniform sampler2DShadow shadowMap5; uniform sampler2D noiseMap; -uniform sampler2D lightFunc; - // Inputs uniform mat4 shadow_matrix[6]; uniform vec4 shadow_clip; diff --git a/indra/newview/app_settings/ultra_graphics.xml b/indra/newview/app_settings/ultra_graphics.xml index 3d588cf57d..71459e5470 100644 --- a/indra/newview/app_settings/ultra_graphics.xml +++ b/indra/newview/app_settings/ultra_graphics.xml @@ -4,15 +4,15 @@ <RenderAvatarCloth value="TRUE"/> <!--Default for now--> <RenderAvatarLODFactor value="1.0"/> - <!--Default for now--> - <RenderAvatarPhysicsLODFactor value="1.0"/> + <!--Default for now--> + <RenderAvatarPhysicsLODFactor value="1.0"/> <!--NO SHADERS--> <RenderAvatarVP value="TRUE"/> <!--Short Range--> <RenderFarClip value="256"/> <!--Default for now--> <RenderFlexTimeFactor value="1"/> - <!--256... but they don't use this--> + <!--256... but they do not use this--> <RenderGlowResolutionPow value="9"/> <!--Low number--> <RenderMaxPartCount value="4096"/> @@ -34,11 +34,10 @@ <VertexShaderEnable value="TRUE"/> <!--NO SHADERS--> <WindLightUseAtmosShaders value="TRUE"/> - <!--Deferred Shading--> - <RenderDeferred value="TRUE"/> - <!--SSAO Enabled--> - <RenderDeferredSSAO value="TRUE"/> - <!--Full Shadows--> - <RenderShadowDetail value="2"/> - + <!--Deferred Shading--> + <RenderDeferred value="TRUE"/> + <!--SSAO Enabled--> + <RenderDeferredSSAO value="TRUE"/> + <!--Full Shadows--> + <RenderShadowDetail value="2"/> </settings> diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index 6bdb1e1787..c075c660f3 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -1,4 +1,4 @@ -version 22 +version 23 // NOTE: This is mostly identical to featuretable_mac.txt with a few differences // Should be combined into one table @@ -24,11 +24,11 @@ version 22 // list all RenderAnisotropic 1 0 -RenderAvatarCloth 0 0 +RenderAvatarCloth 1 1 RenderAvatarLODFactor 1 1.0 RenderAvatarPhysicsLODFactor 1 1.0 RenderAvatarMaxVisible 1 12 -RenderAvatarVP 1 0 +RenderAvatarVP 1 1 RenderCubeMap 1 1 RenderDelayVBUpdate 1 0 RenderFarClip 1 256 @@ -41,7 +41,7 @@ RenderLocalLights 1 1 RenderMaxPartCount 1 8192 RenderNightBrightness 1 1.0 RenderObjectBump 1 1 -RenderReflectionDetail 1 3 +RenderReflectionDetail 1 4 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 @@ -49,23 +49,21 @@ RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVBOEnable 1 1 RenderVolumeLODFactor 1 2.0 -RenderWaterReflections 1 1 +UseStartScreen 1 1 UseOcclusion 1 1 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 128 -RenderUseCleverUI 1 1 Disregard128DefaultDrawDistance 1 1 Disregard96DefaultDrawDistance 1 1 RenderTextureMemoryMultiple 1 0.5 -Disregard128DefaultDrawDistance 1 1 -Disregard96DefaultDrawDistance 1 1 +RenderShaderLightingMaxLevel 1 3 SkyUseClassicClouds 1 1 -WatchdogDisabled 1 1 RenderDeferred 1 1 RenderDeferredSSAO 1 1 RenderShadowDetail 1 2 - +WatchdogDisabled 1 1 +RenderUseStreamVBO 1 1 // // Low Graphics Settings @@ -90,15 +88,13 @@ RenderTransparentWater 1 0 RenderTreeLODFactor 1 0 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 0.5 -RenderWaterReflections 1 0 VertexShaderEnable 1 0 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 SkyUseClassicClouds 1 0 RenderDeferred 1 0 RenderDeferredSSAO 1 0 -RenderShadowDetail 1 2 - +RenderShadowDetail 1 0 // // Mid Graphics Settings @@ -122,14 +118,12 @@ RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 -RenderWaterReflections 1 0 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 0 WLSkyDetail 1 48 RenderDeferred 1 0 RenderDeferredSSAO 1 0 -RenderShadowDetail 1 2 - +RenderShadowDetail 1 0 // // High Graphics Settings (purty) @@ -153,7 +147,6 @@ RenderTransparentWater 1 1 RenderTreeLODFactor 1 0.5 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 -RenderWaterReflections 1 0 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 48 @@ -161,7 +154,6 @@ RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderShadowDetail 1 2 - // // Ultra graphics (REALLY PURTY!) // @@ -177,14 +169,13 @@ RenderGlowResolutionPow 1 9 RenderLocalLights 1 1 RenderMaxPartCount 1 8192 RenderObjectBump 1 1 -RenderReflectionDetail 1 3 +RenderReflectionDetail 1 4 RenderTerrainDetail 1 1 RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 2.0 -RenderWaterReflections 1 1 VertexShaderEnable 1 1 WindLightUseAtmosShaders 1 1 WLSkyDetail 1 128 @@ -192,7 +183,6 @@ RenderDeferred 1 0 RenderDeferredSSAO 1 0 RenderShadowDetail 1 2 - // // Class Unknown Hardware (unknown) // @@ -229,9 +219,12 @@ RenderVBOEnable 1 1 list NoPixelShaders RenderAvatarVP 0 0 RenderAvatarCloth 0 0 -RenderWaterReflections 0 0 +RenderReflectionDetail 0 0 VertexShaderEnable 0 0 WindLightUseAtmosShaders 0 0 +RenderDeferred 0 0 +RenderDeferredSSAO 0 0 +RenderShadowDetail 0 0 // // No Vertex Shaders available @@ -239,10 +232,14 @@ WindLightUseAtmosShaders 0 0 list NoVertexShaders RenderAvatarVP 0 0 RenderAvatarCloth 0 0 -RenderWaterReflections 0 0 +RenderReflectionDetail 0 0 VertexShaderEnable 0 0 WindLightUseAtmosShaders 0 0 +RenderDeferred 0 0 +RenderDeferredSSAO 0 0 +RenderShadowDetail 0 0 +// // "Default" setups for safe, low, medium, high // list safe @@ -255,8 +252,11 @@ RenderMaxPartCount 1 1024 RenderTerrainDetail 1 0 RenderUseImpostors 0 0 RenderVBOEnable 1 0 -RenderWaterReflections 0 0 +RenderReflectionDetail 0 0 WindLightUseAtmosShaders 0 0 +RenderDeferred 0 0 +RenderDeferredSSAO 0 0 +RenderShadowDetail 0 0 // // CPU based feature masks @@ -278,6 +278,9 @@ RenderObjectBump 0 0 list OpenGLPre15 RenderVBOEnable 1 0 +list TexUnit8orLess +RenderDeferredSSAO 0 0 + list Intel RenderAnisotropic 1 0 RenderLocalLights 1 0 diff --git a/indra/newview/featuretable_xp.txt b/indra/newview/featuretable_xp.txt index 08fb67a0c8..3339172a1a 100644 --- a/indra/newview/featuretable_xp.txt +++ b/indra/newview/featuretable_xp.txt @@ -152,7 +152,7 @@ WindLightUseAtmosShaders 1 1 WLSkyDetail 1 48 RenderDeferred 1 0 RenderDeferredSSAO 1 0 -RenderShadowDetail 1 0 +RenderShadowDetail 1 2 // // Ultra graphics (REALLY PURTY!) @@ -181,7 +181,7 @@ WindLightUseAtmosShaders 1 1 WLSkyDetail 1 128 RenderDeferred 1 0 RenderDeferredSSAO 1 0 -RenderShadowDetail 1 0 +RenderShadowDetail 1 2 // // Class Unknown Hardware (unknown) diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp index 6b45c5abb0..030d6e1110 100644 --- a/indra/newview/lldrawpoolsky.cpp +++ b/indra/newview/lldrawpoolsky.cpp @@ -63,6 +63,8 @@ void LLDrawPoolSky::prerender() void LLDrawPoolSky::render(S32 pass) { + gGL.flush(); + if (mDrawFace.empty()) { return; @@ -111,13 +113,14 @@ void LLDrawPoolSky::render(S32 pass) S32 face_count = (S32)mDrawFace.size(); + LLVertexBuffer::unbind(); + glColor4f(1,1,1,1); + for (S32 i = 0; i < llmin(6, face_count); ++i) { renderSkyCubeFace(i); } - LLGLEnable blend(GL_BLEND); - glPopMatrix(); } diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 9f0b34becc..524d2d74ef 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -753,6 +753,10 @@ void LLFeatureManager::applyBaseMasks() { maskFeatures("OpenGLPre30"); } + if (gGLManager.mNumTextureUnits <= 8) + { + maskFeatures("TexUnit8orLess"); + } // now mask by gpu string // Replaces ' ' with '_' in mGPUString to deal with inability for parser to handle spaces diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 18b7a48d7b..4b15695cbf 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -987,9 +987,15 @@ void LLFloaterPreference::refreshEnabledState() LLCheckBoxCtrl* ctrl_avatar_vp = getChild<LLCheckBoxCtrl>("AvatarVertexProgram"); // Avatar Render Mode LLCheckBoxCtrl* ctrl_avatar_cloth = getChild<LLCheckBoxCtrl>("AvatarCloth"); + + bool avatar_vp_enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderAvatarVP"); + if (LLViewerShaderMgr::sInitialized) + { + S32 max_avatar_shader = LLViewerShaderMgr::instance()->mMaxAvatarShaderLevel; + avatar_vp_enabled = (max_avatar_shader > 0) ? TRUE : FALSE; + } - S32 max_avatar_shader = LLViewerShaderMgr::instance()->mMaxAvatarShaderLevel; - ctrl_avatar_vp->setEnabled((max_avatar_shader > 0) ? TRUE : FALSE); + ctrl_avatar_vp->setEnabled(avatar_vp_enabled); if (gSavedSettings.getBOOL("VertexShaderEnable") == FALSE || gSavedSettings.getBOOL("RenderAvatarVP") == FALSE) @@ -1006,7 +1012,7 @@ void LLFloaterPreference::refreshEnabledState() LLCheckBoxCtrl* ctrl_shader_enable = getChild<LLCheckBoxCtrl>("BasicShaders"); // radio set for terrain detail mode LLRadioGroup* mRadioTerrainDetail = getChild<LLRadioGroup>("TerrainDetailRadio"); // can be linked with control var - + ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")); BOOL shaders = ctrl_shader_enable->get(); diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp index 4b2c569cc3..450f9b2be7 100644 --- a/indra/newview/llpolymesh.cpp +++ b/indra/newview/llpolymesh.cpp @@ -770,7 +770,7 @@ LLPolyMesh::LLPolyMesh(LLPolyMeshSharedData *shared_data, LLPolyMesh *reference_ int nverts = mSharedData->mNumVertices; int nfloats = nverts * (2*4 + 3*3 + 2 + 4); //use 16 byte aligned vertex data to make LLPolyMesh SSE friendly - mVertexData = (F32*) malloc(nfloats*4); + mVertexData = (F32*) ll_aligned_malloc_16(nfloats*4); int offset = 0; mCoords = (LLVector4*)(mVertexData + offset); offset += 4*nverts; mNormals = (LLVector4*)(mVertexData + offset); offset += 4*nverts; @@ -799,7 +799,7 @@ LLPolyMesh::~LLPolyMesh() mJointRenderData[i] = NULL; } - free(mVertexData); + ll_aligned_free_16(mVertexData); } diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 5f16dac7b9..fa329eb0ae 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -3167,11 +3167,11 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) LLConvexDecomposition::getInstance()->generateSingleHullMeshFromMesh( &mesh, &res ); //copy res into phys_volume - phys_volume->mHullPoints = (LLVector4a*) malloc(sizeof(LLVector4a)*res.mNumVertices); + phys_volume->mHullPoints = (LLVector4a*) ll_aligned_malloc_16(sizeof(LLVector4a)*res.mNumVertices); phys_volume->mNumHullPoints = res.mNumVertices; S32 idx_size = (res.mNumTriangles*3*2+0xF) & ~0xF; - phys_volume->mHullIndices = (U16*) malloc(idx_size); + phys_volume->mHullIndices = (U16*) ll_aligned_malloc_16(idx_size); phys_volume->mNumHullIndices = res.mNumTriangles*3; const F32* v = res.mVertexBase; diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index e81ee72c05..3e85802ba6 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -1051,7 +1051,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() { gDeferredMultiLightProgram.mName = "Deferred MultiLight Shader"; gDeferredMultiLightProgram.mShaderFiles.clear(); - gDeferredMultiLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredMultiLightProgram.mShaderFiles.push_back(make_pair("deferred/multiPointLightV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredMultiLightProgram.mShaderFiles.push_back(make_pair("deferred/multiPointLightF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredMultiLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredMultiLightProgram.createShader(NULL, NULL); diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 288d335e1d..6396bc042d 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -304,7 +304,7 @@ void LLSkyTex::createGLImage(S32 which) void LLSkyTex::bindTexture(BOOL curr) { - gGL.getTexUnit(0)->bind(mTexture[getWhich(curr)]); + gGL.getTexUnit(0)->bind(mTexture[getWhich(curr)], true); } /*************************************** |