问题描述
- openscenegraph 3 cookbookz这本书的第八章的云的例子,懂得进来看看
-
const char* vertCode = { "uniform sampler2D defaultTex;n" "uniform int width;n" "uniform int height;n" "varying float brightness;n" "void main()n" "{n" " float row = float(gl_InstanceID) / float(width);n" " vec2 uv = vec2(fract(row), floor(row) / float(height));n" " vec4 texValue = texture2D(defaultTex, uv);n" // Read and specify the position data from texture " vec4 pos = gl_Vertex + vec4(texValue.xyz, 1.0);n" // Use alpha of the texel as the brightness value " brightness = texValue.a;n" " gl_Position = gl_ModelViewProjectionMatrix * pos;n" "}n" };
什么意思???
时间: 2024-12-21 14:00:56