分页: 1 / 1

在Vertex Shader顶点着色器中设置 gl_PointSize 无效的解决方法

发表于 : 2017年07月07日 18:55
523066680
How can I vary the point size in OpenGL glBegin(GL_POINTS)?

tibur:
You can use point sprite: enable it using glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); and then you can use gl_PointSize attribute in your vertex program.

Vertex shader example taken from an OpenGL discussion thread:
void main() { gl_FrontColor=gl_Color; gl_PointSize = gl_Normal.x; gl_Position = ftransform(); }
参考:
Point_primitives
Vertex_Shader