Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- attribute vec3 position;
- uniform mat4 modelViewMatrix;
- uniform mat4 modelMatrix;
- uniform mat4 projectionMatrix;
- uniform float scale;
- uniform float size;
- uniform float aspect;
- varying vec2 vUv;
- void main() {
- vec2 scale = vec2(
- length(modelViewMatrix[0]) / aspect,
- length(modelViewMatrix[1])
- );
- vec4 billboard = (modelViewMatrix * vec4(vec3(0.0), 1.0));
- vec4 newPosition = projectionMatrix
- * billboard
- + vec4(scale * position.xy, 0.0, 0.0);
- gl_Position = newPosition;
- vUv = vec2(position.x + 0.5, position.y + 0.5);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement