Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用除数“重复” GLSL 属性?例如,我有一个立方体(用于实例渲染),我想为 6 个面(12 个三角形)中的每一个设置法线。如果我将属性除数设置为 2,并且我有 4 个实例,它只会在数组中提供的 2 之后停止采用法线!
实例化不是强制 OpenGL 允许您使用任意属性索引渲染网格的方法。您只能通过实例化渲染重复属性,并且只会重复每个不可分割的属性。
如果要给每个面法线,则该面内的每个顶点必须具有相同的法线,重复。