questions about shading and input parameters
tigrazone opened this issue · 6 comments
Hello!
I have some questions.
- I read source code of pbr_khr.frag and I see
layout (location = 0) in vec3 inWorldPos;
layout (location = 1) in vec3 inNormal;
layout (location = 2) in vec2 inUV0;
layout (location = 3) in vec2 inUV1;
can you describe what about this parameters? - How to get in shader which triangle id in pixel coordinate?
- Is refraction is not supported?
- file pbr.vert
layout (location = 4) in vec4 inJoint0;
layout (location = 5) in vec4 inWeight0;
layout (set = 2, binding = 0) uniform UBONode {
mat4 matrix;
mat4 jointMatrix[MAX_NUM_JOINTS];
float jointCount;
} node;
What is inJoint0, inWeight0, jointMatrix, jointCount?
Thank you
Dmitry
For 1:
- inWorldPos = World Position of the vertex
- inNormal = Local normal of the vertex
- inUV0 = First set of texture coordinates
- inUV1 = Second set of texture coordinates (gltf supports two different texture coordinate sets)
For 2:
Please elaborate. What do you want to achieve? Do you want to read the id's of the scene's triangle from the fragment shader? If so you'd need to render them out to e.g. an additional attachment.
For 3:
Afaik that's an gltf extension and is currently not implemented.
For 4:
Those attributes are used for vertex skinning. If you need additional information, please look up vertex skinning/joints/weights in the glTF 2.0 spec.
4 what you mean about "skinning"? And joints and weights? For what you use it?
2 is gbuffer - triangle id
4 what you mean about "skinning"? And joints and weights? For what you use it?
Vertex skinning is a technique used to animate objects. It's a common graphics term,
2 is gbuffer - triangle id
That's not implemented. You need to supply an additional attachment that you write triangle id's to in the g-buffer pass.
Thank you. Your project and work on it are awesome!