Water works now

This commit is contained in:
Dynamitos
2024-08-21 17:43:31 +02:00
parent fcdb132d49
commit 19a2423953
8 changed files with 11 additions and 12 deletions
+1 -1
View File
@@ -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;
}
}
}
+1 -1
View File
@@ -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;
+3 -3
View File
@@ -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",
+2 -2
View File
@@ -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
{
@@ -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{
@@ -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 =
+1 -1
View File
@@ -11,7 +11,7 @@
using namespace Seele;
constexpr static uint64 NUM_DEFAULT_ELEMENTS = 17962284;
constexpr static uint64 NUM_DEFAULT_ELEMENTS = 24;//17962284;
Map<VertexData::MeshMapping, VertexData::CullingMapping> VertexData::instanceIdMap;
uint64 VertexData::instanceCount = 0;
uint64 VertexData::meshletCount = 0;
+2 -2
View File
@@ -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();