-
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.
Merge pull request #13 from arozx/my-code-sucks-to-im-rewriting-it
optimise & abstract application
- Loading branch information
Showing
71 changed files
with
28,629 additions
and
948 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 |
---|---|---|
|
@@ -16,3 +16,9 @@ todo.md | |
todo | ||
TODO | ||
.todo | ||
|
||
# Debug outputs | ||
profile_results.json | ||
profiler_n_frames.json | ||
|
||
heightmap_chunk*.bmp |
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,3 +1,4 @@ | ||
[submodule "external/imgui"] | ||
path = external/imgui | ||
url = https://github.com/ocornut/imgui.git | ||
branch = docking |
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,39 @@ | ||
|
||
#version 330 core | ||
|
||
in vec2 v_TexCoord; | ||
in vec3 v_Normal; | ||
in vec3 v_FragPos; | ||
|
||
uniform vec3 u_LightPos; | ||
uniform vec3 u_ViewPos; | ||
uniform vec4 u_Color; | ||
uniform sampler2D u_Texture; | ||
|
||
uniform vec3 u_LightColor; | ||
uniform float u_AmbientStrength; | ||
uniform float u_SpecularStrength; | ||
uniform float u_Shininess; | ||
|
||
out vec4 FragColor; | ||
|
||
void main() { | ||
// Ambient | ||
vec3 ambient = u_AmbientStrength * u_LightColor; | ||
|
||
// Diffuse | ||
vec3 norm = normalize(v_Normal); | ||
vec3 lightDir = normalize(u_LightPos - v_FragPos); | ||
float diff = max(dot(norm, lightDir), 0.0); | ||
vec3 diffuse = diff * u_LightColor; | ||
|
||
// Specular | ||
vec3 viewDir = normalize(u_ViewPos - v_FragPos); | ||
vec3 reflectDir = reflect(-lightDir, norm); | ||
float spec = pow(max(dot(viewDir, reflectDir), 0.0), u_Shininess); | ||
vec3 specular = u_SpecularStrength * spec * u_LightColor; | ||
|
||
vec4 texColor = texture(u_Texture, v_TexCoord) * u_Color; | ||
vec3 result = (ambient + diffuse + specular) * texColor.rgb; | ||
FragColor = vec4(result, texColor.a); | ||
} |
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,20 @@ | ||
|
||
#version 330 core | ||
|
||
layout(location = 0) in vec3 aPosition; | ||
layout(location = 1) in vec2 aTexCoord; | ||
layout(location = 2) in vec3 aNormal; | ||
|
||
uniform mat4 u_ViewProjection; | ||
uniform mat4 u_Transform; | ||
|
||
out vec2 v_TexCoord; | ||
out vec3 v_Normal; | ||
out vec3 v_FragPos; | ||
|
||
void main() { | ||
v_TexCoord = aTexCoord; | ||
v_Normal = mat3(transpose(inverse(u_Transform))) * aNormal; | ||
v_FragPos = vec3(u_Transform * vec4(aPosition, 1.0)); | ||
gl_Position = u_ViewProjection * u_Transform * vec4(aPosition, 1.0); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Submodule imgui
updated
78 files
Oops, something went wrong.