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"
};

什么意思???

osg
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问