sokol sprite render
This commit is contained in:
@@ -2,18 +2,11 @@
|
||||
layout (location = 0) in vec4 vertex;
|
||||
out vec2 coords;
|
||||
|
||||
layout (std140) uniform Projection
|
||||
{
|
||||
mat4 projection;
|
||||
};
|
||||
|
||||
layout (std140) uniform Resolution
|
||||
{
|
||||
vec2 resolution;
|
||||
};
|
||||
uniform mat4 proj;
|
||||
uniform vec2 res;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = projection * vec4(vertex.xy, 0.0, 1.0);
|
||||
coords = vertex.zw;;
|
||||
gl_Position = proj * vec4(vertex.xy, 0.0, 1.0);
|
||||
coords = vertex.zw;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#version 330 core
|
||||
in vec2 texcoords;
|
||||
out vec4 color;
|
||||
|
||||
uniform sampler2D image;
|
||||
uniform vec3 spriteColor;
|
||||
|
||||
|
||||
@@ -2,15 +2,10 @@
|
||||
layout (location = 0) in vec4 vertex;
|
||||
out vec2 texcoords;
|
||||
|
||||
layout (std140) uniform Projection
|
||||
{
|
||||
mat4 projection;
|
||||
};
|
||||
|
||||
uniform mat4 model;
|
||||
uniform mat4 mpv;
|
||||
|
||||
void main()
|
||||
{
|
||||
texcoords = vertex.zw;
|
||||
gl_Position = projection * model * vec4(vertex.xy, 0.0, 1.0);
|
||||
}
|
||||
gl_Position = mpv * vec4(vertex.xy, 0.0, 1.0);
|
||||
}
|
||||
|
||||
@@ -2,10 +2,7 @@
|
||||
layout (location = 0) in vec4 vertex; // <vec2 pos, vec2 tex>
|
||||
out vec2 TexCoords;
|
||||
|
||||
layout (std140) uniform Projection
|
||||
{
|
||||
mat4 projection;
|
||||
};
|
||||
uniform mat4 projection;
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user