ULRE/inc/hgl/graph/material/Material.h

52 lines
1.2 KiB
C
Raw Normal View History

#ifndef HGL_GRAPH_MATERIAL_INCLUDE
#define HGL_GRAPH_MATERIAL_INCLUDE
2020-01-09 17:40:39 +08:00
#include<hgl/graph/material/Component.h>
#include<hgl/type/BaseString.h>
MATERIAL_NAMESPACE_BEGIN
2020-01-09 16:53:30 +08:00
enum class BlendMode
{
2020-01-09 16:53:30 +08:00
Opaque=0,
Mask,
Alpha,
Additive,
Subtractive,
2020-01-09 16:53:30 +08:00
Modulate,
PreMultiAlpha, // 预计算好一半的Alpha
BEGIN_RANGE =Opaque,
END_RANGE =PreMultiAlpha,
RANGE_SIZE =END_RANGE-BEGIN_RANGE+1
2020-01-09 17:40:39 +08:00
};//enum class BlendMode
2020-01-09 16:53:30 +08:00
class Material
{
UTF8String name;
2020-01-09 16:53:30 +08:00
ComponentBitsConfig comp_cfg;
BlendMode blend_mode;
bool two_sided=false;
bool wire_frame=false;
public:
Material(const UTF8String &n,
const ComponentBitsConfig &cbf,
const BlendMode &bm=BlendMode::Opaque,
const bool ts=false,
const bool wf=false)
{
name=n;
comp_cfg=cbf;
blend_mode=bm;
two_sided=false;
wire_frame=false;
}
virtual ~Material()=default;
2020-01-09 16:53:30 +08:00
};//class Material
MATERIAL_NAMESPACE_END
2020-01-08 21:52:53 +08:00
#endif//HGL_GRAPH_MATERIAL_INCLUDE