[WIP] Billboard(the 2d way)
Two Modes: 1.fixed billboard size,the size in UBO 2.dynamic billboard size,the size in VAB two modes to use GeometryShader, convert point/line data to quad data.
This commit is contained in:
43
ShaderLibrary/Std3D/Billboard/2DWay.mtl
Normal file
43
ShaderLibrary/Std3D/Billboard/2DWay.mtl
Normal file
@@ -0,0 +1,43 @@
|
||||
#Material
|
||||
Name Billboard2DWay
|
||||
Base Std3D/Billboard
|
||||
|
||||
#VertexInput
|
||||
vec2 TexCoord
|
||||
|
||||
#Vertex
|
||||
Output
|
||||
{
|
||||
vec2 TexCoord
|
||||
}
|
||||
|
||||
Code
|
||||
{
|
||||
void main()
|
||||
{
|
||||
Output.TexCoord=TexCoord;
|
||||
|
||||
vec4 pos=GetPosition3D()
|
||||
+camera.camera_right*TexCoord.x*Billboard.Size.x
|
||||
+camera.camera_up *TexCoord.y*Billboard.Size.y;
|
||||
|
||||
gl_Position=GetPosition3D();
|
||||
}
|
||||
}
|
||||
|
||||
#Fragment
|
||||
|
||||
sampler2D TextureBaseColor
|
||||
|
||||
Output
|
||||
{
|
||||
vec4 FragColor;
|
||||
}
|
||||
|
||||
Code
|
||||
{
|
||||
void main()
|
||||
{
|
||||
FragColor=texture(TextureBaseColor,Input.TexCoord);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user