So many changes again
This commit is contained in:
1 parent
495e683522
commit
424dea0012
30 files changed
+566
-235
No files matched your search
@@ -1,19 +1,26 @@
|
||||
#include "FluidRenderPass.h"
|
||||
#include "Component/Transform.h"
|
||||
#include "Graphics/Command.h"
|
||||
#include "Graphics/Descriptor.h"
|
||||
#include "Graphics/Enums.h"
|
||||
#include "Graphics/Graphics.h"
|
||||
#include "Graphics/Initializer.h"
|
||||
#include "Graphics/RenderTarget.h"
|
||||
#include "Graphics/Shader.h"
|
||||
#include "Math/Matrix.h"
|
||||
#include "Scene/LightEnvironment.h"
|
||||
#include "Scene/Scene.h"
|
||||
#include "Scene/FluidScene.h"
|
||||
|
||||
using namespace Seele;
|
||||
|
||||
FluidRenderPass::FluidRenderPass(Gfx::PGraphics graphics, PScene scene) : RenderPass(graphics), scene(scene) {
|
||||
pipelineLayout = graphics->createPipelineLayout("FluidPipelineLayout");
|
||||
descriptorLayout = graphics->createDescriptorLayout("params");
|
||||
descriptorLayout->addDescriptorBinding(Gfx::DescriptorBinding{
|
||||
.name = "transform",
|
||||
.uniformLength = sizeof(Matrix4),
|
||||
});
|
||||
descriptorLayout->addDescriptorBinding(Gfx::DescriptorBinding{
|
||||
.name = "vertexBuffer",
|
||||
.descriptorType = Gfx::SE_DESCRIPTOR_TYPE_STORAGE_BUFFER,
|
||||
@@ -54,6 +61,8 @@ void FluidRenderPass::render() {
|
||||
descriptorLayout->reset();
|
||||
for (const auto& [id, data] : scene->getFluidScene()->getFluidDataMap()) {
|
||||
descriptorSet = descriptorLayout->allocateDescriptorSet();
|
||||
Matrix4 transformMatrix = data.transform.toMatrix();
|
||||
descriptorSet->updateConstants("transform", 0, &transformMatrix);
|
||||
descriptorSet->updateBuffer("vertexBuffer", 0, data.vertexBuffer);
|
||||
descriptorSet->updateBuffer("normalBuffer", 0, data.normalBuffer);
|
||||
descriptorSet->updateBuffer("indexBuffer", 0, data.indexBuffer);
|
||||
@@ -75,6 +84,7 @@ void FluidRenderPass::endFrame() {}
|
||||
void FluidRenderPass::publishOutputs() {
|
||||
}
|
||||
|
||||
|
||||
void FluidRenderPass::createRenderPass() {
|
||||
colorAttachment = resources->requestRenderTarget("BASEPASS_COLOR");
|
||||
colorAttachment.setLoadOp(Gfx::SE_ATTACHMENT_LOAD_OP_LOAD);
|
||||
@@ -112,6 +122,7 @@ void FluidRenderPass::createRenderPass() {
|
||||
Gfx::SE_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT,
|
||||
},
|
||||
};
|
||||
|
||||
renderPass = graphics->createRenderPass(layout, dependency, viewport->getRenderArea(), "FluidRenderPass");
|
||||
pipeline = graphics->createGraphicsPipeline(Gfx::LegacyPipelineCreateInfo{
|
||||
.vertexShader = vertexShader,
|
||||
@@ -124,7 +135,7 @@ void FluidRenderPass::createRenderPass() {
|
||||
},
|
||||
.rasterizationState =
|
||||
{
|
||||
.cullMode = Gfx::SE_CULL_MODE_FRONT_BIT,
|
||||
.cullMode = Gfx::SE_CULL_MODE_NONE,
|
||||
},
|
||||
.colorBlend =
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user