diff options
Diffstat (limited to 'indra/newview/app_settings/shaders')
4 files changed, 29 insertions, 10 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl index e0e97bb938..f6870c3ff0 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsF.glsl @@ -110,7 +110,7 @@ void main()      // Combine      vec3 color;      color = (cloudColorSun*(1.-alpha2) + cloudColorAmbient); -    color.rgb= max(vec3(0), color.rgb); +    color.rgb = clamp(color.rgb, vec3(0), vec3(1));      color.rgb *= 2.0;      /// Gamma correct for WL (soft clip effect). diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl index cc4c3b5dce..9d9ba49d82 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl @@ -84,6 +84,7 @@ void main()      color.rgb += rainbow(optic_d);      color.rgb += halo_22;      color.rgb *= 2.; +    color.rgb = clamp(color.rgb, vec3(0), vec3(5));      frag_data[0] = vec4(0);      frag_data[1] = vec4(0); diff --git a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl index b474a5803f..f51b0f4d9e 100644 --- a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl @@ -25,7 +25,6 @@  uniform mat3 normal_matrix;  uniform mat4 texture_matrix0; -uniform mat4 modelview_matrix;  uniform mat4 modelview_projection_matrix;  in vec3 position; @@ -54,14 +53,27 @@ float calcDirectionalLight(vec3 n, vec3 l)  //==================================================================================================== +#ifdef HAS_SKIN +mat4 getObjectSkinnedTransform(); +uniform mat4 modelview_matrix; +uniform mat4 projection_matrix; +#endif +  void main()  { -	//transform vertex -	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0)); -	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); +    vec3 norm; +#ifdef HAS_SKIN +    mat4 mat = getObjectSkinnedTransform(); +    mat = modelview_matrix * mat; +    vec4 pos = mat * vec4(position.xyz, 1.0); +    gl_Position = projection_matrix * pos; +    norm = normalize((mat*vec4(normal.xyz+position.xyz,1.0)).xyz-pos.xyz); +#else +	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);  +    norm = normalize(normal_matrix * normal); +#endif +  	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; -	 -	vec3 norm = normalize(normal_matrix * normal);  	vec4 col = vec4(0,0,0,1); diff --git a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl index 1b2a34ef01..41821def8e 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl @@ -364,7 +364,8 @@ return texCUBE(envMap, ReflDirectionWS);  // dir - ray direction in clip space  // i - probe index in refBox/refSphere  // d - distance to nearest wall in clip space -vec3 boxIntersect(vec3 origin, vec3 dir, int i, out float d) +// scale - scale of box, default 1.0 +vec3 boxIntersect(vec3 origin, vec3 dir, int i, out float d, float scale)  {      // Intersection with OBB convert to unit box space      // Transform in local unit parallax cube space (scaled and rotated) @@ -375,7 +376,7 @@ vec3 boxIntersect(vec3 origin, vec3 dir, int i, out float d)      d = 1.0-max(max(abs(PositionLS.x), abs(PositionLS.y)), abs(PositionLS.z)); -    vec3 Unitary = vec3(1.0f, 1.0f, 1.0f); +    vec3 Unitary = vec3(scale);      vec3 FirstPlaneIntersect  = (Unitary - PositionLS) / RayLS;      vec3 SecondPlaneIntersect = (-Unitary - PositionLS) / RayLS;      vec3 FurthestPlane = max(FirstPlaneIntersect, SecondPlaneIntersect); @@ -387,6 +388,11 @@ vec3 boxIntersect(vec3 origin, vec3 dir, int i, out float d)      return IntersectPositionCS;  } +vec3 boxIntersect(vec3 origin, vec3 dir, int i, out float d) +{ +    return boxIntersect(origin, dir, i, d, 1.0); +} +  void debugBoxCol(vec3 ro, vec3 rd, float t, vec3 p, inout vec4 col)  {      vec3 v = ro + rd * t; @@ -531,7 +537,7 @@ vec3 tapIrradianceMap(vec3 pos, vec3 dir, out float w, out float dw, vec3 c, int      if (refIndex[i].w < 0)      {          float d = 0.0; -        v = boxIntersect(pos, dir, i, d); +        v = boxIntersect(pos, dir, i, d, 3.0);          w = max(d, 0.001);      }      else  | 
