2019-12-10 21:52:10 +08:00
|
|
|
|
#ifndef HGL_GRAPH_SHADER_NODE_TEXTURE_INCLUDE
|
|
|
|
|
#define HGL_GRAPH_SHADER_NODE_TEXTURE_INCLUDE
|
2019-12-06 21:45:51 +08:00
|
|
|
|
|
2019-12-10 21:52:10 +08:00
|
|
|
|
#include<hgl/graph/shader/node/vector.h>
|
2019-12-16 20:35:51 +08:00
|
|
|
|
#include<hgl/graph/shader/node/node.h>
|
2020-01-14 18:09:40 +08:00
|
|
|
|
SHADER_NODE_NAMESPACE_BEGIN
|
2019-12-16 20:35:51 +08:00
|
|
|
|
class texture:public Node
|
|
|
|
|
{
|
|
|
|
|
param::ParamType texture_type;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
2019-12-20 22:08:10 +08:00
|
|
|
|
texture(const param::ParamType &pt,const UTF8String &n):Node(NodeType::Texture,n)
|
2019-12-16 20:35:51 +08:00
|
|
|
|
{
|
|
|
|
|
texture_type=pt;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const param::ParamType &GetTextureType()const{return texture_type;}
|
|
|
|
|
};//class texture:public Node
|
|
|
|
|
|
|
|
|
|
class texture1D:public texture
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
2019-12-20 22:08:10 +08:00
|
|
|
|
texture1D():texture(param::ParamType::Texture1D,"texture1d")
|
2019-12-16 20:35:51 +08:00
|
|
|
|
{
|
|
|
|
|
SHADER_INPUT_PARAM(false,U,Float1)
|
|
|
|
|
}
|
|
|
|
|
};//class texture1D:public texture
|
|
|
|
|
|
|
|
|
|
class texture2D:public texture
|
2019-12-06 21:45:51 +08:00
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
2019-12-20 22:08:10 +08:00
|
|
|
|
texture2D():texture(param::ParamType::Texture2D,"texture2d")
|
2019-12-06 21:45:51 +08:00
|
|
|
|
{
|
2019-12-16 20:35:51 +08:00
|
|
|
|
SHADER_INPUT_PARAM(false,UV,Float2)
|
2019-12-06 21:45:51 +08:00
|
|
|
|
}
|
2019-12-16 20:35:51 +08:00
|
|
|
|
};//class texture2D:public texture
|
2019-12-06 21:45:51 +08:00
|
|
|
|
|
2019-12-16 20:35:51 +08:00
|
|
|
|
class textureRect:public texture
|
2019-12-06 21:45:51 +08:00
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
2019-12-20 22:08:10 +08:00
|
|
|
|
textureRect():texture(param::ParamType::TextureRect,"textureRect")
|
2019-12-06 21:45:51 +08:00
|
|
|
|
{
|
2019-12-16 20:35:51 +08:00
|
|
|
|
SHADER_INPUT_PARAM(false,UV,UInteger2)
|
2019-12-06 21:45:51 +08:00
|
|
|
|
}
|
2019-12-16 20:35:51 +08:00
|
|
|
|
};//class textureRect:public texture
|
2019-12-06 21:45:51 +08:00
|
|
|
|
|
2019-12-16 20:35:51 +08:00
|
|
|
|
class texture3D:public texture
|
2019-12-06 21:45:51 +08:00
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
2019-12-20 22:08:10 +08:00
|
|
|
|
texture3D():texture(param::ParamType::Texture3D,"texture3d")
|
2019-12-06 21:45:51 +08:00
|
|
|
|
{
|
2019-12-16 20:35:51 +08:00
|
|
|
|
SHADER_INPUT_PARAM(false,UVD,Float3)
|
2019-12-06 21:45:51 +08:00
|
|
|
|
}
|
2019-12-16 20:35:51 +08:00
|
|
|
|
};//class texture3D:public texture
|
2019-12-06 21:45:51 +08:00
|
|
|
|
|
2019-12-16 20:35:51 +08:00
|
|
|
|
class textureCube:public texture
|
2019-12-06 21:45:51 +08:00
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
2019-12-20 22:08:10 +08:00
|
|
|
|
textureCube():texture(param::ParamType::TextureCube,"textureCube")
|
2019-12-06 21:45:51 +08:00
|
|
|
|
{
|
2019-12-16 20:35:51 +08:00
|
|
|
|
SHADER_INPUT_PARAM(false,XYZ,Float3)
|
2019-12-06 21:45:51 +08:00
|
|
|
|
}
|
2019-12-16 20:35:51 +08:00
|
|
|
|
};//class TextureCube:public texture
|
2020-01-14 18:09:40 +08:00
|
|
|
|
SHADER_NODE_NAMESPACE_END
|
2019-12-10 21:52:10 +08:00
|
|
|
|
#endif//HGL_GRAPH_SHADER_NODE_TEXTURE_INCLUDE
|