2D Sprite Renderer and sprite framework, Began additional OpenGL Renderer, started transitioning multiplayer networking to use Java NIO
This commit is contained in:
parent
5a05b9d65e
commit
3e886e5ba8
165 changed files with 4460 additions and 5485 deletions
9
resources/EngineResources/GLShaders/scene_frag.glsl
Normal file
9
resources/EngineResources/GLShaders/scene_frag.glsl
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#version 330
|
||||
|
||||
in vec3 outColour;
|
||||
out vec4 fragColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
fragColor = vec4(outColour, 1.0);
|
||||
}
|
||||
12
resources/EngineResources/GLShaders/scene_vert.glsl
Normal file
12
resources/EngineResources/GLShaders/scene_vert.glsl
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#version 330
|
||||
|
||||
layout (location=0) in vec3 position;
|
||||
layout (location=1) in vec3 colour;
|
||||
|
||||
out vec3 outColour;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = vec4(position, 1.0);
|
||||
outColour = colour;
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@ layout(location = 0) in vec2 inUV;
|
|||
|
||||
layout(location = 0) out vec4 outColor;
|
||||
layout(push_constant) uniform pc {
|
||||
layout(offset = 24) uint textureIndex;
|
||||
layout(offset = 28) uint textureIndex;
|
||||
} push_constants;
|
||||
|
||||
layout(set = 1, binding = 0) uniform sampler2D spriteTextures[MAX_TEXTURES];
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ layout(location = 0) in vec2 inUV;
|
|||
|
||||
layout(location = 0) out vec4 outColor;
|
||||
layout(push_constant) uniform pc {
|
||||
layout(offset = 24) uint textureIndex;
|
||||
layout(offset = 28) uint textureIndex;
|
||||
} push_constants;
|
||||
|
||||
layout(set = 1, binding = 0) uniform sampler2D spriteTextures[MAX_TEXTURES];
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ layout(push_constant) uniform pc {
|
|||
vec2 modelSize;
|
||||
vec2 position;
|
||||
vec2 screenSize;
|
||||
|
||||
float zAmount;
|
||||
} push_constants;
|
||||
|
||||
layout(set = 0, binding = 0) uniform ViewUniform{
|
||||
|
|
@ -22,7 +22,7 @@ layout(set = 0, binding = 0) uniform ViewUniform{
|
|||
void main() {
|
||||
vec2 ScaledPos = inPos * push_constants.modelSize;
|
||||
vec2 worldPos = push_constants.position + ScaledPos;
|
||||
worldPos += viewUniform.camPos;
|
||||
worldPos += (viewUniform.camPos * push_constants.zAmount);
|
||||
vec2 ndc = vec2(
|
||||
(worldPos.x / push_constants.screenSize.x) * 2.0 - 1.0,
|
||||
(worldPos.y / push_constants.screenSize.y) * 2.0 - 1.0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue