Trying to add fluid simulation
This commit is contained in:
@@ -4,9 +4,10 @@
|
||||
#include "Graphics/RayTracing.h"
|
||||
#include "Graphics/Shader.h"
|
||||
#include "Graphics/StaticMeshVertexData.h"
|
||||
#include "RenderPass.h"
|
||||
#include "Material/Material.h"
|
||||
#include "Material/MaterialInstance.h"
|
||||
#include "RenderPass.h"
|
||||
#include <iostream>
|
||||
|
||||
using namespace Seele;
|
||||
|
||||
@@ -55,11 +56,24 @@ RayTracingPass::RayTracingPass(Gfx::PGraphics graphics, PScene scene) : RenderPa
|
||||
.size = sizeof(SampleParams),
|
||||
.name = "pSamps",
|
||||
});
|
||||
|
||||
graphics->beginShaderCompilation(ShaderCompilationInfo{
|
||||
.name = "RayGenMiss",
|
||||
.modules = {"RayGen", "AnyHit", "Miss"},
|
||||
.entryPoints = {{"raygen", "RayGen"}, {"anyhit", "AnyHit"}, {"miss", "Miss"}},
|
||||
.defines = {{"RAY_TRACING", "1"}},
|
||||
.rootSignature = pipelineLayout,
|
||||
});
|
||||
rayGen = graphics->createRayGenShader({0});
|
||||
anyhit = graphics->createAnyHitShader({1});
|
||||
miss = graphics->createMissShader({2});
|
||||
pipelineLayout->create();
|
||||
graphics->getShaderCompiler()->registerRenderPass("RayTracing", Gfx::PassConfig{
|
||||
.baseLayout = pipelineLayout,
|
||||
.mainFile = "ClosestHit",
|
||||
.useMaterial = true,
|
||||
.rayTracing = true,
|
||||
.dumpIntermediates = true,
|
||||
});
|
||||
skyBox = AssetRegistry::findEnvironmentMap("", "newport_loft")->getSkybox();
|
||||
skyBoxSampler = graphics->createSampler({});
|
||||
@@ -212,20 +226,9 @@ void RayTracingPass::publishOutputs() {
|
||||
texture->changeLayout(Gfx::SE_IMAGE_LAYOUT_GENERAL, Gfx::SE_ACCESS_NONE, Gfx::SE_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
|
||||
Gfx::SE_ACCESS_SHADER_WRITE_BIT,
|
||||
Gfx::SE_PIPELINE_STAGE_COMPUTE_SHADER_BIT | Gfx::SE_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR);
|
||||
resources->registerRenderPassOutput("BASEPASS_COLOR", Gfx::RenderTargetAttachment(texture->getDefaultView(), Gfx::SE_IMAGE_LAYOUT_UNDEFINED,
|
||||
Gfx::SE_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL));
|
||||
ShaderCompilationInfo compileInfo = {
|
||||
.name = "RayGenMiss",
|
||||
.modules = {"RayGen", "AnyHit", "Miss"},
|
||||
.entryPoints = {{"raygen", "RayGen"}, {"anyhit", "AnyHit"}, {"miss", "Miss"}},
|
||||
.defines = {{"RAY_TRACING", "1"}},
|
||||
.rootSignature = pipelineLayout,
|
||||
};
|
||||
graphics->beginShaderCompilation(compileInfo);
|
||||
rayGen = graphics->createRayGenShader({0});
|
||||
anyhit = graphics->createAnyHitShader({1});
|
||||
miss = graphics->createMissShader({2});
|
||||
pipelineLayout->create();
|
||||
resources->registerRenderPassOutput("BASEPASS_COLOR",
|
||||
Gfx::RenderTargetAttachment(texture->getDefaultView(), Gfx::SE_IMAGE_LAYOUT_UNDEFINED,
|
||||
Gfx::SE_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL));
|
||||
}
|
||||
|
||||
void RayTracingPass::createRenderPass() {}
|
||||
|
||||
Reference in New Issue
Block a user