Complete sdf reflections

This commit is contained in:
ExMatics HydrogenC
2024-06-18 21:25:12 +08:00
parent 5f939430ee
commit 9062c04ef0
9 changed files with 154 additions and 41 deletions

View File

@@ -360,6 +360,17 @@ void GlobalSurfaceAtlasPass::Dispose()
_shader = nullptr;
}
bool GlobalSurfaceAtlasPass::Get(const RenderBuffers* buffers, BindingData& result)
{
auto* surfaceAtlasData = buffers ? buffers->FindCustomBuffer<GlobalSurfaceAtlasCustomBuffer>(TEXT("GlobalSurfaceAtlas")) : nullptr;
if (surfaceAtlasData && surfaceAtlasData->LastFrameUsed + 1 >= Engine::FrameCount) // Allow to use Surface Atlas from the previous frame (not used currently)
{
result = surfaceAtlasData->Result;
return false;
}
return true;
}
bool GlobalSurfaceAtlasPass::Render(RenderContext& renderContext, GPUContext* context, BindingData& result)
{
// Skip if not supported

View File

@@ -65,6 +65,14 @@ private:
void* _currentActorObject;
public:
/// <summary>
/// Gets the Global Surface Atlas (only if enabled in Graphics Settings).
/// </summary>
/// <param name="buffers">The rendering context buffers.</param>
/// <param name="result">The result Global Surface Atlas data for binding to the shaders.</param>
/// <returns>True if there is no valid Global Surface Atlas rendered during this frame, otherwise false.</returns>
bool Get(const RenderBuffers* buffers, BindingData& result);
/// <summary>
/// Renders the Global Surface Atlas.
/// </summary>