mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 20:41:49 +00:00
improve torchlight
This commit is contained in:
parent
931f0180ef
commit
559322f70a
3 changed files with 4 additions and 4 deletions
|
|
@ -7,8 +7,8 @@ uniform float u_weatherFogOpacity;
|
|||
uniform float u_weatherFogDencity;
|
||||
uniform float u_weatherFogCurve;
|
||||
|
||||
float calc_torch_light(vec3 modelpos) {
|
||||
return max(0.0, 1.0 - distance(u_cameraPos, modelpos.xyz) / u_torchlightDistance);
|
||||
float calc_torch_light(vec3 normal, vec3 modelpos) {
|
||||
return max(0.0, 1.0 - distance(u_cameraPos, modelpos) / u_torchlightDistance) * -dot(normal, normalize(modelpos - u_cameraPos));
|
||||
}
|
||||
|
||||
vec3 calc_screen_normal(vec3 normal) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue