gpt4 book ai didi

ios - gl_PointSize OpenGLES 说明

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:21:48 26 4
gpt4 key购买 nike

在顶点着色器中设置 gl_PointSize = 1.0 意味着什么或达到什么目的?这是否意味着顶点本身就是一个像素?

最佳答案

What does setting gl_PointSize = 1.0 in vertex shader means or achieve? Does that mean the vertex itself is a pixel?

是的,确实如此。


参见 gl_PointSize :

The variable gl_PointSize is intended for a vertex shader to write the size of the point to be rasterized. It is measured in pixels.

参见 OpenGL ES Specification - Khronos OpenGL ES Registry, 3.3 Points, page 51 :

Point size is taken from the shader builtin gl_PointSize and clamped to the implementation-dependent point size range. If the value written to gl_PointSize is less than or equal to zero, results are undefined. The range is determined by the ALIASED_POINT_SIZE_RANGE and may be queried as described in chapter 6. The maximum point size supported must be at least one.
Point rasterization produces a fragment for each framebuffer pixel whose center lies inside a square centered at the point’s (xw, yw ), with side length equal to the point size.


这意味着,如果您定义 gl_PointSize = 1.0,则这指定了一个边长为 1 片段的正方形。中心点在这个正方形中的片段受到影响。

与“桌面”OpenGL 相比,在程序中不必启用点大小。 (在桌面 OpenGL 中,gl_PointSize 仅在启用 GL_PROGRAM_POINT_SIZE 时才有意义)。

关于ios - gl_PointSize OpenGLES 说明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48564662/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com