Default Shader: move shading to fragment shader, add normal map painting for debug
parent
a7ac61a791
commit
e4e07075c5
|
@ -85,10 +85,9 @@ void main()
|
||||||
float distance = length(camray);
|
float distance = length(camray);
|
||||||
float idist = 25000 / distance;
|
float idist = 25000 / distance;
|
||||||
float sight = clamp( idist * idist * idist, 0.1, 1.0);
|
float sight = clamp( idist * idist * idist, 0.1, 1.0);
|
||||||
//sight = 1;
|
|
||||||
|
|
||||||
shading = clamp(0.3 + (cosTheta * 0.7), 0.1, 0.9);
|
shading = clamp(0.3 + (cosTheta * 0.7), 0.1, 0.9) * sight;
|
||||||
color = clamp( vec4( iv_color.xyz * shading * sight, fading ), 0, 1);
|
color = clamp( vec4( iv_color.xyz, fading ), 0, 1);
|
||||||
coord = camray;
|
coord = camray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +112,8 @@ void main()
|
||||||
discard;
|
discard;
|
||||||
};
|
};
|
||||||
|
|
||||||
_color = color;
|
_color = vec4( color.xyz * shading, color.w );
|
||||||
|
//_color = vec4( (vec3( 1,1,1 ) + norm)/2 , 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
";
|
";
|
||||||
|
|
Loading…
Reference in New Issue