loading cam from file and flake update

This commit is contained in:
CDaut 2024-05-17 00:43:42 +02:00
parent 916e68443f
commit 39ac0cf6c7
Signed by: clara
GPG key ID: 223391B52FAD4463
4 changed files with 9 additions and 9 deletions

6
flake.lock generated
View file

@ -2,11 +2,11 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1715266358, "lastModified": 1715787315,
"narHash": "sha256-doPgfj+7FFe9rfzWo1siAV2mVCasW+Bh8I1cToAXEE4=", "narHash": "sha256-cYApT0NXJfqBkKcci7D9Kr4CBYZKOQKDYA23q8XNuWg=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "f1010e0469db743d14519a1efd37e23f8513d714", "rev": "33d1e753c82ffc557b4a585c77de43d4c922ebb5",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -735,11 +735,11 @@ void HelloVulkan::createRtPipeline()
VkPipelineShaderStageCreateInfo stage{VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO}; VkPipelineShaderStageCreateInfo stage{VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO};
stage.pName = "main"; // All the same entry point stage.pName = "main"; // All the same entry point
// Raygen // Raygen
stage.module = nvvk::createShaderModule(m_device, nvh::loadFile("spv/pathtrace.rgen.spv", true, defaultSearchPaths, true)); stage.module = nvvk::createShaderModule(m_device, nvh::loadFile("spv/raytrace.rgen.spv", true, defaultSearchPaths, true));
stage.stage = VK_SHADER_STAGE_RAYGEN_BIT_KHR; stage.stage = VK_SHADER_STAGE_RAYGEN_BIT_KHR;
stages[eRaygen] = stage; stages[eRaygen] = stage;
// Miss // Miss
stage.module = nvvk::createShaderModule(m_device, nvh::loadFile("spv/pathtrace.rmiss.spv", true, defaultSearchPaths, true)); stage.module = nvvk::createShaderModule(m_device, nvh::loadFile("spv/raytrace.rmiss.spv", true, defaultSearchPaths, true));
stage.stage = VK_SHADER_STAGE_MISS_BIT_KHR; stage.stage = VK_SHADER_STAGE_MISS_BIT_KHR;
stages[eMiss] = stage; stages[eMiss] = stage;
// The second miss shader is invoked when a shadow ray misses the geometry. It simply indicates that no occlusion has been found // The second miss shader is invoked when a shadow ray misses the geometry. It simply indicates that no occlusion has been found
@ -748,7 +748,7 @@ void HelloVulkan::createRtPipeline()
stage.stage = VK_SHADER_STAGE_MISS_BIT_KHR; stage.stage = VK_SHADER_STAGE_MISS_BIT_KHR;
stages[eMiss2] = stage; stages[eMiss2] = stage;
// Hit Group - Closest Hit // Hit Group - Closest Hit
stage.module = nvvk::createShaderModule(m_device, nvh::loadFile("spv/pathtrace.rchit.spv", true, defaultSearchPaths, true)); stage.module = nvvk::createShaderModule(m_device, nvh::loadFile("spv/raytrace.rchit.spv", true, defaultSearchPaths, true));
stage.stage = VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR; stage.stage = VK_SHADER_STAGE_CLOSEST_HIT_BIT_KHR;
stages[eClosestHit] = stage; stages[eClosestHit] = stage;

View file

@ -67,9 +67,9 @@ public:
// Information pushed at each draw call // Information pushed at each draw call
PushConstantRaster m_pcRaster{ PushConstantRaster m_pcRaster{
{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}, // Identity matrix {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}, // Identity matrix
{0.f, 4.5f, 0.f}, // light position {0.f, 100.f, 0.f}, // light position
0, // instance Id 0, // instance Id
10.f, // light intensity 1000.f, // light intensity
0, // light type 0, // light type
0 // material id 0 // material id
}; };

View file

@ -65,7 +65,7 @@ void main()
vec3 curWeight = vec3(1); vec3 curWeight = vec3(1);
vec3 hitValue = vec3(0); vec3 hitValue = vec3(0);
for(; prd.depth < 10; prd.depth++) for(; prd.depth < 100; prd.depth++)
{ {
traceRayEXT(topLevelAS, // acceleration structure traceRayEXT(topLevelAS, // acceleration structure
rayFlags, // rayFlags rayFlags, // rayFlags