Deferred has sky and water textures now. Underwater is still borked.

Deferred fastalpha behaves a bit better.
Pulled over patch for https://jira.secondlife.com/browse/STORM-336 and https://jira.secondlife.com/browse/STORM-1011 from linden repo
Sky rendered using new LL method. Assuming this fixes issues on AMD cards(works on cat 11.2)
Added a few things missed related to spatial-parition updating.
Added 'SkipReflectOcclusionUpdates' setting that prevents occlusion updates for reflection pass. Less taxing on CPU.
This commit is contained in:
Shyotl
2011-03-08 18:36:59 -06:00
parent 60f3104eb6
commit 1b039a1be6
32 changed files with 708 additions and 375 deletions

View File

@@ -9843,6 +9843,17 @@
<key>Value</key>
<integer>1</integer>
</map>
<key>RenderVBOMappingDisable</key>
<map>
<key>Comment</key>
<string>Disable VBO glMapBufferARB</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>RenderVolumeLODFactor</key>
<map>
<key>Comment</key>
@@ -12800,6 +12811,17 @@
<key>Value</key>
<integer>1</integer>
</map>
<key>SkipReflectOcclusionUpdates</key>
<map>
<key>Comment</key>
<string>Enable optimization that prevents occlusion updates for refelction pass</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>UseOutfitFolders</key>
<map>
<key>Comment</key>

View File

@@ -71,14 +71,14 @@ void main()
color.rgb = scaleSoftClip(color.rgb);
if (samp_pos.z != 0.0)
/*if (samp_pos.z != 0.0)
{
float dist_factor = alpha_soften;
float a = gl_Color.a;
a *= a;
dist_factor *= 1.0/(1.0-a);
color.a *= min((pos.z-samp_pos.z)*dist_factor, 1.0);
}
}*/
//gl_FragColor = gl_Color;
gl_FragColor = color;

View File

@@ -37,8 +37,8 @@ void main()
calcAtmospherics(pos.xyz);
//vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.));
vec4 col;
col.a = gl_Color.a;
vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a);
// Add windlight lights
col.rgb = atmosAmbient(vec3(0.));

View File

@@ -12,7 +12,14 @@ varying vec4 vary_position;
void main()
{
gl_FragData[0] = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy);
vec4 diff = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy);
if (diff.a < 0.2)
{
discard;
}
gl_FragData[0] = vec4(diff.rgb, 0.0);
gl_FragData[1] = vec4(0,0,0,0);
gl_FragData[2] = vec4(normalize(vary_normal), 0.0);
gl_FragData[3] = vary_position;

View File

@@ -13,7 +13,8 @@ varying vec4 vary_position;
void main()
{
gl_FragData[0] = texture2D(diffuseMap, gl_TexCoord[0].xy);
vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy);
gl_FragData[0] = vec4(col.rgb, col.a <= 0.5 ? 0.0 : 0.005);
gl_FragData[1] = texture2D(specularMap, gl_TexCoord[0].xy);
gl_FragData[2] = vec4(texture2D(normalMap, gl_TexCoord[0].xy).xyz, vary_position.z);
gl_FragData[3] = vary_position;

View File

@@ -77,6 +77,12 @@ void main()
//attenuate point light contribution by SSAO component
out_col *= texture2DRect(lightMap, frag.xy).g;
if (dot(out_col, out_col) <= 0.0)
{
discard;
}
gl_FragColor.rgb = out_col;
gl_FragColor.a = 0.0;

View File

@@ -69,6 +69,11 @@ void main()
//attenuate point light contribution by SSAO component
col *= texture2DRect(lightMap, frag.xy).g;
if (dot(col, col) <= 0.0)
{
discard;
}
gl_FragColor.rgb = col;
gl_FragColor.a = 0.0;

View File

@@ -13,7 +13,7 @@ varying vec4 vary_position;
void main()
{
vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy);
gl_FragData[0] = gl_Color*col;
gl_FragData[0] = vec4(gl_Color.rgb*col.rgb, col.a <= 0.5 ? 0.0 : 0.005);
gl_FragData[1] = vec4(0,0,0,0);
gl_FragData[2] = vec4(normalize(vary_normal), 0.0);
gl_FragData[3] = vary_position;

View File

@@ -5,6 +5,7 @@
* $License$
*/
#extension GL_ARB_texture_rectangle : enable
vec3 scaleSoftClip(vec3 inColor);
vec3 atmosTransport(vec3 inColor);
@@ -32,6 +33,7 @@ uniform vec3 normScale;
uniform float fresnelScale;
uniform float fresnelOffset;
uniform float blurMultiplier;
uniform mat4 norm_mat; //region space to screen space
//bigWave is (refCoord.w, view.w);
@@ -88,7 +90,7 @@ void main()
refcol *= df1 * 0.333;
vec3 wavef = (wave1 + wave2 * 0.4 + wave3 * 0.6) * 0.5;
wavef.z *= max(-viewVec.z, 0.1);
// wavef.z *= max(-viewVec.z, 0.1);
wavef = normalize(wavef);
float df2 = dot(viewVec, wavef) * fresnelScale+fresnelOffset;
@@ -101,10 +103,10 @@ void main()
refcol = mix(baseCol*df2, refcol, dweight);
//get specular component
float spec = clamp(dot(lightDir, (reflect(viewVec,wavef))),0.0,1.0);
// float spec = clamp(dot(lightDir, (reflect(viewVec,wavef))),0.0,1.0);
//harden specular
spec = pow(spec, 128.0);
// spec = pow(spec, 128.0);
//figure out distortion vector (ripply)
vec2 distort2 = distort+wavef.xy*refScale/max(dmod*df1, 1.0);
@@ -118,13 +120,13 @@ void main()
float shadow = 1.0;
vec4 pos = vary_position;
vec3 nz = texture2D(noiseMap, gl_FragCoord.xy/128.0).xyz;
//vec3 nz = texture2D(noiseMap, gl_FragCoord.xy/128.0).xyz;
if (pos.z > -shadow_clip.w)
{
// if (pos.z > -shadow_clip.w)
// {
vec4 spos = pos;
if (pos.z < -shadow_clip.z)
/* if (pos.z < -shadow_clip.z)
{
vec4 lpos = (shadow_matrix[3]*spos);
shadow = shadow2DProj(shadowMap3, lpos).x;
@@ -144,14 +146,19 @@ void main()
vec4 lpos = (shadow_matrix[0]*spos);
shadow = shadow2DProj(shadowMap0, lpos).x;
}
}
}*/
spec *= shadow;
color.rgb += spec * specular;
// spec *= shadow;
// color.rgb += spec * specular;
color.rgb = atmosTransport(color.rgb);
color.rgb = scaleSoftClip(color.rgb);
color.a = spec * sunAngle2;
// color.rgb = scaleSoftClip(color.rgb);
// color.a = spec * sunAngle2;
gl_FragColor = color;
// gl_FragColor = color;
vec3 screenspacewavef = (norm_mat*vec4(wavef, 1.0)).xyz;
gl_FragData[0] = vec4(color.rgb, 0.5); // diffuse
gl_FragData[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec
gl_FragData[2] = vec4(screenspacewavef, 0.0); // normalxyz, displace
}