summaryrefslogtreecommitdiff
path: root/drivers/gles3
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-04-18 00:01:08 +0200
committerGitHub <noreply@github.com>2017-04-18 00:01:08 +0200
commit24b2186ff94f04ccf64050a0382f2b8b5aaf4b2f (patch)
tree9809e31dfc903640ccc73f0509cd6bf7fbfffd1c /drivers/gles3
parentdd55950b62a6b431fca1cb7438ff64ca2c77dbd7 (diff)
parent5404e108037829e5b49c79e2bca4dc9b902c2259 (diff)
Merge pull request #8388 from Dobbias/fix_#8381
Fix gles3-particles shader not compiling
Diffstat (limited to 'drivers/gles3')
-rw-r--r--drivers/gles3/shaders/particles.glsl12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gles3/shaders/particles.glsl b/drivers/gles3/shaders/particles.glsl
index f789be24cf..fa12dd7408 100644
--- a/drivers/gles3/shaders/particles.glsl
+++ b/drivers/gles3/shaders/particles.glsl
@@ -101,7 +101,7 @@ void main() {
restart_phase*= (1.0-explosiveness);
bool restart=false;
- bool active = velocity_active.a > 0.5;
+ bool shader_active = velocity_active.a > 0.5;
if (system_phase > prev_system_phase) {
if (prev_system_phase < restart_phase && system_phase >= restart_phase) {
@@ -134,7 +134,7 @@ void main() {
uint particle_number = current_cycle * uint(total_particles) + uint(gl_VertexID);
if (restart) {
- active=emitting;
+ shader_active=emitting;
}
mat4 xform;
@@ -148,7 +148,7 @@ void main() {
out_velocity_active=vec4(0.0);
out_custom=vec4(0.0);
if (!restart)
- active=false;
+ shader_active=false;
xform = mat4(
vec4(1.0,0.0,0.0,0.0),
@@ -163,7 +163,7 @@ void main() {
xform = transpose(mat4(xform_1,xform_2,xform_3,vec4(vec3(0.0),1.0)));
}
- if (active) {
+ if (shader_active) {
//execute shader
{
@@ -178,7 +178,7 @@ VERTEX_SHADER_CODE
for(int i=0;i<attractor_count;i++) {
vec3 rel_vec = xform[3].xyz - attractors[i].pos;
- float dist = rel_vec.length();
+ float dist = length(rel_vec);
if (attractors[i].radius < dist)
continue;
if (attractors[i].eat_radius>0 && attractors[i].eat_radius > dist) {
@@ -215,7 +215,7 @@ VERTEX_SHADER_CODE
xform = transpose(xform);
- out_velocity_active.a = mix(0.0,1.0,active);
+ out_velocity_active.a = mix(0.0,1.0,shader_active);
out_xform_1 = xform[0];
out_xform_2 = xform[1];