Commit 315c3930 authored by Rye Mutt's avatar Rye Mutt 🍞
Browse files

Smol cleanup

parent 618ad3fb
......@@ -122,27 +122,27 @@ void main()
{
spec.rgb = linear_to_srgb(spec.rgb);
#if 0 //EEP
vec3 npos = -normalize(pos.xyz);
//vec3 ref = dot(pos+lv, norm);
vec3 h = normalize(light_dir.xyz+npos);
float nh = dot(norm.xyz, h);
float nv = dot(norm.xyz, npos);
float vh = dot(npos, h);
float sa = nh;
float fres = pow(1 - dot(h, npos), 5)*0.4+0.5;
float gtdenom = 2 * nh;
float gt = max(0, min(gtdenom * nv / vh, gtdenom * da / vh));
vec3 npos = -normalize(pos.xyz);
//vec3 ref = dot(pos+lv, norm);
vec3 h = normalize(light_dir.xyz+npos);
float nh = dot(norm.xyz, h);
float nv = dot(norm.xyz, npos);
float vh = dot(npos, h);
float sa = nh;
float fres = pow(1 - dot(h, npos), 5)*0.4+0.5;
float gtdenom = 2 * nh;
float gt = max(0, min(gtdenom * nv / vh, gtdenom * da / vh));
if (nh > 0.0)
{
float scontrib = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da);
vec3 sp = sun_contrib*scontrib / 6.0;
sp = clamp(sp, vec3(0), vec3(1));
bloom += dot(sp, sp) / 4.0;
color += sp * spec.rgb;
}
if (nh > 0.0)
{
float scontrib = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da);
vec3 sp = sun_contrib*scontrib / 6.0;
sp = clamp(sp, vec3(0), vec3(1));
bloom += dot(sp, sp) / 4.0;
color += sp * spec.rgb;
}
#else //PRODUCTION
float sa = dot(refnormpersp, light_dir.xyz);
vec3 dumbshiny = sunlit * scol * (texture2D(lightFunc, vec2(sa, spec.a)).r);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment