Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Hineven committed May 18, 2024
1 parent 6548155 commit 87e0711
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/core/src/render_techniques/migi/migi.comp
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,15 @@ int LocalSGNewIndex[SSRC_MAX_NUM_BASIS_PER_PROBE * 4];
// Initialize probe cache from the previous frame, one group per probe
[numthreads(WAVE_SIZE, 1, 1)]
void SSRC_ReprojectProbeHistory (int LocalID : SV_GroupThreadID, int GroupID : SV_GroupID) {
if(MI.ResetCache) return ;
int2 ProbeIndex = int2(GroupID % MI.TileDimensions.x, GroupID / MI.TileDimensions.x);
ProbeHeader Header = GetScreenProbeHeader(ProbeIndex);
// FIXME reprojection and clamping is missing!!!
asdfasfasdfasdfasdf
float4 PrevHomogeneousW = mul(MI.PrevCameraProjView, float4(Header.Position, 1));
if(PrevHomogeneousW.w <= 0) {
return ;
}sdfasfsdafdasfasdf
float3 PrevHomogeneous = PrevHomogeneousW.xyz / PrevHomogeneousW.w;
float2 PrevScreenPosition = MI.ScreenDimensions * NDC22UV(PrevHomogeneous.xy);
SSRC_SampleData Sample;
CalculateSSRCSampleWeights(
Header.ScreenPosition,
Expand Down
1 change: 1 addition & 0 deletions src/core/src/render_techniques/migi/migi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ void MIGI::render(CapsaicinInternal &capsaicin) noexcept

C.Reprojection = camera_matrices.reprojection;
C.ForwardReprojection = glm::dmat4(camera_matrices.view_projection) * glm::inverse(glm::dmat4(camera_matrices.view_projection_prev));
C.PrevCameraProjView = previous_constants_.CameraProjView;
C.PreviousCameraPosition = previous_camera_.eye;

C.FrameIndex = capsaicin.getFrameIndex();
Expand Down
2 changes: 2 additions & 0 deletions src/core/src/render_techniques/migi/migi_common.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ struct MIGI_Constants {
// Prev NDC -> Current NDC
float4x4 ForwardReprojection;

float4x4 PrevCameraProjView;

float3 PreviousCameraPosition;

uint FrameIndex;
Expand Down

0 comments on commit 87e0711

Please sign in to comment.