问题
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:
- 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
- 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
来源:https://stackoverflow.com/questions/45858370/qt3d-default-uniform-and-attributes