Change lightfunc from GL_R8 to GL_R16F/R32F
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user