Add Firestorm tags & stuff
parent
17baf01fe0
commit
5aa14b9a4d
|
|
@ -452,6 +452,11 @@ vec3 fullbrightScaleSoftClip(vec3 light)
|
|||
|
||||
void main()
|
||||
{
|
||||
// <FS> Fix impostors failing to render with alpha correctly
|
||||
//vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5;
|
||||
//frag *= screen_res;
|
||||
// </FS>
|
||||
|
||||
vec4 pos = vec4(vary_position, 1.0);
|
||||
|
||||
float shadow = 1.0;
|
||||
|
|
@ -528,14 +533,24 @@ void main()
|
|||
#else
|
||||
vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy);
|
||||
#endif
|
||||
|
||||
// <FS> Fix impostors failing to render with alpha correctly
|
||||
//#ifdef FOR_IMPOSTOR
|
||||
// vec4 color;
|
||||
// color.rgb = diff.rgb;
|
||||
// color.a = 1.0;
|
||||
// </FS>
|
||||
|
||||
#ifdef USE_VERTEX_COLOR
|
||||
float final_alpha = diff.a * vertex_color.a;
|
||||
diff.rgb *= vertex_color.rgb;
|
||||
#else
|
||||
float final_alpha = diff.a;
|
||||
#endif
|
||||
// <FS> Fix impostors failing to render with alpha correctly
|
||||
#ifdef FOR_IMPOSTOR
|
||||
vec4 color = vec4(diff.rgb,final_alpha);
|
||||
// </FS>
|
||||
|
||||
// Insure we don't pollute depth with invis pixels in impostor rendering
|
||||
//
|
||||
|
|
@ -545,6 +560,15 @@ void main()
|
|||
}
|
||||
#else
|
||||
|
||||
// <FS> Fix impostors failing to render with alpha correctly
|
||||
//#ifdef USE_VERTEX_COLOR
|
||||
// float final_alpha = diff.a * vertex_color.a;
|
||||
// diff.rgb *= vertex_color.rgb;
|
||||
//#else
|
||||
// float final_alpha = diff.a;
|
||||
//#endif
|
||||
// </FS>
|
||||
|
||||
vec4 gamma_diff = diff;
|
||||
diff.rgb = srgb_to_linear(diff.rgb);
|
||||
|
||||
|
|
|
|||
|
|
@ -37,12 +37,14 @@ ATTRIBUTE vec4 weight;
|
|||
VARYING vec3 vary_normal;
|
||||
VARYING vec2 vary_texcoord0;
|
||||
|
||||
// <FS> Fix avatar cloth failing to work in deferred
|
||||
uniform vec4 gWindDir;
|
||||
uniform vec4 gSinWaveParams;
|
||||
uniform vec4 gGravity;
|
||||
|
||||
const vec4 gMinMaxConstants = vec4(1.0, 0.166666, 0.0083143, .00018542); // #minimax-generated coefficients
|
||||
const vec4 gPiConstants = vec4(0.159154943, 6.28318530, 3.141592653, 1.5707963); // # {1/2PI, 2PI, PI, PI/2}
|
||||
// </FS>
|
||||
|
||||
void main()
|
||||
{
|
||||
|
|
@ -53,12 +55,19 @@ void main()
|
|||
|
||||
vec4 pos_in = vec4(position.xyz, 1.0);
|
||||
mat4 trans = getSkinnedTransform();
|
||||
// <FS> Fix avatar cloth failing to work in deferred
|
||||
//pos.x = dot(trans[0], pos_in);
|
||||
//pos.y = dot(trans[1], pos_in);
|
||||
//pos.z = dot(trans[2], pos_in);
|
||||
//pos.w = 1.0;
|
||||
// </FS>
|
||||
|
||||
norm.x = dot(trans[0].xyz, normal);
|
||||
norm.y = dot(trans[1].xyz, normal);
|
||||
norm.z = dot(trans[2].xyz, normal);
|
||||
norm = normalize(norm);
|
||||
|
||||
// <FS> Fix avatar cloth failing to work in deferred
|
||||
#if AVATAR_CLOTH
|
||||
//wind
|
||||
vec4 windEffect;
|
||||
|
|
@ -124,6 +133,7 @@ void main()
|
|||
pos.z = dot(trans[2], pos_in);
|
||||
pos.w = 1.0;
|
||||
#endif
|
||||
// </FS>
|
||||
|
||||
vary_normal = norm;
|
||||
|
||||
|
|
|
|||
|
|
@ -40,8 +40,10 @@ VARYING vec3 vary_position;
|
|||
VARYING vec4 vertex_color;
|
||||
VARYING vec2 vary_texcoord0;
|
||||
|
||||
// <FS> Fix fullbright fog failing
|
||||
vec3 fullbrightAtmosTransport(vec3 light);
|
||||
vec3 fullbrightScaleSoftClip(vec3 light);
|
||||
// </FS>
|
||||
|
||||
vec3 srgb_to_linear(vec3 cs)
|
||||
{
|
||||
|
|
@ -80,6 +82,19 @@ vec3 linear_to_srgb(vec3 cl)
|
|||
|
||||
}
|
||||
|
||||
// <FS> Fix fullbright fog failing
|
||||
//vec3 fullbrightAtmosTransportDeferred(vec3 light)
|
||||
//{
|
||||
// return light;
|
||||
//}
|
||||
|
||||
//vec3 fullbrightScaleSoftClipDeferred(vec3 light)
|
||||
//{
|
||||
// //soft clip effect:
|
||||
// return light;
|
||||
//}
|
||||
// </FS>
|
||||
|
||||
#ifdef HAS_ALPHA_MASK
|
||||
uniform float minimum_alpha;
|
||||
#endif
|
||||
|
|
@ -148,16 +163,32 @@ void main()
|
|||
#endif
|
||||
|
||||
color.rgb *= vertex_color.rgb;
|
||||
// <FS> Fix fullbright fog failing
|
||||
//color.rgb = srgb_to_linear(color.rgb);
|
||||
//color.rgb = fullbrightAtmosTransportDeferred(color.rgb);
|
||||
//color.rgb = fullbrightScaleSoftClipDeferred(color.rgb);
|
||||
|
||||
//color.rgb = linear_to_srgb(color.rgb);
|
||||
color.rgb = fullbrightAtmosTransport(color.rgb);
|
||||
color.rgb = fullbrightScaleSoftClip(color.rgb);
|
||||
// </FS>
|
||||
|
||||
#ifdef WATER_FOG
|
||||
vec3 pos = vary_position;
|
||||
// <FS> Fix fullbright fog failing
|
||||
//vec4 fogged = applyWaterFogDeferred(pos, vec4(color.rgb, final_alpha));
|
||||
//color.rgb = fogged.rgb;
|
||||
//color.a = fogged.a;
|
||||
color = applyWaterFogDeferred(pos, vec4(color.rgb, final_alpha));
|
||||
// </FS>
|
||||
#else
|
||||
color.a = final_alpha;
|
||||
#endif
|
||||
|
||||
// <FS> Fix fullbright fog failing
|
||||
//frag_color.rgb = color.rgb;
|
||||
//frag_color.a = color.a;
|
||||
frag_color = color;
|
||||
// </FS>
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -151,7 +151,10 @@ void main()
|
|||
|
||||
vec4 fb = texture2D(screenTex, distort);
|
||||
|
||||
// <FS> Fix gamma in underwater
|
||||
//frag_data[0] = vec4(linear_to_srgb(fb.rgb), 1.0); // diffuse
|
||||
frag_data[0] = vec4(fb.rgb, 1.0); // diffuse
|
||||
// </FS>
|
||||
frag_data[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec
|
||||
frag_data[2] = vec4(encode_normal(wavef), 0.0, 0.0); // normalxyz, displace
|
||||
}
|
||||
|
|
|
|||
|
|
@ -197,7 +197,10 @@ void main()
|
|||
|
||||
vec3 screenspacewavef = normalize((norm_mat*vec4(wavef, 1.0)).xyz);
|
||||
|
||||
// <FS> Fix weird water glow on edge of land due to broken alpha value
|
||||
//frag_data[0] = vec4(color.rgb, color); // diffuse
|
||||
frag_data[0] = vec4(color.rgb, color.a); // diffuse
|
||||
// </FS>
|
||||
frag_data[1] = vec4(0); // speccolor, spec
|
||||
frag_data[2] = vec4(encode_normal(screenspacewavef.xyz*0.5+0.5), 0.05, 0);// normalxy, 0, 0
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1882,7 +1882,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
|
|||
gDeferredAvatarProgram.mShaderFiles.clear();
|
||||
gDeferredAvatarProgram.mShaderFiles.push_back(make_pair("deferred/avatarV.glsl", GL_VERTEX_SHADER_ARB));
|
||||
gDeferredAvatarProgram.mShaderFiles.push_back(make_pair("deferred/avatarF.glsl", GL_FRAGMENT_SHADER_ARB));
|
||||
gDeferredAvatarProgram.addPermutation("AVATAR_CLOTH", (mVertexShaderLevel[SHADER_AVATAR] == 3) ? "1" : "0");
|
||||
gDeferredAvatarProgram.addPermutation("AVATAR_CLOTH", (mVertexShaderLevel[SHADER_AVATAR] == 3) ? "1" : "0"); // <FS> Fix avatar cloth failing to work in deferred
|
||||
gDeferredAvatarProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
|
||||
success = gDeferredAvatarProgram.createShader(NULL, NULL);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue