refactor shader constants
This commit is contained in:
parent
d09119f9d7
commit
d90fccb014
@ -32,6 +32,11 @@ def create_dashed_line_shader() -> gpu.types.GPUShader:
|
|||||||
shader_info = gpu.types.GPUShaderCreateInfo()
|
shader_info = gpu.types.GPUShaderCreateInfo()
|
||||||
|
|
||||||
shader_info.vertex_in(0, "VEC2", "pos")
|
shader_info.vertex_in(0, "VEC2", "pos")
|
||||||
|
shader_info.fragment_out(0, "VEC4", "fragColor")
|
||||||
|
shader_info.push_constant("VEC4", "color")
|
||||||
|
shader_info.push_constant("MAT4", "viewMatrix")
|
||||||
|
shader_info.push_constant("FLOAT", "dashSize")
|
||||||
|
shader_info.push_constant("FLOAT", "gapSize")
|
||||||
|
|
||||||
shader_info.vertex_source(vertex_shader)
|
shader_info.vertex_source(vertex_shader)
|
||||||
shader_info.fragment_source(fragment_shader)
|
shader_info.fragment_source(fragment_shader)
|
||||||
|
|||||||
@ -2,11 +2,11 @@
|
|||||||
flat in vec2 startPos;
|
flat in vec2 startPos;
|
||||||
in vec2 vertPos;
|
in vec2 vertPos;
|
||||||
|
|
||||||
out vec4 fragColor;
|
// out vec4 fragColor;
|
||||||
|
|
||||||
uniform vec4 color;
|
// uniform vec4 color;
|
||||||
uniform float dashSize;
|
// uniform float dashSize;
|
||||||
uniform float gapSize;
|
// uniform float gapSize;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
flat out vec2 startPos;
|
flat out vec2 startPos;
|
||||||
out vec2 vertPos;
|
out vec2 vertPos;
|
||||||
|
|
||||||
uniform mat4 viewMatrix;
|
// uniform mat4 viewMatrix;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user