-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ffcab0
commit 6f7f9f2
Showing
15 changed files
with
396 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
AssetRegistry: | ||
- Handle: 14815285158415 | ||
Path: Texture/Characters/SpaceShip.png | ||
Type: AssetType::Texture2D | ||
Type: AssetType::Texture2D | ||
- Handle: 45120015123131 | ||
Path: Texture/Tiles/Obstacle.png | ||
Type: AssetType::Texture2D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Project: | ||
Name: FlappyBird | ||
AssetsDirectory: "" | ||
AssetRegistryPath: "AssetRegistry.asset" |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#type vertex | ||
#version 450 core | ||
|
||
layout(location = 0) in vec3 a_WorldPosition; | ||
layout(location = 1) in vec3 a_LocalPosition; | ||
layout(location = 2) in vec4 a_Color; | ||
layout(location = 3) in float a_Thickness; | ||
layout(location = 4) in float a_Fade; | ||
layout(location = 6) in int a_EntityID; | ||
|
||
layout(std140, binding = 0) uniform Camera | ||
{ | ||
mat4 u_ViewProjection; | ||
}; | ||
|
||
struct VertexOutput | ||
{ | ||
vec3 LocalPosition; | ||
vec4 Color; | ||
float Thickness; | ||
float Fade; | ||
}; | ||
|
||
layout(location = 0) out VertexOutput Output; | ||
layout(location = 4) out flat int v_EntityID; | ||
|
||
void main() | ||
{ | ||
Output.LocalPosition = a_LocalPosition; | ||
Output.Color = a_Color; | ||
Output.Thickness = a_Thickness; | ||
Output.Fade = a_Fade; | ||
|
||
v_EntityID = a_EntityID; | ||
|
||
gl_Position = u_ViewProjection * vec4(a_WorldPosition, 1.0); | ||
} | ||
|
||
#type fragment | ||
#version 450 core | ||
|
||
layout(location = 0) out vec4 Color; | ||
layout(location = 1) out int EntityID; | ||
|
||
struct VertexOutput | ||
{ | ||
vec3 LocalPosition; | ||
vec4 Color; | ||
float Thickness; | ||
float Fade; | ||
}; | ||
|
||
layout(location = 0) in VertexOutput Input; | ||
layout(location = 4) in flat int v_EntityID; | ||
|
||
void main() | ||
{ | ||
// Calculate the distance and fill circle with white | ||
float distance = 1.0 - length(Input.LocalPosition); | ||
float circle = smoothstep(0.0, Input.Fade, distance); | ||
|
||
circle *= smoothstep(Input.Thickness + Input.Fade, Input.Thickness, distance); | ||
|
||
if (circle == 0.0) | ||
discard; | ||
|
||
Color = Input.Color; | ||
Color *= circle; | ||
|
||
EntityID = v_EntityID; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#type vertex | ||
#version 450 core | ||
|
||
layout(location = 0) in vec3 a_Position; | ||
layout(location = 1) in vec4 a_Color; | ||
layout(location = 2) in int a_EntityID; | ||
|
||
layout(std140, binding = 0) uniform Camera | ||
{ | ||
mat4 u_ViewProjection; | ||
}; | ||
|
||
struct VertexOutput | ||
{ | ||
vec4 Color; | ||
}; | ||
|
||
layout(location = 0) out VertexOutput Output; | ||
layout(location = 1) out flat int v_EntityID; | ||
|
||
void main() | ||
{ | ||
Output.Color = a_Color; | ||
|
||
v_EntityID = a_EntityID; | ||
|
||
gl_Position = u_ViewProjection * vec4(a_Position, 1.0); | ||
} | ||
|
||
#type fragment | ||
#version 450 core | ||
|
||
layout(location = 0) out vec4 o_Color; | ||
layout(location = 1) out int o_EntityID; | ||
|
||
struct VertexOutput | ||
{ | ||
vec4 Color; | ||
}; | ||
|
||
layout(location = 0) in VertexOutput Input; | ||
layout(location = 1) in flat int v_EntityID; | ||
|
||
void main() | ||
{ | ||
o_Color = Input.Color; | ||
o_EntityID = v_EntityID; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
// Basic Texture Shader | ||
// Compatible with Exodia Game Engine | ||
|
||
#type vertex | ||
#version 450 core | ||
|
||
layout(location = 0) in vec3 a_Position; | ||
layout(location = 1) in vec4 a_Color; | ||
layout(location = 2) in vec2 a_TexCoord; | ||
layout(location = 3) in float a_TexIndex; | ||
layout(location = 4) in float a_TilingFactor; | ||
layout(location = 5) in int a_EntityID; | ||
|
||
layout(std140, binding = 0) uniform Camera | ||
{ | ||
mat4 u_ViewProjection; | ||
}; | ||
|
||
struct VertexOutput | ||
{ | ||
vec4 Color; | ||
vec2 TexCoord; | ||
float TilingFactor; | ||
}; | ||
|
||
layout(location = 0) out VertexOutput Output; | ||
layout(location = 3) out flat float v_TexIndex; | ||
layout(location = 4) out flat int v_EntityID; | ||
|
||
void main() | ||
{ | ||
Output.Color = a_Color; | ||
Output.TexCoord = a_TexCoord; | ||
Output.TilingFactor = a_TilingFactor; | ||
|
||
v_TexIndex = a_TexIndex; | ||
v_EntityID = a_EntityID; | ||
|
||
gl_Position = u_ViewProjection * vec4(a_Position, 1.0); | ||
} | ||
|
||
#type fragment | ||
#version 450 core | ||
|
||
layout(location = 0) out vec4 o_Color; | ||
layout(location = 1) out int o_EntityID; | ||
|
||
struct VertexOutput | ||
{ | ||
vec4 Color; | ||
vec2 TexCoord; | ||
float TilingFactor; | ||
}; | ||
|
||
layout(location = 0) in VertexOutput Input; | ||
layout(location = 3) in flat float v_TexIndex; | ||
layout(location = 4) in flat int v_EntityID; | ||
layout(binding = 0) uniform sampler2D u_Textures[32]; | ||
|
||
void main() | ||
{ | ||
vec4 texColor = Input.Color; | ||
|
||
switch (int(v_TexIndex)) { | ||
case 0: | ||
texColor *= texture(u_Textures[ 0], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 1: | ||
texColor *= texture(u_Textures[ 1], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 2: | ||
texColor *= texture(u_Textures[ 2], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 3: | ||
texColor *= texture(u_Textures[ 3], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 4: | ||
texColor *= texture(u_Textures[ 4], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 5: | ||
texColor *= texture(u_Textures[ 5], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 6: | ||
texColor *= texture(u_Textures[ 6], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 7: | ||
texColor *= texture(u_Textures[ 7], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 8: | ||
texColor *= texture(u_Textures[ 8], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 9: | ||
texColor *= texture(u_Textures[ 9], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 10: | ||
texColor *= texture(u_Textures[10], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 11: | ||
texColor *= texture(u_Textures[11], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 12: | ||
texColor *= texture(u_Textures[12], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 13: | ||
texColor *= texture(u_Textures[13], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 14: | ||
texColor *= texture(u_Textures[14], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 15: | ||
texColor *= texture(u_Textures[15], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 16: | ||
texColor *= texture(u_Textures[16], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 17: | ||
texColor *= texture(u_Textures[17], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 18: | ||
texColor *= texture(u_Textures[18], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 19: | ||
texColor *= texture(u_Textures[19], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 20: | ||
texColor *= texture(u_Textures[20], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 21: | ||
texColor *= texture(u_Textures[21], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 22: | ||
texColor *= texture(u_Textures[22], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 23: | ||
texColor *= texture(u_Textures[23], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 24: | ||
texColor *= texture(u_Textures[24], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 25: | ||
texColor *= texture(u_Textures[25], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 26: | ||
texColor *= texture(u_Textures[26], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 27: | ||
texColor *= texture(u_Textures[27], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 28: | ||
texColor *= texture(u_Textures[28], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 29: | ||
texColor *= texture(u_Textures[29], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 30: | ||
texColor *= texture(u_Textures[30], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
case 31: | ||
texColor *= texture(u_Textures[31], Input.TexCoord * Input.TilingFactor); | ||
break; | ||
} | ||
|
||
if (texColor.a == 0.0) | ||
discard; | ||
|
||
o_Color = texColor; | ||
o_EntityID = v_EntityID; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.