bgfx/examples/24-nbody/fs_particle.sc

17 lines
440 B
Python
Raw Normal View History

2014-12-20 08:09:58 +03:00
$input v_texCoord
/*
* Copyright 2014 Stanlo Slasinski. All rights reserved.
2022-01-15 22:59:06 +03:00
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
2014-12-20 08:09:58 +03:00
*/
#include "../common/common.sh"
#include "uniforms.sh"
void main()
{
vec3 color = mix(vec3(0.1f, 0.8f, 0.2f), 0.5 * vec3(0.3, 0.25, 0.05), v_texCoord.z);
float f = u_particleIntensity * pow(max(1.0 - length(v_texCoord.xy), 0.0), u_particlePower);
gl_FragColor = vec4(color * f, 1.0);
}