Change lightfunc from GL_R8 to GL_R16F/R32F

This commit is contained in:
Shyotl
2013-10-09 14:58:18 -05:00
parent f25eb07fab
commit b6bf5545c9
4 changed files with 27 additions and 10 deletions

View File

@@ -141,7 +141,7 @@ void main()
if (sa > 0.0)
{
sa = 6 * texture2D(lightFunc, vec2(sa, spec.a)).r * 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;
}

View File

@@ -123,7 +123,7 @@ void main()
float sa = dot(normalize(lv-normalize(pos)),norm);
if (sa > 0.0)
{
sa = 6 * texture2D(lightFunc, vec2(sa, spec.a)).r * 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;
}

View File

@@ -314,7 +314,7 @@ void main()
//
vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
float sa = dot(refnormpersp, sun_dir.xyz);
vec3 dumbshiny = vary_SunlitColor*(6 * texture2D(lightFunc, vec2(sa, spec.a)).r);
vec3 dumbshiny = vary_SunlitColor*(texture2D(lightFunc, vec2(sa, spec.a)).r);
// add the two types of shiny together
vec3 spec_contrib = dumbshiny * spec.rgb;