-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add debug textures, move shader sources our of C++ code, partially fi…
…xed transforms on map.
- Loading branch information
Showing
11 changed files
with
210 additions
and
111 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#version 330 core | ||
// | ||
// This file is a part of BMEdit project | ||
// Description: Basic shader to render color filled entity & gizmo | ||
// | ||
|
||
uniform vec4 i_Color; | ||
|
||
// Out | ||
out vec4 o_FragColor; | ||
|
||
void main() | ||
{ | ||
o_FragColor = i_Color; | ||
} |
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,30 @@ | ||
#version 330 core | ||
// | ||
// This file is a part of BMEdit project | ||
// Description: Basic shader to render color filled entity & gizmo | ||
// | ||
|
||
// Layout | ||
layout (location = 0) in vec3 aPos; | ||
|
||
// Common | ||
struct Camera | ||
{ | ||
mat4 proj; | ||
mat4 view; | ||
ivec2 resolution; | ||
}; | ||
|
||
struct Transform | ||
{ | ||
mat4 model; | ||
}; | ||
|
||
// Uniforms | ||
uniform Camera i_uCamera; | ||
uniform Transform i_uTransform; | ||
|
||
void main() | ||
{ | ||
gl_Position = i_uCamera.proj * i_uCamera.view * i_uTransform.model * vec4(aPos.x, aPos.y, aPos.z, 1.0); | ||
} |
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,16 @@ | ||
#version 330 core | ||
// | ||
// This file is a part of BMEdit project | ||
// Description: Basic shader to render textured entity | ||
// | ||
|
||
uniform sampler2D i_ActiveTexture; | ||
in vec2 g_TexCoord; | ||
|
||
// Out | ||
out vec4 o_FragColor; | ||
|
||
void main() | ||
{ | ||
o_FragColor = texture(i_ActiveTexture, g_TexCoord); | ||
} |
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,35 @@ | ||
#version 330 core | ||
// | ||
// This file is a part of BMEdit project | ||
// Description: Basic shader to render textured entity | ||
// | ||
|
||
// Layout | ||
layout (location = 0) in vec3 aPos; | ||
layout (location = 1) in vec2 aUV; | ||
|
||
// Common | ||
struct Camera | ||
{ | ||
mat4 proj; | ||
mat4 view; | ||
ivec2 resolution; | ||
}; | ||
|
||
struct Transform | ||
{ | ||
mat4 model; | ||
}; | ||
|
||
// Uniforms | ||
uniform Camera i_uCamera; | ||
uniform Transform i_uTransform; | ||
|
||
// Out | ||
out vec2 g_TexCoord; | ||
|
||
void main() | ||
{ | ||
gl_Position = i_uCamera.proj * i_uCamera.view * i_uTransform.model * vec4(aPos.x, aPos.y, aPos.z, 1.0); | ||
g_TexCoord = aUV; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.