You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
432 B
Forth
10 lines
432 B
Forth
#include "sh_Flashlight.h"
|
|
|
|
// highp precision is necessary for vertex positions to prevent catastrophic failure on GL_ES platforms
|
|
lowp vec4 getColourAt(highp vec2 diff, highp vec2 size, lowp vec4 originalColour)
|
|
{
|
|
highp float dist = length(diff);
|
|
highp float flashlightRadius = length(size);
|
|
|
|
return originalColour * vec4(1.0, 1.0, 1.0, smoothstep(flashlightRadius, flashlightRadius * smoothness, dist));
|
|
} |