diff --git a/res/shaders/WaterCompute.slang b/res/shaders/WaterCompute.slang index bbcf6da..5364874 100644 --- a/res/shaders/WaterCompute.slang +++ b/res/shaders/WaterCompute.slang @@ -157,7 +157,7 @@ void CS_InitializeSpectrum(uint3 id : SV_DISPATCHTHREADID) { pParams.initialSpectrumTextures[uint3(id.xy, i)] = float4(float2(gauss2.x, gauss1.y) * sqrt(2 * spectrum * abs(dOmegadk) / kLength * deltaK * deltaK), 0.0f, 0.0f); } else { - pParams.initialSpectrumTextures[uint3(id.xy, i)] = 1.0f; + pParams.initialSpectrumTextures[uint3(id.xy, i)] = 0.0f; } } } diff --git a/res/shaders/WaterTask.slang b/res/shaders/WaterTask.slang index c8bac92..34ccd7f 100644 --- a/res/shaders/WaterTask.slang +++ b/res/shaders/WaterTask.slang @@ -17,7 +17,7 @@ void taskMain( bounding.maxCorner = float3(tile.location.x + 1, tile.height, tile.location.y + 1) * tile.extent; float3 median = (bounding.minCorner + bounding.maxCorner) / 2; float distance = distance(median, pViewParams.cameraPos_WS.xyz); - uint numMeshes = max(10 - uint(distance / tile.extent), 1); + uint numMeshes = max(4 - uint(distance / tile.extent), 1); WaterPayload payload; payload.offset = bounding.minCorner; payload.extent = tile.extent / numMeshes; diff --git a/src/Editor/main.cpp b/src/Editor/main.cpp index 42a61f2..705ae9c 100644 --- a/src/Editor/main.cpp +++ b/src/Editor/main.cpp @@ -64,9 +64,9 @@ int main() { .filePath = sourcePath / "import/textures/skyboxsun5deg_tn.jpg", .type = TextureImportType::TEXTURE_CUBEMAP, }); - AssetImporter::importMesh(MeshImportArgs{ - .filePath = sourcePath / "import/models/sheepsbody.fbx", - }); + //AssetImporter::importMesh(MeshImportArgs{ + // .filePath = sourcePath / "import/models/sheepsbody.fbx", + //}); // AssetImporter::importMesh(MeshImportArgs{ // .filePath = sourcePath / "import/models/after-the-rain-vr-sound/source/Whitechapel.glb", // .importPath = "Whitechapel", diff --git a/src/Engine/Graphics/RenderPass/BasePass.cpp b/src/Engine/Graphics/RenderPass/BasePass.cpp index a08eb31..ffd831c 100644 --- a/src/Engine/Graphics/RenderPass/BasePass.cpp +++ b/src/Engine/Graphics/RenderPass/BasePass.cpp @@ -98,7 +98,7 @@ void BasePass::beginFrame(const Component::Camera& cam) { opaqueCulling = lightCullingLayout->allocateDescriptorSet(); transparentCulling = lightCullingLayout->allocateDescriptorSet(); - //waterRenderer->beginFrame(); + waterRenderer->beginFrame(); // Debug vertices { @@ -248,7 +248,7 @@ void BasePass::render() { } } - //commands.add(waterRenderer->render(viewParamsSet)); + commands.add(waterRenderer->render(viewParamsSet)); // Skybox { diff --git a/src/Engine/Graphics/RenderPass/DepthCullingPass.cpp b/src/Engine/Graphics/RenderPass/DepthCullingPass.cpp index 289315d..2ac33e5 100644 --- a/src/Engine/Graphics/RenderPass/DepthCullingPass.cpp +++ b/src/Engine/Graphics/RenderPass/DepthCullingPass.cpp @@ -47,7 +47,6 @@ DepthCullingPass::DepthCullingPass(Gfx::PGraphics graphics, PScene scene) : Rend .hasTaskShader = true, .useMaterial = false, .useVisibility = true, - .dumpIntermediates = true, }); } else { graphics->getShaderCompiler()->registerRenderPass("DepthPass", Gfx::PassConfig{ diff --git a/src/Engine/Graphics/RenderPass/WaterRenderer.cpp b/src/Engine/Graphics/RenderPass/WaterRenderer.cpp index 462b875..f820958 100644 --- a/src/Engine/Graphics/RenderPass/WaterRenderer.cpp +++ b/src/Engine/Graphics/RenderPass/WaterRenderer.cpp @@ -251,6 +251,7 @@ WaterRenderer::WaterRenderer(Gfx::PGraphics graphics, PScene scene, Gfx::PDescri {"main", "WaterPass"}, }, .rootSignature = waterLayout, + .dumpIntermediate = true, }; graphics->beginShaderCompilation(createInfo); waterTask = graphics->createTaskShader({0}); @@ -462,7 +463,6 @@ void WaterRenderer::setViewport(Gfx::PViewport _viewport, Gfx::PRenderPass rende }, .rasterizationState = { - .polygonMode = Gfx::SE_POLYGON_MODE_LINE, .cullMode = Gfx::SE_CULL_MODE_BACK_BIT, }, .colorBlend = diff --git a/src/Engine/Graphics/VertexData.cpp b/src/Engine/Graphics/VertexData.cpp index bca4524..79a2ba9 100644 --- a/src/Engine/Graphics/VertexData.cpp +++ b/src/Engine/Graphics/VertexData.cpp @@ -11,7 +11,7 @@ using namespace Seele; -constexpr static uint64 NUM_DEFAULT_ELEMENTS = 17962284; +constexpr static uint64 NUM_DEFAULT_ELEMENTS = 24;//17962284; Map VertexData::instanceIdMap; uint64 VertexData::instanceCount = 0; uint64 VertexData::meshletCount = 0; diff --git a/src/Engine/Graphics/Vulkan/Texture.cpp b/src/Engine/Graphics/Vulkan/Texture.cpp index 8be183f..23488c3 100644 --- a/src/Engine/Graphics/Vulkan/Texture.cpp +++ b/src/Engine/Graphics/Vulkan/Texture.cpp @@ -162,7 +162,7 @@ TextureHandle::TextureHandle(PGraphics graphics, VkImageViewType viewType, const { .aspectMask = aspect, .levelCount = mipLevels, - .layerCount = layerCount, + .layerCount = layerCount * arrayCount, }, }; @@ -194,7 +194,7 @@ void TextureHandle::pipelineBarrier(VkAccessFlags srcAccess, VkPipelineStageFlag .baseMipLevel = 0, .levelCount = mipLevels, .baseArrayLayer = 0, - .layerCount = 1, + .layerCount = layerCount * arrayCount, }, }; PCommand command = graphics->getQueueCommands(owner)->getCommands();