Add cutoff to flashlight
This commit is contained in:
parent
10b59a39be
commit
d1dd360d83
2 changed files with 14 additions and 2 deletions
|
|
@ -59,6 +59,7 @@ float shadowTransparency(float startingDistance, float lightCenterDistance, vec2
|
|||
uniform float flashlightIntensities[FLASHLIGHT_COUNT];
|
||||
uniform vec3 flashlightColors[FLASHLIGHT_COUNT];
|
||||
uniform vec2 flashlightDirections[FLASHLIGHT_COUNT];
|
||||
uniform float flashlightStartCutoffs[FLASHLIGHT_COUNT];
|
||||
|
||||
in vec2 flashlightActualDirections[FLASHLIGHT_COUNT];
|
||||
|
||||
|
|
@ -114,8 +115,16 @@ void main() {
|
|||
vec2 originalDirection = normalize(flashlightActualDirections[i]);
|
||||
|
||||
float lightCenterDistance;
|
||||
vec3 lightColorAtPosition = colorInPosition(i, originalDirection, lightCenterDistance);
|
||||
vec3 lightColorAtPosition = colorInPosition(
|
||||
i,
|
||||
originalDirection,
|
||||
lightCenterDistance
|
||||
);
|
||||
|
||||
if (lightCenterDistance < flashlightStartCutoffs[i]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
vec2 direction = originalDirection / squareToAspectRatioTimes2;
|
||||
|
||||
if (length(lightColorAtPosition) < 0.0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue