From 2a959e17ab6a8fd0263708ad14170c4c8d65ab35 Mon Sep 17 00:00:00 2001 From: Kirill Vainer Date: Fri, 19 Feb 2016 14:20:25 -0500 Subject: [PATCH] particle: fix fading not working correctly --- .../src/main/resources/Common/MatDefs/Misc/Particle.vert | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jme3-core/src/main/resources/Common/MatDefs/Misc/Particle.vert b/jme3-core/src/main/resources/Common/MatDefs/Misc/Particle.vert index 9c2733615..878c8e6da 100644 --- a/jme3-core/src/main/resources/Common/MatDefs/Misc/Particle.vert +++ b/jme3-core/src/main/resources/Common/MatDefs/Misc/Particle.vert @@ -32,11 +32,12 @@ void main(){ #ifdef POINT_SPRITE vec4 worldPos = g_WorldMatrix * pos; float d = distance(g_CameraPosition.xyz, worldPos.xyz); - gl_PointSize = max(1.0, (inSize * SIZE_MULTIPLIER * m_Quadratic) / d); + float size = (inSize * SIZE_MULTIPLIER * m_Quadratic) / d); + gl_PointSize = max(1.0, size); //vec4 worldViewPos = g_WorldViewMatrix * pos; //gl_PointSize = (inSize * SIZE_MULTIPLIER * m_Quadratic)*100.0 / worldViewPos.z; - color.a *= min(gl_PointSize, 1.0); + color.a *= min(size, 1.0); #endif -} \ No newline at end of file +}