我有以下形式的制服:

uniform float abc;


我在Haskell代码中得到它为:

abc <- GL.get (GL.uniformLocation program "abc")


如何传递GLfloat值?

我从here看到我可能应该使用uniform1,但是该功能未由模块导出。

其他所有实例:

instance UniformComponent a => Uniform (Vertex2 a)
instance UniformComponent a => Uniform (Vertex3 a)
instance UniformComponent a => Uniform (Vertex4 a)
instance UniformComponent a => Uniform (TexCoord1 a)
instance UniformComponent a => Uniform (TexCoord2 a)
instance UniformComponent a => Uniform (TexCoord3 a)
instance UniformComponent a => Uniform (TexCoord4 a)
instance UniformComponent a => Uniform (Normal3 a)
instance UniformComponent a => Uniform (FogCoord1 a)
instance UniformComponent a => Uniform (Color3 a)
instance UniformComponent a => Uniform (Color4 a)
instance UniformComponent a => Uniform (Index1 a)


似乎没有涵盖这个简单的案例。

我能做什么?

最佳答案

显然在API中是it's a known bug

现在可能的替代方法是使用Index1重载,该重载应该是颜色索引,但是对于简单的float可以很好地工作。

10-08 12:41