Skip to content

Commit

Permalink
add notes about new approach
Browse files Browse the repository at this point in the history
  • Loading branch information
tadgem committed Jul 1, 2024
1 parent a4f478d commit 26a60db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions examples/ssgi/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ Pipeline CreateViewPipeline(VulkanAPI& vk, LvkIm3dState& im3dState, ShaderProgra
VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, VK_IMAGE_ASPECT_COLOR_BIT);
finalImage->Build(vk);

// rework pipeline to do the following:
// normal gbuffer
// light pass now has 1 HDR 32bit output
// R channel encodes tonemapped lit image e.g. current output of lighting pass (colour)
// G channel packs emissiveness, surfaces are white(1.0) if non emissive, store emissive colour otherwise
// B channel packs normal
// A channel is depth

auto* ssgiMat = p.AddMaterial(vk, ssgiProg);
ssgiMat->SetDepthAttachment(vk, "depthImageSampler", *gbuffer);
ssgiMat->SetColourAttachment(vk, "positionBufferSampler", *gbuffer, 1);
Expand Down
2 changes: 1 addition & 1 deletion examples/ssgi/shaders/lights.frag
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#version 450
#include "ssgi.utils.glsl"

#define MAX_NUM_EACH_LIGHTS 512

#define ATTENUATION_CONSTANT 1.0
#define ATTENUATION_LINEAR_CONSTANT 4.5
#define ATTENUATION_QUADRATIC_CONSTANT 75.0
Expand Down

0 comments on commit 26a60db

Please sign in to comment.