particle: fix fading not working correctly
This commit is contained in:
parent
947c576ca8
commit
2a959e17ab
@ -32,11 +32,12 @@ void main(){
|
|||||||
#ifdef POINT_SPRITE
|
#ifdef POINT_SPRITE
|
||||||
vec4 worldPos = g_WorldMatrix * pos;
|
vec4 worldPos = g_WorldMatrix * pos;
|
||||||
float d = distance(g_CameraPosition.xyz, worldPos.xyz);
|
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;
|
//vec4 worldViewPos = g_WorldViewMatrix * pos;
|
||||||
//gl_PointSize = (inSize * SIZE_MULTIPLIER * m_Quadratic)*100.0 / worldViewPos.z;
|
//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
|
#endif
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user