summaryrefslogtreecommitdiff
path: root/drivers/gles3/shaders
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-04-08 22:38:11 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-04-08 22:40:06 -0300
commit4286aef69313e048fa91710c35456c08a252fd3c (patch)
tree866ecba1e556f587aed886166afea79a47487248 /drivers/gles3/shaders
parent6075dfe511728ab3fb59915a18ca99e5b8789d8b (diff)
Particle system is complete. Rejoice!
Diffstat (limited to 'drivers/gles3/shaders')
-rw-r--r--drivers/gles3/shaders/particles.glsl17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/gles3/shaders/particles.glsl b/drivers/gles3/shaders/particles.glsl
index 347b15d639..f789be24cf 100644
--- a/drivers/gles3/shaders/particles.glsl
+++ b/drivers/gles3/shaders/particles.glsl
@@ -30,7 +30,7 @@ uniform float explosiveness;
uniform float randomness;
uniform vec4 time;
uniform float delta;
-uniform vec3 gravity;
+
uniform int attractor_count;
uniform Attractor attractors[MAX_ATTRACTORS];
uniform bool clear;
@@ -69,9 +69,19 @@ uint hash(uint x) {
void main() {
+#ifdef PARTICLES_COPY
+
+ out_color=color;
+ out_velocity_active=velocity_active;
+ out_custom = custom;
+ out_xform_1 = xform_1;
+ out_xform_2 = xform_2;
+ out_xform_3 = xform_3;
+
+#else
+
bool apply_forces=true;
bool apply_velocity=true;
- vec3 current_gravity = gravity;
float local_delta=delta;
float mass = 1.0;
@@ -164,7 +174,7 @@ VERTEX_SHADER_CODE
if (true) {
- vec3 force = current_gravity;
+ vec3 force = vec3(0.0);
for(int i=0;i<attractor_count;i++) {
vec3 rel_vec = xform[3].xyz - attractors[i].pos;
@@ -211,6 +221,7 @@ VERTEX_SHADER_CODE
out_xform_2 = xform[1];
out_xform_3 = xform[2];
+#endif //PARTICLES_COPY
}