材质增加属性,读取增加函数提升易用性

This commit is contained in:
2019-05-31 19:03:25 +08:00
parent 188b8f9c2a
commit 8ee242f233
6 changed files with 113 additions and 66 deletions

View File

@@ -27,15 +27,29 @@ namespace hgl
Set<int> uv_use;
Color4f diffuse;
Color4f specular;
Color4f ambient;
Color4f emission;
float shininess=0;
bool wireframe=false;
bool two_sided=false;
uint shading_model=0;
bool wireframe=false;
uint blend_func;
float opacity; ///<透明度
uint transparency_factor;
float bump_scaling;
float shininess;
float reflectivity; ///<反射率
float shininess_strength;
float refracti; ///<折射率
Color4f diffuse;
Color4f ambient;
Color4f specular;
Color4f emission;
Color4f transparent; ///<透明色
Color4f reflective; ///<反射颜色
public:
@@ -45,6 +59,21 @@ namespace hgl
tex_list=nullptr;
}
void InitDefaultColor()
{
diffuse.Set(1,1,1,1);
specular.Set(0,0,0,1);
ambient.Set(0.2,0.2,0.2,1.0f);
emission.Set(0,0,0,1);
shininess=0;
opacity=1.0f;
refracti=0;
transparent.Set(0,0,0,1);
reflective.Set(1,1,1,1);
}
void Init(const uint32 tc)
{
tex_count=tc;

View File

@@ -40,6 +40,11 @@ namespace hgl
}
};//struct MeshFileHeader
#pragma pack(pop)
struct MeshData
{
VkPrimitiveTopology primitive;
};//
}//namespace graph
}//namespace hgl
#endif//HGL_GRAPH_MESH_INCLUDE