Fixed vertex data buffer being incorrect
This commit is contained in:
parent
9e09896984
commit
8ad0eee032
|
@ -73,7 +73,7 @@ namespace Sandbox
|
||||||
auto& renderable = *SHADE::SHComponentManager::GetComponent_s<SHADE::SHRenderable>(entity);
|
auto& renderable = *SHADE::SHComponentManager::GetComponent_s<SHADE::SHRenderable>(entity);
|
||||||
renderable.Mesh = CUBE_MESH;
|
renderable.Mesh = CUBE_MESH;
|
||||||
renderable.SetMaterial(matInst);
|
renderable.SetMaterial(matInst);
|
||||||
renderable.TransformMatrix.Scale(2.0f, 2.0f, 2.0f);
|
renderable.TransformMatrix.Translate(0.0f, 0.0f, 2.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SBApplication::Update(void)
|
void SBApplication::Update(void)
|
||||||
|
|
|
@ -121,11 +121,11 @@ namespace SHADE
|
||||||
|
|
||||||
// Initialize world render graph
|
// Initialize world render graph
|
||||||
worldRenderGraph->Init(device, swapchain, &defaultVertexInputState, &globalDescSetLayouts);
|
worldRenderGraph->Init(device, swapchain, &defaultVertexInputState, &globalDescSetLayouts);
|
||||||
worldRenderGraph->AddResource("Position", SH_ATT_DESC_TYPE::COLOR, windowDims.first, windowDims.second, vk::Format::eR16G16B16A16Sfloat);
|
//worldRenderGraph->AddResource("Position", SH_ATT_DESC_TYPE::COLOR, windowDims.first, windowDims.second, vk::Format::eR16G16B16A16Sfloat);
|
||||||
worldRenderGraph->AddResource("Normals", SH_ATT_DESC_TYPE::COLOR, windowDims.first, windowDims.second, vk::Format::eR16G16B16A16Sfloat);
|
//worldRenderGraph->AddResource("Normals", SH_ATT_DESC_TYPE::COLOR, windowDims.first, windowDims.second, vk::Format::eR16G16B16A16Sfloat);
|
||||||
worldRenderGraph->AddResource("Composite", SH_ATT_DESC_TYPE::COLOR, windowDims.first, windowDims.second, vk::Format::eR16G16B16A16Sfloat);
|
//worldRenderGraph->AddResource("Composite", SH_ATT_DESC_TYPE::COLOR, windowDims.first, windowDims.second, vk::Format::eR16G16B16A16Sfloat);
|
||||||
worldRenderGraph->AddResource("Present", SH_ATT_DESC_TYPE::COLOR_PRESENT, windowDims.first, windowDims.second);
|
worldRenderGraph->AddResource("Present", SH_ATT_DESC_TYPE::COLOR_PRESENT, windowDims.first, windowDims.second);
|
||||||
auto node = worldRenderGraph->AddNode("G-Buffer", { "Composite", "Position", "Normals", "Present" }, {}); // no predecessors
|
auto node = worldRenderGraph->AddNode("G-Buffer", { /*"Composite", "Position", "Normals",*/ "Present" }, {}); // no predecessors
|
||||||
|
|
||||||
//First subpass to write to G-Buffer
|
//First subpass to write to G-Buffer
|
||||||
auto gBufferWriteSubpass = node->AddSubpass("G-Buffer Write");
|
auto gBufferWriteSubpass = node->AddSubpass("G-Buffer Write");
|
||||||
|
@ -485,9 +485,9 @@ namespace SHADE
|
||||||
{
|
{
|
||||||
defaultVertexInputState.AddBinding(false, false, {SHVertexAttribute(SHAttribFormat::FLOAT_3D)}); // positions at binding 0
|
defaultVertexInputState.AddBinding(false, false, {SHVertexAttribute(SHAttribFormat::FLOAT_3D)}); // positions at binding 0
|
||||||
defaultVertexInputState.AddBinding(false, false, {SHVertexAttribute(SHAttribFormat::FLOAT_2D)}); // UVs at binding 1
|
defaultVertexInputState.AddBinding(false, false, {SHVertexAttribute(SHAttribFormat::FLOAT_2D)}); // UVs at binding 1
|
||||||
defaultVertexInputState.AddBinding(false, false, {SHVertexAttribute(SHAttribFormat::FLOAT_3D)}); // Normals at binding 2
|
//defaultVertexInputState.AddBinding(false, false, {SHVertexAttribute(SHAttribFormat::FLOAT_3D)}); // Normals at binding 2
|
||||||
defaultVertexInputState.AddBinding(false, false, {SHVertexAttribute(SHAttribFormat::FLOAT_3D)}); // Tangents at binding 3
|
//defaultVertexInputState.AddBinding(false, false, {SHVertexAttribute(SHAttribFormat::FLOAT_3D)}); // Tangents at binding 3
|
||||||
defaultVertexInputState.AddBinding(true, true, {SHVertexAttribute(SHAttribFormat::MAT_4D)}); // Transform at binding 4 - 7 (4 slots)
|
//defaultVertexInputState.AddBinding(true, true, {SHVertexAttribute(SHAttribFormat::MAT_4D)}); // Transform at binding 4 - 7 (4 slots)
|
||||||
}
|
}
|
||||||
|
|
||||||
void SHGraphicsSystem::BeginRoutine::Execute(double) noexcept
|
void SHGraphicsSystem::BeginRoutine::Execute(double) noexcept
|
||||||
|
|
|
@ -193,7 +193,7 @@ namespace SHADE
|
||||||
|
|
||||||
Handle<SHMesh> SHPrimitiveGenerator::Cube(SHMeshLibrary& meshLibrary) noexcept
|
Handle<SHMesh> SHPrimitiveGenerator::Cube(SHMeshLibrary& meshLibrary) noexcept
|
||||||
{
|
{
|
||||||
SHMeshData meshData = Cube();
|
static SHMeshData meshData = Cube();
|
||||||
return meshLibrary.AddMesh
|
return meshLibrary.AddMesh
|
||||||
(
|
(
|
||||||
meshData.VertexPositions.size(),
|
meshData.VertexPositions.size(),
|
||||||
|
@ -208,7 +208,7 @@ namespace SHADE
|
||||||
|
|
||||||
Handle<SHADE::SHMesh> SHPrimitiveGenerator::Cube(SHGraphicsSystem& gfxSystem) noexcept
|
Handle<SHADE::SHMesh> SHPrimitiveGenerator::Cube(SHGraphicsSystem& gfxSystem) noexcept
|
||||||
{
|
{
|
||||||
SHMeshData meshData = Cube();
|
static SHMeshData meshData = Cube();
|
||||||
return gfxSystem.AddMesh
|
return gfxSystem.AddMesh
|
||||||
(
|
(
|
||||||
meshData.VertexPositions.size(),
|
meshData.VertexPositions.size(),
|
||||||
|
|
|
@ -79,5 +79,11 @@ namespace SHADE
|
||||||
*/
|
*/
|
||||||
/***********************************************************************************/
|
/***********************************************************************************/
|
||||||
[[nodiscard]] static Handle<SHMesh> Cube(SHGraphicsSystem& gfxSystem) noexcept;
|
[[nodiscard]] static Handle<SHMesh> Cube(SHGraphicsSystem& gfxSystem) noexcept;
|
||||||
|
|
||||||
|
private:
|
||||||
|
/*---------------------------------------------------------------------------------*/
|
||||||
|
/* Helper Functions */
|
||||||
|
/*---------------------------------------------------------------------------------*/
|
||||||
|
[[nodiscard]] static SHMeshData genCubeData() noexcept;
|
||||||
};
|
};
|
||||||
}
|
}
|
|
@ -204,6 +204,8 @@ namespace SHADE
|
||||||
// Offset is 0 at first (for first element)
|
// Offset is 0 at first (for first element)
|
||||||
uint32_t offset = 0;
|
uint32_t offset = 0;
|
||||||
|
|
||||||
|
binding.binding = static_cast<uint32_t>(bindings.size() - 1);
|
||||||
|
|
||||||
// for every attribute passed in
|
// for every attribute passed in
|
||||||
for (auto const& attrib : inAttribs)
|
for (auto const& attrib : inAttribs)
|
||||||
{
|
{
|
||||||
|
|
|
@ -206,7 +206,7 @@ namespace SHADE
|
||||||
*/
|
*/
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
SHVkPipeline::SHVkPipeline(Handle<SHVkLogicalDevice> const& inLogicalDeviceHdl, Handle<SHVkPipelineLayout> const& inPipelineLayout, SHVkPipelineState const* const state, Handle<SHVkRenderpass> const& renderpassHdl, Handle<SHSubpass> subpass, SH_PIPELINE_TYPE type) noexcept
|
SHVkPipeline::SHVkPipeline(Handle<SHVkLogicalDevice> const& inLogicalDeviceHdl, Handle<SHVkPipelineLayout> const& inPipelineLayout, SHVkPipelineState const* const state, Handle<SHVkRenderpass> const& renderpassHdl, Handle<SHSubpass> subpass, SH_PIPELINE_TYPE type) noexcept
|
||||||
: pipelineState{ } // copy the pipeline state
|
: pipelineState{ }
|
||||||
, pipelineType {type}
|
, pipelineType {type}
|
||||||
, vkPipeline {VK_NULL_HANDLE}
|
, vkPipeline {VK_NULL_HANDLE}
|
||||||
, logicalDeviceHdl{ inLogicalDeviceHdl }
|
, logicalDeviceHdl{ inLogicalDeviceHdl }
|
||||||
|
|
|
@ -68,5 +68,5 @@ void main()
|
||||||
//outColor.a = diffuseColor.a;
|
//outColor.a = diffuseColor.a;
|
||||||
|
|
||||||
|
|
||||||
outColor = In.vertColor;
|
outColor = vec4 (1.0f);
|
||||||
}
|
}
|
Binary file not shown.
Loading…
Reference in New Issue