moved glsl to standalone .glsl file.
This commit is contained in:
11
ShaderLibrary/GetJointMatrix.glsl
Normal file
11
ShaderLibrary/GetJointMatrix.glsl
Normal file
@@ -0,0 +1,11 @@
|
||||
mat4 GetJointMatrix()
|
||||
{
|
||||
// Joint数据分Joint ID和Joint Weight两部分
|
||||
// Joint ID是一个uvec4,在shader中为整数。在C++端可使用RGBA8UI或是RGBA16UI来传递。
|
||||
// Joint Weight是权重,在shader中为浮点。在C++端使用RGBA8或RGBA4来传递。
|
||||
|
||||
return joint.mats[JointID.x]*JointWeight.x+
|
||||
joint.mats[JointID.y]*JointWeight.y+
|
||||
joint.mats[JointID.z]*JointWeight.z+
|
||||
joint.mats[JointID.w]*JointWeight.w;
|
||||
}
|
4
ShaderLibrary/GetLocalToWorld.glsl
Normal file
4
ShaderLibrary/GetLocalToWorld.glsl
Normal file
@@ -0,0 +1,4 @@
|
||||
mat4 GetLocalToWorld()
|
||||
{
|
||||
return l2w.mats[Assign.x];
|
||||
}
|
8
ShaderLibrary/GetMI.glsl
Normal file
8
ShaderLibrary/GetMI.glsl
Normal file
@@ -0,0 +1,8 @@
|
||||
MaterialInstance GetMI()
|
||||
{
|
||||
#if ShaderStage == VertexShader
|
||||
return mtl.mi[Assign.y];
|
||||
#else
|
||||
return mtl.mi[Input.MaterialInstanceID];
|
||||
#endif
|
||||
}
|
10
ShaderLibrary/HandoverMI.glsl
Normal file
10
ShaderLibrary/HandoverMI.glsl
Normal file
@@ -0,0 +1,10 @@
|
||||
void HandoverMI()
|
||||
{
|
||||
#if ShaderStage == VertexShader
|
||||
Output.MaterialInstanceID=Assign.y;
|
||||
#elif ShaderStage == GeometryShader
|
||||
Output.MaterialInstanceID=Input[0].MaterialInstanceID;
|
||||
#else
|
||||
Output.MaterialInstanceID=Input.MaterialInstanceID;
|
||||
#endif
|
||||
}
|
10
ShaderLibrary/ShaderHeader.glsl
Normal file
10
ShaderLibrary/ShaderHeader.glsl
Normal file
@@ -0,0 +1,10 @@
|
||||
#version 460 core
|
||||
|
||||
#define VertexShader 0x01
|
||||
#define TessControlShader 0x02
|
||||
#define TeseEvalShader 0x04
|
||||
#define GeometryShader 0x08
|
||||
#define FragmentShader 0x10
|
||||
#define ComputeShader 0x20
|
||||
#define TaskShader 0x40
|
||||
#define MeshShader 0x80
|
Reference in New Issue
Block a user