From f3ab0a5608195a3147e4751644d419b8e31076f1 Mon Sep 17 00:00:00 2001 From: "HuYingzhuo(hugo/hyzboy)" Date: Mon, 8 May 2023 18:24:34 +0800 Subject: [PATCH] added AddMaterialID and comments at ShaderCreateInfoVertex.h --- CMSceneGraph | 2 +- inc/hgl/shadergen/ShaderCreateInfoVertex.h | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CMSceneGraph b/CMSceneGraph index 5ec0f4af..93a4792a 160000 --- a/CMSceneGraph +++ b/CMSceneGraph @@ -1 +1 @@ -Subproject commit 5ec0f4af20c873d4b7aeb18c16ac6deedf44dbe2 +Subproject commit 93a4792af52181fdf30f0573e2a5190f61c10b61 diff --git a/inc/hgl/shadergen/ShaderCreateInfoVertex.h b/inc/hgl/shadergen/ShaderCreateInfoVertex.h index 6cf63a55..872aa284 100644 --- a/inc/hgl/shadergen/ShaderCreateInfoVertex.h +++ b/inc/hgl/shadergen/ShaderCreateInfoVertex.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include #include @@ -19,10 +19,17 @@ namespace hgl int AddInput(const graph::VAT &type,const AnsiString &name,const VkVertexInputRate input_rate=VK_VERTEX_INPUT_RATE_VERTEX,const VertexInputGroup &group=VertexInputGroup::Basic); int AddInput(const AnsiString &type,const AnsiString &name,const VkVertexInputRate input_rate=VK_VERTEX_INPUT_RATE_VERTEX,const VertexInputGroup &group=VertexInputGroup::Basic); + void AddMaterialID() + { + VAT vat{VertexAttribType::BaseType::UInt,1}; //使用uint16 + + AddInput(vat,VAN::MaterialID,VK_VERTEX_INPUT_RATE_VERTEX,VertexInputGroup::Material); + } + void AddBone() { - VAT id {VertexAttribType::BaseType::UInt,4}; - VAT weight {VertexAttribType::BaseType::Float,4}; + VAT id {VertexAttribType::BaseType::UInt,4}; //使用uint8[4] + VAT weight {VertexAttribType::BaseType::Float,4}; //使用uint8[4] AddInput(id, VAN::BoneID, VK_VERTEX_INPUT_RATE_VERTEX,VertexInputGroup::Bone); AddInput(weight,VAN::BoneWeight,VK_VERTEX_INPUT_RATE_VERTEX,VertexInputGroup::Bone); @@ -30,7 +37,7 @@ namespace hgl void AddLocalToWorld() { - VAT vat{VertexAttribType::BaseType::Float,4}; + VAT vat{VertexAttribType::BaseType::Float,4}; //使用float[4] char name[]= "LocalToWorld_?";