danini-the-panini/mittsu-opengl

View on GitHub
lib/mittsu/opengl/shader/lib/particle_basic/particle_basic_vertex.rbsl

Summary

Maintainability
Test Coverage
uniform float size;
// uniform float scale; // TODO

#include common
#include color_pars_vertex
#include shadowmap_pars_vertex
#include logdepthbuf_pars_vertex

void main() {
  #include color_vertex

  vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);

  // #ifdef USE_SIZEATTENUATION
    // gl_PointSize = size * (scale / length(mvPosition.xyz));
  // #else
    gl_PointSize = size;
  // #endif

  gl_Position = projectionMatrix * mvPosition;

  #include logdepthbuf_vertex
  #include worldpos_vertex
  #include shadowmap_vertex
}