Using local Gltf structure
This commit is contained in:
parent
c9428a281e
commit
1abee6e84c
5 changed files with 29 additions and 40 deletions
|
|
@ -23,7 +23,7 @@ layout(set = 1, binding = B_VERTICES) readonly buffer _VertexBuf {float vertices
|
|||
layout(set = 1, binding = B_INDICES) readonly buffer _Indices {uint indices[];};
|
||||
layout(set = 1, binding = B_NORMALS) readonly buffer _NormalBuf {float normals[];};
|
||||
layout(set = 1, binding = B_TEXCOORDS) readonly buffer _TexCoordBuf {float texcoord0[];};
|
||||
layout(set = 1, binding = B_MATERIALS) readonly buffer _MaterialBuffer {GltfMaterial materials[];};
|
||||
layout(set = 1, binding = B_MATERIALS) readonly buffer _MaterialBuffer {GltfShadeMaterial materials[];};
|
||||
layout(set = 1, binding = B_TEXTURES) uniform sampler2D texturesMap[]; // all textures
|
||||
|
||||
|
||||
|
|
@ -107,8 +107,8 @@ void main()
|
|||
|
||||
// https://en.wikipedia.org/wiki/Path_tracing
|
||||
// Material of the object
|
||||
GltfMaterial mat = materials[nonuniformEXT(matIndex)];
|
||||
vec3 emittance = mat.emissiveFactor;
|
||||
GltfShadeMaterial mat = materials[nonuniformEXT(matIndex)];
|
||||
vec3 emittance = mat.emissiveFactor;
|
||||
|
||||
// Pick a random direction from here and keep going.
|
||||
vec3 tangent, bitangent;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue