Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/Game-Lib/Game-Lib/Rendering/GameRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ void GameRenderer::CreatePermanentResources()
visibilityBufferDesc.debugName = "VisibilityBuffer";
visibilityBufferDesc.dimensions = vec2(1.0f, 1.0f);
visibilityBufferDesc.dimensionType = Renderer::ImageDimensionType::DIMENSION_SCALE_RENDERSIZE;
visibilityBufferDesc.format = Renderer::ImageFormat::R32G32B32A32_UINT;
visibilityBufferDesc.format = Renderer::ImageFormat::R32G32_UINT;
visibilityBufferDesc.sampleCount = Renderer::SampleCount::SAMPLE_COUNT_1;
visibilityBufferDesc.clearUInts = uvec4(0, 0, 0, 0);

Expand Down
14 changes: 13 additions & 1 deletion Source/Game-Lib/Game-Lib/Rendering/Material/MaterialRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,15 @@ void MaterialRenderer::AddPreEffectsPass(Renderer::RenderGraph* renderGraph, Ren
commandList.BindDescriptorSet(Renderer::DescriptorSetSlot::MODEL, data.modelSet, frameIndex);
commandList.BindDescriptorSet(Renderer::DescriptorSetSlot::PER_PASS, data.preEffectsSet, frameIndex);

uvec2 outputSize = _renderer->GetImageDimensions(resources.packedNormals, 0);
vec2 outputSize = static_cast<vec2>(_renderer->GetImageDimensions(resources.packedNormals, 0));

struct Constants
{
vec4 renderInfo; // x = Render Width, y = Render Height, z = 1/Width, w = 1/Height
};

Constants* constants = graphResources.FrameNew<Constants>();
constants->renderInfo = vec4(outputSize, 1.0f / outputSize);

uvec2 dispatchSize = uvec2((outputSize.x + 7) / 8, (outputSize.y + 7) / 8);
commandList.Dispatch(dispatchSize.x, dispatchSize.y, 1);
Expand Down Expand Up @@ -207,6 +215,7 @@ void MaterialRenderer::AddMaterialPass(Renderer::RenderGraph* renderGraph, Rende

struct Constants
{
vec4 renderInfo; // x = Render Width, y = Render Height, z = 1/Width, w = 1/Height
uvec4 lightInfo; // x = Directional Light Count, Y = Point Light Count, Z = Cascade Count, W = Shadows Enabled
vec4 fogColor;
vec4 fogSettings; // x = Enabled, y = Begin Fog Blend Dist, z = End Fog Blend Dist, w = UNUSED
Expand All @@ -221,6 +230,9 @@ void MaterialRenderer::AddMaterialPass(Renderer::RenderGraph* renderGraph, Rende

Constants* constants = graphResources.FrameNew<Constants>();

vec2 outputSize = static_cast<vec2>(_renderer->GetImageDimensions(resources.sceneColor, 0));
constants->renderInfo = vec4(outputSize, 1.0f / outputSize);

CVarSystem* cvarSystem = CVarSystem::Get();
const u32 numCascades = static_cast<u32>(*cvarSystem->GetIntCVar(CVarCategory::Client | CVarCategory::Rendering, "shadowCascadeNum"));
const u32 shadowEnabled = static_cast<u32>(*cvarSystem->GetIntCVar(CVarCategory::Client | CVarCategory::Rendering, "shadowEnabled"));
Expand Down
Loading
Loading