-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added level and editor camera, frustrum drawing and playing
- Loading branch information
1 parent
d8b72da
commit e4d4b10
Showing
18 changed files
with
772 additions
and
345 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
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,48 @@ | ||
#if COMPILING_VS | ||
|
||
layout (location = 0) in vec3 in_vertex; | ||
layout (location = 1) in vec2 in_texcoord; | ||
|
||
out vec2 texcoord; | ||
|
||
void main(){ | ||
gl_Position = vec4(in_vertex,1.0); | ||
texcoord = in_texcoord; | ||
} | ||
|
||
#endif | ||
|
||
#if COMPILING_FS | ||
out vec4 out_color; | ||
|
||
in vec2 texcoord; | ||
|
||
uniform sampler2D image; | ||
|
||
uniform bool horizontal; | ||
|
||
void main(){ | ||
const float weight[5] = float[] (1.f/2.f, 1.f/3.f, 1.f/4.f, 1.f/5.f, 1.f/6.f); | ||
//vec2 tex_offset = 1.0 / textureSize(image, 0); // gets size of single texel | ||
vec2 tex_offset = vec2(0.0003); | ||
vec3 result = texture(image, texcoord).rgb * weight[0]; // current fragment's contribution | ||
if(horizontal) | ||
{ | ||
for(int i = 1; i < 5; ++i) | ||
{ | ||
result += texture(image, texcoord + vec2(tex_offset.x * i, 0.0)).rgb * weight[i]; | ||
result += texture(image, texcoord - vec2(tex_offset.x * i, 0.0)).rgb * weight[i]; | ||
} | ||
} | ||
else | ||
{ | ||
for(int i = 1; i < 5; ++i) | ||
{ | ||
result += texture(image, texcoord + vec2(0.0, tex_offset.y * i)).rgb * weight[i]; | ||
result += texture(image, texcoord - vec2(0.0, tex_offset.y * i)).rgb * weight[i]; | ||
} | ||
} | ||
out_color = vec4(min(result, vec3(1.0)), 1.0); | ||
} | ||
|
||
#endif |
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
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
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
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
Oops, something went wrong.