summaryrefslogtreecommitdiff
path: root/Source/modules/asura-core/Graphics/Shader.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/modules/asura-core/Graphics/Shader.h')
-rw-r--r--Source/modules/asura-core/Graphics/Shader.h27
1 files changed, 20 insertions, 7 deletions
diff --git a/Source/modules/asura-core/Graphics/Shader.h b/Source/modules/asura-core/Graphics/Shader.h
index 615b028..6d7ef90 100644
--- a/Source/modules/asura-core/Graphics/Shader.h
+++ b/Source/modules/asura-core/Graphics/Shader.h
@@ -3,6 +3,7 @@
#include <map>
#include <string>
+#include <vector>
#include <asura-base/Exception.h>
#include <asura-base/Scripting/Scripting.h>
@@ -23,10 +24,21 @@
namespace_begin(AsuraEngine)
namespace_begin(Graphics)
+enum ShaderChannel
+{
+ SHADER_CHANNEL_NONE = -1,
+ SHADER_CHANNEL_VERTEX = 0, // Vertex (vector3)
+ SHADER_CHANNEL_NORMAL, // Normal (vector3)
+ SHADER_CHANNEL_COLOR, // Vertex color
+ SHADER_CHANNEL_TEXCOORD0, // UV set 0 (vector2)
+ SHADER_CHANNEL_TEXCOORD1, // UV set 1 (vector2)
+ SHADER_CHANNEL_TANGENT, // Tangent (vector4)
+ SHADER_CHANNEL_COUNT, // Keep this last!
+};
+
///
-/// һshaderһڲʼ乲ijShaderuniformsͶݣֻṩ uniformsuseɫ
-/// ķ༭ÿshaderͨshaderҵuniforms¶frameworkmaterial
-/// á
+/// һshaderһڲʼ乲ijShaderuniformsͶݣֻṩ uniformsuseɫķ
+/// ༭ÿshaderͨshaderҵuniforms¶frameworkmaterialá
///
class Shader ASURA_FINAL
: public Scripting::Portable<Shader>
@@ -64,10 +76,10 @@ public:
bool SetUniformTexture(uint loc, const Texture& texture);
float GetUniformFloat(uint loc);
- AEMath::Vector2f GetUniformVector2(uint loc);
- AEMath::Vector3f GetUniformVector3(uint loc);
- AEMath::Vector4f GetUniformVector4s(uint loc);
- AEMath::Matrix44 GetUniformMatrix44(uint loc);
+ Vector2f GetUniformVector2(uint loc);
+ Vector3f GetUniformVector3(uint loc);
+ Vector4f GetUniformVector4s(uint loc);
+ Matrix44 GetUniformMatrix44(uint loc);
GLuint GetGLProgram();
@@ -109,6 +121,7 @@ luaxport:
};
+// GPU program
typedef Shader GpuProgram;
namespace_end