more interesseting sss

This commit is contained in:
Julian
2020-01-31 14:43:29 +01:00
parent 1f8e050bb5
commit 0fa7230d07

View File

@@ -150,11 +150,10 @@
vec3 sssSun = vec3(0.,-5.,-7.0);
vec3 tosssSunVec = normalize(sssSun - v_fragPos);
vec3 tosssSun = normalize(vec3(0.0,-100.,1.));
float ssDistortion = 1.;
float sssIntensity = .2;
float ssDistortion = 0.1;
float sssIntensity = 1.;
vec3 halfWay = normalize(tosssSun+norm*ssDistortion);
float ssScateringCoef = pow(clamp(dot(toCameraVector,-halfWay),0.0,1.0),5.) * sssIntensity;
//Sun glittering
float glitterFactor = max(0.0,dot(tosssSunVec,reflect(-toCameraVector,norm)));
if(!(glitterFactor > 0.98)) {