summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_rd
diff options
context:
space:
mode:
authorErik Johnson <ecmjohnson@hotmail.com>2023-03-20 20:40:13 -0400
committerYuri Sizov <yuris@humnom.net>2023-04-24 16:28:30 +0200
commit410b503aace744ba1ea5b1f7a67d0d8600258481 (patch)
tree2f28bad499fba4e21920e517efc67b3455d1a8bf /servers/rendering/renderer_rd
parent3445fa7dbcddff1aabb73e0ee156d97227dbe41b (diff)
Translate inactive particles to -INF
(cherry picked from commit 6229c2a1f99135b841ce43f2728b4ac35a9b1938)
Diffstat (limited to 'servers/rendering/renderer_rd')
-rw-r--r--servers/rendering/renderer_rd/shaders/particles_copy.glsl7
1 files changed, 4 insertions, 3 deletions
diff --git a/servers/rendering/renderer_rd/shaders/particles_copy.glsl b/servers/rendering/renderer_rd/shaders/particles_copy.glsl
index afbd5a9caa..67a894b86f 100644
--- a/servers/rendering/renderer_rd/shaders/particles_copy.glsl
+++ b/servers/rendering/renderer_rd/shaders/particles_copy.glsl
@@ -206,11 +206,12 @@ void main() {
// as they will be drawn with the node position as origin.
txform = params.inv_emission_transform * txform;
}
-
- txform = transpose(txform);
} else {
- txform = mat4(vec4(0.0), vec4(0.0), vec4(0.0), vec4(0.0)); //zero scale, becomes invisible
+ // Set scale to zero and translate to -INF so particle will be invisible
+ // even for materials that ignore rotation/scale (i.e. billboards).
+ txform = mat4(vec4(0.0), vec4(0.0), vec4(0.0), vec4(-1.0 / 0.0, -1.0 / 0.0, -1.0 / 0.0, 0.0));
}
+ txform = transpose(txform);
if (params.copy_mode_2d) {
uint write_offset = gl_GlobalInvocationID.x * (2 + 1 + 1); //xform + color + custom