UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

2 lines (1 loc) 416 B
export default "\nuniform float size;\nuniform float scale;\n#include <common>\n\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n\nvoid main() {\n\n // INSERT BODY\n\n\n #include <project_vertex>\n\n vViewZDepth = - mvPosition.z;\n #ifdef USE_SIZEATTENUATION\n bool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n #endif\n\n}\n";