fix handheld lights

This commit is contained in:
Xonk
2025-03-10 14:55:40 -04:00
parent f19a1f13d8
commit e41969436f

View File

@ -366,7 +366,7 @@ void main() {
// if(HELD_ITEM_BRIGHTNESS > 0.0) torchlightmap = max(torchlightmap, HELD_ITEM_BRIGHTNESS * clamp( pow(max(1.0-length(worldpos-playerCamPos)/HANDHELD_LIGHT_RANGE,0.0),1.5),0.0,1.0)); // if(HELD_ITEM_BRIGHTNESS > 0.0) torchlightmap = max(torchlightmap, HELD_ITEM_BRIGHTNESS * clamp( pow(max(1.0-length(worldpos-playerCamPos)/HANDHELD_LIGHT_RANGE,0.0),1.5),0.0,1.0));
if(HELD_ITEM_BRIGHTNESS > 0.0){ if(HELD_ITEM_BRIGHTNESS > 0.0){
float pointLight = 1-clamp(1.0-length(worldpos-playerCamPos)/HANDHELD_LIGHT_RANGE,-0.999,1.0); float pointLight = clamp(1.0-(length(worldpos-playerCamPos)-1)/HANDHELD_LIGHT_RANGE,0.0,1.0);
torchlightmap = mix(torchlightmap, HELD_ITEM_BRIGHTNESS, pointLight); torchlightmap = mix(torchlightmap, HELD_ITEM_BRIGHTNESS, pointLight);
} }