From 410b503aace744ba1ea5b1f7a67d0d8600258481 Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Mon, 20 Mar 2023 20:40:13 -0400 Subject: Translate inactive particles to -INF (cherry picked from commit 6229c2a1f99135b841ce43f2728b4ac35a9b1938) --- servers/rendering/renderer_rd/shaders/particles_copy.glsl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'servers') 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 -- cgit v1.2.3