Browse Source

Fix particle trail glitch

floppyhammer 3 years ago
parent
commit
1675c5375e
1 changed files with 7 additions and 1 deletions
  1. 7 1
      servers/rendering/renderer_rd/shaders/particles_copy.glsl

+ 7 - 1
servers/rendering/renderer_rd/shaders/particles_copy.glsl

@@ -209,7 +209,13 @@ void main() {
 
 		txform = transpose(txform);
 	} else {
-		txform = mat4(vec4(0.0), vec4(0.0), vec4(0.0), vec4(0.0)); //zero scale, becomes invisible
+		// Even being inactive, its position still needs to preserved as it might be used by trails.
+		txform = particles.data[particle].xform;
+
+		// Set scale zero to make it invisible.
+		txform[0].xyz = vec3(0);
+
+		txform = transpose(txform);
 	}
 
 	if (params.copy_mode_2d) {