added AddMaterialID and comments at ShaderCreateInfoVertex.h

This commit is contained in:
HuYingzhuo(hugo/hyzboy) 2023-05-08 18:24:34 +08:00
parent 8e64816af8
commit f3ab0a5608
2 changed files with 12 additions and 5 deletions

@ -1 +1 @@
Subproject commit 5ec0f4af20c873d4b7aeb18c16ac6deedf44dbe2
Subproject commit 93a4792af52181fdf30f0573e2a5190f61c10b61

View File

@ -1,4 +1,4 @@
#pragma once
#pragma once
#include<hgl/shadergen/ShaderCreateInfo.h>
#include<hgl/graph/VKShaderStage.h>
@ -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_?";