Complete sdf reflections
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user