Refactoring
This commit is contained in:
parent
3e399adf0a
commit
d90ce79135
222 changed files with 9045 additions and 5734 deletions
|
|
@ -41,22 +41,12 @@ layout(buffer_reference, scalar) buffer Vertices {Vertex v[]; }; // Positions of
|
|||
layout(buffer_reference, scalar) buffer Indices {uint i[]; }; // Triangle indices
|
||||
layout(buffer_reference, scalar) buffer Materials {WaveFrontMaterial m[]; }; // Array of all materials on an object
|
||||
layout(buffer_reference, scalar) buffer MatIndices {int i[]; }; // Material ID for each triangle
|
||||
layout(binding = 1, set = 1, scalar) buffer SceneDesc_ { SceneDesc i[]; } sceneDesc;
|
||||
layout(binding = 3, set = 1, scalar) buffer allImplicits_ {Implicit i[];} allImplicits;
|
||||
layout(set = 1, binding = eObjDescs, scalar) buffer ObjDesc_ { ObjDesc i[]; } objDesc;
|
||||
layout(set = 1, binding = eImplicits, scalar) buffer allImplicits_ {Implicit i[];} allImplicits;
|
||||
|
||||
layout(push_constant) uniform _PushConstantRay { PushConstantRay pcRay; };
|
||||
// clang-format on
|
||||
|
||||
layout(push_constant) uniform Constants
|
||||
{
|
||||
vec4 clearColor;
|
||||
vec3 lightPosition;
|
||||
float lightIntensity;
|
||||
vec3 lightDirection;
|
||||
float lightSpotCutoff;
|
||||
float lightSpotOuterCutoff;
|
||||
int lightType;
|
||||
}
|
||||
pushC;
|
||||
|
||||
layout(location = 3) callableDataEXT rayLight cLight;
|
||||
|
||||
|
|
@ -92,10 +82,10 @@ void main()
|
|||
}
|
||||
|
||||
cLight.inHitPosition = worldPos;
|
||||
executeCallableEXT(pushC.lightType, 3);
|
||||
executeCallableEXT(pcRay.lightType, 3);
|
||||
|
||||
// Material of the object
|
||||
SceneDesc objResource = sceneDesc.i[gl_InstanceCustomIndexEXT];
|
||||
ObjDesc objResource = objDesc.i[gl_InstanceCustomIndexEXT];
|
||||
Materials materials = Materials(objResource.materialAddress);
|
||||
WaveFrontMaterial mat = materials.m[impl.matId];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue