Qt3D default uniform and attributes

2019-06-24 06:46发布

问题:

I began to learn using shaders with QML, and I can't find any references that talk about default uniform and attribute values that are passed to the shaders. In certain examples, we can saw several of them like vertexPosition or modelViewProjection (that is also passed as mvp), but there is no clear list containing all the variables that we can use.

After investigating in Qt source code, I found out default name for many variables:

  1. uniform variables (found in renderview.cpp)
    • modelMatrix
    • viewMatrix
    • projectionMatrix
    • modelView
    • viewProjectionMatrix
    • modelViewProjection
    • mvp
    • inverseModelMatrix
    • inverseViewMatrix
    • inverseProjectionMatrix
    • inverseModelView
    • inverseViewProjectionMatrix
    • inverseModelViewProjection
    • modelNormalMatrix
    • modelViewNormal
    • viewportMatrix
    • inverseViewportMatrix
    • exposure
    • gamma
    • time
    • eyePosition
  2. attributes (found in qattribute.cpp)
    • vertexPosition
    • vertexNormal
    • vertexColor
    • vertexTexCoord
    • vertexTangent

Is that all? These variables are largely sufficient to develop most oh the shaders I am doing right now, but I just want to know if I miss something.

回答1:

to confirm part of what @aRaMinet said source Qt Documentation



标签: c++ qt qml shader