Water works now
This commit is contained in:
@@ -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);
|
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 {
|
} else {
|
||||||
pParams.initialSpectrumTextures[uint3(id.xy, i)] = 1.0f;
|
pParams.initialSpectrumTextures[uint3(id.xy, i)] = 0.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ void taskMain(
|
|||||||
bounding.maxCorner = float3(tile.location.x + 1, tile.height, tile.location.y + 1) * tile.extent;
|
bounding.maxCorner = float3(tile.location.x + 1, tile.height, tile.location.y + 1) * tile.extent;
|
||||||
float3 median = (bounding.minCorner + bounding.maxCorner) / 2;
|
float3 median = (bounding.minCorner + bounding.maxCorner) / 2;
|
||||||
float distance = distance(median, pViewParams.cameraPos_WS.xyz);
|
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;
|
WaterPayload payload;
|
||||||
payload.offset = bounding.minCorner;
|
payload.offset = bounding.minCorner;
|
||||||
payload.extent = tile.extent / numMeshes;
|
payload.extent = tile.extent / numMeshes;
|
||||||
|
|||||||
+3
-3
@@ -64,9 +64,9 @@ int main() {
|
|||||||
.filePath = sourcePath / "import/textures/skyboxsun5deg_tn.jpg",
|
.filePath = sourcePath / "import/textures/skyboxsun5deg_tn.jpg",
|
||||||
.type = TextureImportType::TEXTURE_CUBEMAP,
|
.type = TextureImportType::TEXTURE_CUBEMAP,
|
||||||
});
|
});
|
||||||
AssetImporter::importMesh(MeshImportArgs{
|
//AssetImporter::importMesh(MeshImportArgs{
|
||||||
.filePath = sourcePath / "import/models/sheepsbody.fbx",
|
// .filePath = sourcePath / "import/models/sheepsbody.fbx",
|
||||||
});
|
//});
|
||||||
// AssetImporter::importMesh(MeshImportArgs{
|
// AssetImporter::importMesh(MeshImportArgs{
|
||||||
// .filePath = sourcePath / "import/models/after-the-rain-vr-sound/source/Whitechapel.glb",
|
// .filePath = sourcePath / "import/models/after-the-rain-vr-sound/source/Whitechapel.glb",
|
||||||
// .importPath = "Whitechapel",
|
// .importPath = "Whitechapel",
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ void BasePass::beginFrame(const Component::Camera& cam) {
|
|||||||
opaqueCulling = lightCullingLayout->allocateDescriptorSet();
|
opaqueCulling = lightCullingLayout->allocateDescriptorSet();
|
||||||
transparentCulling = lightCullingLayout->allocateDescriptorSet();
|
transparentCulling = lightCullingLayout->allocateDescriptorSet();
|
||||||
|
|
||||||
//waterRenderer->beginFrame();
|
waterRenderer->beginFrame();
|
||||||
|
|
||||||
// Debug vertices
|
// Debug vertices
|
||||||
{
|
{
|
||||||
@@ -248,7 +248,7 @@ void BasePass::render() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//commands.add(waterRenderer->render(viewParamsSet));
|
commands.add(waterRenderer->render(viewParamsSet));
|
||||||
|
|
||||||
// Skybox
|
// Skybox
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ DepthCullingPass::DepthCullingPass(Gfx::PGraphics graphics, PScene scene) : Rend
|
|||||||
.hasTaskShader = true,
|
.hasTaskShader = true,
|
||||||
.useMaterial = false,
|
.useMaterial = false,
|
||||||
.useVisibility = true,
|
.useVisibility = true,
|
||||||
.dumpIntermediates = true,
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
graphics->getShaderCompiler()->registerRenderPass("DepthPass", Gfx::PassConfig{
|
graphics->getShaderCompiler()->registerRenderPass("DepthPass", Gfx::PassConfig{
|
||||||
|
|||||||
@@ -251,6 +251,7 @@ WaterRenderer::WaterRenderer(Gfx::PGraphics graphics, PScene scene, Gfx::PDescri
|
|||||||
{"main", "WaterPass"},
|
{"main", "WaterPass"},
|
||||||
},
|
},
|
||||||
.rootSignature = waterLayout,
|
.rootSignature = waterLayout,
|
||||||
|
.dumpIntermediate = true,
|
||||||
};
|
};
|
||||||
graphics->beginShaderCompilation(createInfo);
|
graphics->beginShaderCompilation(createInfo);
|
||||||
waterTask = graphics->createTaskShader({0});
|
waterTask = graphics->createTaskShader({0});
|
||||||
@@ -462,7 +463,6 @@ void WaterRenderer::setViewport(Gfx::PViewport _viewport, Gfx::PRenderPass rende
|
|||||||
},
|
},
|
||||||
.rasterizationState =
|
.rasterizationState =
|
||||||
{
|
{
|
||||||
.polygonMode = Gfx::SE_POLYGON_MODE_LINE,
|
|
||||||
.cullMode = Gfx::SE_CULL_MODE_BACK_BIT,
|
.cullMode = Gfx::SE_CULL_MODE_BACK_BIT,
|
||||||
},
|
},
|
||||||
.colorBlend =
|
.colorBlend =
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
using namespace Seele;
|
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;
|
Map<VertexData::MeshMapping, VertexData::CullingMapping> VertexData::instanceIdMap;
|
||||||
uint64 VertexData::instanceCount = 0;
|
uint64 VertexData::instanceCount = 0;
|
||||||
uint64 VertexData::meshletCount = 0;
|
uint64 VertexData::meshletCount = 0;
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ TextureHandle::TextureHandle(PGraphics graphics, VkImageViewType viewType, const
|
|||||||
{
|
{
|
||||||
.aspectMask = aspect,
|
.aspectMask = aspect,
|
||||||
.levelCount = mipLevels,
|
.levelCount = mipLevels,
|
||||||
.layerCount = layerCount,
|
.layerCount = layerCount * arrayCount,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -194,7 +194,7 @@ void TextureHandle::pipelineBarrier(VkAccessFlags srcAccess, VkPipelineStageFlag
|
|||||||
.baseMipLevel = 0,
|
.baseMipLevel = 0,
|
||||||
.levelCount = mipLevels,
|
.levelCount = mipLevels,
|
||||||
.baseArrayLayer = 0,
|
.baseArrayLayer = 0,
|
||||||
.layerCount = 1,
|
.layerCount = layerCount * arrayCount,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
PCommand command = graphics->getQueueCommands(owner)->getCommands();
|
PCommand command = graphics->getQueueCommands(owner)->getCommands();
|
||||||
|
|||||||
Reference in New Issue
Block a user