Explicitly define precision for all variables, fall back to medium precision
parent
d58ad077c8
commit
96286f8c6f
@ -1,10 +1,10 @@
|
|||||||
#include "sh_Flashlight.h"
|
#include "sh_Flashlight.h"
|
||||||
|
|
||||||
// highp precision is necessary for vertex positions to prevent catastrophic failure on GL_ES platforms
|
// highp precision is necessary for vertex positions to prevent catastrophic failure on GL_ES platforms
|
||||||
vec4 getColourAt(highp vec2 diff, highp vec2 size, lowp vec4 originalColour)
|
lowp vec4 getColourAt(highp vec2 diff, highp vec2 size, lowp vec4 originalColour)
|
||||||
{
|
{
|
||||||
float dist = length(diff);
|
highp float dist = length(diff);
|
||||||
float flashlightRadius = length(size);
|
highp float flashlightRadius = length(size);
|
||||||
|
|
||||||
return originalColour * vec4(1.0, 1.0, 1.0, smoothstep(flashlightRadius, flashlightRadius * smoothness, dist));
|
return originalColour * vec4(1.0, 1.0, 1.0, smoothstep(flashlightRadius, flashlightRadius * smoothness, dist));
|
||||||
}
|
}
|
Loading…
Reference in New Issue