This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
csce441pine64backup/L16/resources/vert.glsl

22 lines
435 B
GLSL

#version 120
uniform mat4 P;
uniform mat4 MV;
uniform vec2 screenSize;
attribute vec4 aPos;
attribute float aAlp;
attribute vec3 aCol;
attribute float aSca;
varying vec4 vCol;
void main()
{
gl_Position = P * MV * aPos;
vCol.rgb = aCol;
vCol.a = aAlp;
// http://stackoverflow.com/questions/25780145/gl-pointsize-corresponding-to-world-space-size
gl_PointSize = screenSize.y * P[1][1] * aSca / gl_Position.w;
}