fresnel
This commit is contained in:
14
shader.glsl
14
shader.glsl
@ -200,6 +200,9 @@ vec2 map(vec3 p, int displace)
|
||||
if( d == prismTop && u_time > rotateDelay + .2) mat = 5.;
|
||||
}
|
||||
}
|
||||
d2 =sdSphere(p-vec3(0.,0.,0.), 1.0);
|
||||
d=min(d, d2);
|
||||
if (d == d2) mat = 5.;
|
||||
|
||||
//Rotating glyphs
|
||||
vec3 p2 = ringAnim(p), q2=p2;
|
||||
@ -424,7 +427,16 @@ vec3 sceneGate(vec2 uv)
|
||||
if(mat==4.)
|
||||
col *= vec3(0.0, 0.08, 0.11) + addSpecular(n,rd,0.3,0.7);
|
||||
if(mat ==5.)
|
||||
col *= chevronColor; // activated glyph color
|
||||
{
|
||||
float exponent = 2.; // lower number makes lighting go deeper into sphere
|
||||
float fresnel = pow(clamp(1.-dot(n, -rd), 0., 1.), exponent)*0.8;
|
||||
vec3 rimColor = chevronColor;
|
||||
|
||||
vec3 sphereColor = chevronColor + fresnel * rimColor;
|
||||
col = sphereColor; // activated glyph color
|
||||
|
||||
}
|
||||
|
||||
if(mat == 6.) {
|
||||
col *= vec3(0.01, 0.04, 0.06) + addSpecular(n,rd,.1, 2.5);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user