UNPKG

@polygonjs/polygonjs

Version:

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

2 lines (1 loc) 741 B
export default "\nuniform float size;\nuniform float scale;\n#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <clipping_planes_pars_vertex>\nvarying float vViewZDepth;\n\n// INSERT DEFINES\n\n\n// vHighPrecisionZW is added to match CustomMeshDepth.frag\n// which is itself taken from threejs\nvarying vec2 vHighPrecisionZW;\n\nvoid main() {\n\n // INSERT BODY\n\n\n #include <project_vertex>\n #include <worldpos_vertex>\n #include <clipping_planes_vertex>\n\n #ifdef USE_SIZEATTENUATION\n bool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n #endif\n vWorldPosition = worldPosition.xyz;\n\n vHighPrecisionZW = gl_Position.zw;\n}\n";