Skip to content

Commit

Permalink
Fixed decomposition tracking.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismile committed Aug 24, 2023
1 parent 42fa291 commit 59787e4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
8 changes: 3 additions & 5 deletions Data/Shaders/VPT/VptHeader.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,8 @@ layout (binding = 3) uniform Parameters {
vec3 boxMax;
vec3 gridMin;
vec3 gridMax;

vec3 emissionBoxMin;
vec3 emissionBoxMax;

vec3 extinction;
vec3 scatteringAlbedo;

Expand All @@ -70,14 +68,14 @@ layout (binding = 3) uniform Parameters {
float emissionStrength;
int numFeatureMapSamplesPerFrame;

// Whether to use linear RGB or sRGB.
int useLinearRGB;

// For residual ratio tracking and decomposition tracking.
ivec3 superVoxelSize;
ivec3 superVoxelGridSize;

//ivec3 gridResolution;

// Whether to use linear RGB or sRGB.
int useLinearRGB;
} parameters;

layout (binding = 4) uniform FrameInfo {
Expand Down
2 changes: 1 addition & 1 deletion Data/Shaders/VPT/VptUtils.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ float sampleCloud(
pnanovdb_readaccessor_t accessor,
#endif
in vec3 pos) {
// transform world pos to density grid pos
// Transform world position to density grid position.
vec3 coord = (pos - parameters.boxMin) / (parameters.boxMax - parameters.boxMin);
#if defined(FLIP_YZ)
coord = coord.xzy;
Expand Down
12 changes: 4 additions & 8 deletions src/PathTracer/VolumetricPathTracingPass.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,10 @@ class VolumetricPathTracingPass : public sgl::vk::ComputePass {
// Cloud properties
glm::vec3 boxMin; float pad0;
glm::vec3 boxMax; float pad1;

glm::vec3 gridMin; float pad2;
glm::vec3 gridMax; float pad3;

glm::vec3 emissionBoxMin; float pad4;
glm::vec3 emissionBoxMax; float pad5;

glm::vec3 extinction; float pad6;
glm::vec3 scatteringAlbedo;

Expand All @@ -262,15 +259,14 @@ class VolumetricPathTracingPass : public sgl::vk::ComputePass {

float emissionCap;
float emissionStrength;

int numFeatureMapSamplesPerFrame;

// For decomposition and residual ratio tracking.
glm::ivec3 superVoxelSize; int pad8;
glm::ivec3 superVoxelGridSize;

// Whether to use linear RGB or sRGB.
int useLinearRGB;

// For decomposition and residual ratio tracking.
glm::ivec3 superVoxelSize; int pad8;
glm::ivec3 superVoxelGridSize; int pad9;
};
UniformData uniformData{};
sgl::vk::BufferPtr uniformBuffer;
Expand Down

0 comments on commit 59787e4

Please sign in to comment.