[英]Why is GL_ALIASED_POINT_SIZE different between WebGL and Cocoa?
My WebGL's ALIASED_POINT_SIZE
(in Safari and Chrome) is 33901. 我的WebGL的ALIASED_POINT_SIZE
(在Safari和Chrome中)为33901。
On the other hand, in my native OpenGL (on Mac/Cocoa), it is just (1,64). 另一方面,在我的本机OpenGL(在Mac / Cocoa上)中,它仅为(1,64)。
Why are the two values different? 为什么两个值不同? And is there no way to increase gl_PointSize
? 并且没有办法增加gl_PointSize
吗?
You are looking at two different values: 您正在查看两个不同的值:
GL_ALIASED_POINT_SIZE_RANGE
, which is an enum value used to query the point size range. 33901(或十六进制的0x846d)是GL_ALIASED_POINT_SIZE_RANGE
的值,该值是用于查询点大小范围的枚举值 。 In native OpenGL, you would query the point size range with: 在本机OpenGL中,您可以使用以下方法查询点的大小范围:
GLint range[2];
glGetIntegerv(GL_ALIASED_POINT_SIZE_RANGE, range);
I haven't used WebGL, but based on the documentation the corresponding call there should be: 我没有使用过WebGL,但是根据文档,相应的调用应该是:
gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE)
gl_PointSize
is a global you set in your vertex shader to set the size of the next point to be rasterized. gl_PointSize
是您在顶点着色器中设置的全局gl_PointSize
,用于设置要栅格化的下一个点的大小。 You can set it anyway you please, from a constant (all points will be the same size), from a uniform (all points will be the same size that you can set at runtime), from an attribute (every point will be a different size depending on the per point data you supply), from some equation, etc (every point will be a different size depending on your equation). 您可以通过常量(所有点的大小相同),统一(所有点的大小与运行时可以设置的大小相同),属性(每个点都不同)进行设置大小取决于您提供的每点数据),某些方程式等(每个点的大小取决于方程式)。
ALIASED_POINT_SIZE_RANGE
is a constant value you pass to glGetIntegerv
in OpenGL and gl.getParameter
in WebGL that returns the range of point sizes your GPU/Driver supports. ALIASED_POINT_SIZE_RANGE
是一个常量值,您可以glGetIntegerv
常量传递给OpenGL中的gl.getParameter
和WebGL中的gl.getParameter
,它们返回GPU /驱动程序支持的点大小范围。
Note that WebGL and OpenGL ES 2.0 only require a max point size of 1.0. 请注意,WebGL和OpenGL ES 2.0仅需要最大点大小为1.0。 That means if you count on points be able to render larger than 1 pixel you'll need to find some other solution on certain hardware. 这意味着,如果您指望能够渲染大于1像素的点,则需要在某些硬件上找到其他解决方案。 You can see the supported sizes near the bottom of this page . 您可以在此页面底部附近看到支持的尺寸 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.