Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
ec56851
buildsystem: inotify package search name lowercased
TheJJ Apr 19, 2015
47023b7
buildsystem: implemented vulkan cmake module
TheJJ Apr 19, 2015
fa04522
buildsystem: integrated vulkan and opengl detection
TheJJ Apr 19, 2015
6c228e7
renderer: modular render window and context creation
TheJJ Apr 20, 2015
d1d59c0
renderer: legacy opengl square rendering
TheJJ Jun 25, 2015
6454fc8
renderer: initial generic texture implementation
TheJJ Jun 29, 2015
418838f
renderer: rendering quad with opengl 3.3
TheJJ Jun 29, 2015
8e170d7
renderer: texture and shader creation abstractions
TheJJ Aug 10, 2015
ed60e49
renderer: use the full framebuffer for the test quad
TheJJ Aug 11, 2015
0902c83
renderer: implemented loading shaders from file
TheJJ Aug 11, 2015
9509f1b
renderer: initially integrated into the engine
TheJJ Aug 12, 2015
fdb85f6
renderer: renamed pipeline Program to RawProgram
TheJJ Aug 13, 2015
629a86e
renderer: moved program api contents to separate files
TheJJ Aug 13, 2015
c53f4cd
renderer: initial pipeline variable abstraction
TheJJ Aug 25, 2015
594544f
renderer: demo id selection via cython
TheJJ Sep 15, 2015
3094067
renderer: first successful texture draw
TheJJ Sep 15, 2015
a16d989
renderer: basic uniform variable abstraction
TheJJ Sep 16, 2015
b1b62b4
renderer: implemented vertex attribute packing and uploading
TheJJ Sep 18, 2015
c903e31
renderer: drawing texture with pipeline abstraction
TheJJ Sep 20, 2015
6b4eaa7
renderer: made error checking context-dependent
TheJJ Oct 2, 2015
23f2f3f
renderer: only upload gpu buffer when changed.
TheJJ Oct 21, 2015
0c1ef26
renderer: towards render tasks by storing uniform state
TheJJ Nov 5, 2015
7170d60
renderer: opengl version checking
Vtec234 Nov 8, 2016
d48a9de
engine: adjust new upstream changes to renderer branch changes
Vtec234 Nov 8, 2016
4f7993b
renderer: resource loading refactor
Vtec234 Jan 14, 2017
a36d4d5
renderer: begin major refactor
Vtec234 Mar 12, 2017
9354698
engine: revert changes
Vtec234 Apr 10, 2017
77cb221
renderer: first working version
Vtec234 Apr 11, 2017
05b3991
renderer: documentation and progress
Vtec234 Apr 12, 2017
c2dc925
renderer: screenshots
Vtec234 Apr 13, 2017
e352ab5
renderer: fix glsl parsing
Vtec234 Apr 14, 2017
182065c
renderer: documentation and small interface changes
Vtec234 Apr 14, 2017
d920560
First work on pixel-perfect hitbox, minor changes
citron0xa9 Apr 17, 2017
bd6bcc5
Working optional id write also dependent on alpha value. A bit hacky
citron0xa9 Apr 18, 2017
0cd4208
renderer: add row alignment support for textures; add support for rea…
Vtec234 Apr 21, 2017
1085d12
Extracting id from pixel value improved, added missing glPixelStorei
citron0xa9 Apr 22, 2017
71a679e
Simplified id drawing, using 32 bit ids now
citron0xa9 Apr 22, 2017
f74561a
WIP: Using VBO's and VAO's for drawing, matrix transformations tests
citron0xa9 Apr 30, 2017
e43f521
Enabled depth testing (added depth texture to FBO)
citron0xa9 May 1, 2017
625476c
renderer: small shader fix to avoid invalid uniforms
Vtec234 May 11, 2017
9d9d156
renderer: add more uniform types
Vtec234 May 11, 2017
197c2b9
renderer: add MeshData, move quad geometry there; make classes final;…
Vtec234 May 12, 2017
113388d
renderer: misc fixes and removals
Vtec234 May 12, 2017
38bd3ee
renderer: add support for meshed geometry
Vtec234 May 15, 2017
1b178ac
renderer: delete old files
Vtec234 May 15, 2017
b0fa07f
renderer: shader improvements, uniform and attribute parsing
Vtec234 May 15, 2017
eabebbb
add self to mailmap
Vtec234 May 15, 2017
4037e62
renderer: fix IDs and add more textures support
Vtec234 May 15, 2017
5a9d6be
renderer: fix build
Vtec234 May 15, 2017
1593ff2
renderer: add headers without implementations to CMakeLists to make Q…
Vtec234 May 15, 2017
76ca26f
renderer: refactor
Vtec234 May 17, 2017
d52cc0b
renderer: fix compiler errors after rebase
Vtec234 May 19, 2017
086a23a
renderer: terrain prototype
citron0xa9 Jun 2, 2017
23650fc
renderer: initial Vulkan framework
Vtec234 Sep 9, 2017
aadf4f8
renderer: Draw Gaben
Vtec234 Jan 3, 2018
ec9da33
renderer: screenshot support and refactor window
Vtec234 Jan 3, 2018
69fc6ea
renderer: support for Ubuntu 16
Vtec234 Jan 19, 2018
f46b20c
Update texture_data.cpp
surajhanchinal Jan 20, 2018
d112557
Update mesh_data.h
surajhanchinal Jan 24, 2018
5af236c
Update tests.cpp
surajhanchinal Jan 24, 2018
c45a488
Update mesh_data.cpp
surajhanchinal Jan 24, 2018
b60aa2d
Update tests.cpp
surajhanchinal Jan 25, 2018
799e250
New files for testing new features
surajhanchinal Mar 22, 2018
7766c7a
adding new classes for modular rendering
surajhanchinal Mar 22, 2018
7d8b5b8
first commit
surajhanchinal May 10, 2018
8baede0
texture manager v1
surajhanchinal May 11, 2018
a28e801
TextureManager v3
surajhanchinal May 11, 2018
292dc99
Delete test_before_lot_of_messing.cpp
surajhanchinal May 11, 2018
642826b
Delete test_fail.cpp
surajhanchinal May 11, 2018
f2a8f06
Delete temp_comm.cpp
surajhanchinal May 11, 2018
d7f06ce
Delete suraj.cpp
surajhanchinal May 11, 2018
bede635
Delete sprite2.cpp
surajhanchinal May 11, 2018
8ad62a9
Delete sprite2.h
surajhanchinal May 11, 2018
2c2fd97
remove unnecessary files
surajhanchinal May 11, 2018
f80b9c4
ignore textures and copyrighted assets
surajhanchinal May 11, 2018
8a956be
update gitignore
surajhanchinal May 11, 2018
e4dcead
removing unnecessary files
surajhanchinal May 11, 2018
6e0aceb
commit
surajhanchinal May 11, 2018
dbfcd7d
texture manager terrain v1
surajhanchinal May 14, 2018
c872a00
stress test
surajhanchinal May 14, 2018
0413486
RVO integration
surajhanchinal May 15, 2018
b98f9cc
testing phase
surajhanchinal May 17, 2018
5ded02c
vertexrenderer
surajhanchinal May 18, 2018
be12b51
Testing the renderer
surajhanchinal May 18, 2018
2b2ad9e
added texture array support
surajhanchinal May 20, 2018
f957e81
removing RVO library and adding TerrainManager class
surajhanchinal May 21, 2018
8083d1a
adding TerrainManager Class
surajhanchinal Jun 2, 2018
615046e
added more abstraction to TerrainManager
surajhanchinal Jun 10, 2018
6a83f98
removed test class
surajhanchinal Jun 11, 2018
5f3d773
removed .vscode from version control
surajhanchinal Jun 11, 2018
31dd5ff
properly removed .vscode folder
surajhanchinal Jun 11, 2018
69f17a7
removed unused perspective.h
surajhanchinal Jun 11, 2018
5c3aa4d
removing unused libraries
surajhanchinal Jun 12, 2018
54eb090
better fps counter
surajhanchinal Jun 12, 2018
b2e6b09
testing mulitple renderables
surajhanchinal Jun 15, 2018
0627ecc
some more tests with renderable
surajhanchinal Jun 15, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ perf.data*
/GPATH
/GRTAGS
/GTAGS
#copyrighted assets
/assets/converted/
/assets/terrain/
.vscode/settings.json
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ Henry Snoek <?> <snoek09@users.noreply.github.com>
coop shell (Michael Enßlin, Jonas Jelten, Andre Kupka) <coop@sft.mx>
Franz-Niclas Muschter <fm@stusta.net> <franz-niclas.muschter@stusta.net>
Niklas Fiekas <niklas.fiekas@backscattering.de> <niklas.fiekas@tu-clausthal.de>
Wojciech Nawrocki <wjnawrocki@protonmail.com> <wjnawrocki+gh@protonmail.com>
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ if(NOT DEFINED WANT_INOTIFY)
set(WANT_INOTIFY if_available)
endif()

if(NOT DEFINED WANT_OPENGL)
set(WANT_OPENGL if_available)
endif()

if(NOT DEFINED WANT_VULKAN)
set(WANT_VULKAN if_available)
endif()

if(NOT DEFINED WANT_GPERFTOOLS_PROFILER)
set(WANT_GPERFTOOLS_PROFILER if_available)
endif()
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Technology | Component
**Qt5** | Graphical user interface
**Cython** | Glue code
**CMake** | Build system
**OpenGL2.1** | Rendering, shaders
**OpenGL3.3** | Rendering, shaders
**SDL2** | Cross-platform Audio/Input/Window handling
**Opus** | Audio codec
**Humans** | Mixing together all of the above
Expand Down
Binary file added assets/screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions assets/test_shaders/alphamask.frag.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// alpha masking shader
//
// applies an alpha mask texture to a base texture,
// then draws the masked texture.
#version 330

// the base and mask texture, base is the plain terrain tile
uniform sampler2D base_texture;
uniform sampler2D mask_texture;

// disable blending and show the mask instead
//uniform bool show_mask;

// get those interpolated texture position from vertexshader
in vec2 base_tex_position;
in vec2 mask_tex_position;

layout(location=0) out vec4 blended_pixel;

void main() {
// get the texel from the uniform texture.
vec4 base_pixel = texture2D(base_texture, base_tex_position);
vec4 mask_pixel = texture2D(mask_texture, mask_tex_position);

//float factor = 1.0 - mask_pixel.x;
float factor = mask_pixel.x;
vec4 blended_pixel = vec4(base_pixel.r, base_pixel.g, base_pixel.b, base_pixel.a - factor);

//if (0) {
// gl_FragColor = mask_pixel;
//} else {
gl_FragColor = blended_pixel;
//}
}
25 changes: 25 additions & 0 deletions assets/test_shaders/alphamask.vert.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// vertex shader for applying an alpha mask to a texture
#version 330

// modelview*projection matrix
uniform mat4 mvp_matrix;

// the position of this vertex
layout(location=0) in vec2 vertex_position;

// send the texture coordinates to the fragmentshader
layout(location=1) in vec2 base_tex_coordinates;
layout(location=2) in vec2 mask_tex_coordinates;

// send the texture coordinates to the fragmentshader
out vec2 base_tex_position;
out vec2 mask_tex_position;

void main(void) {
// transform the position with the mvp matrix
gl_Position = mvp_matrix * vec4(vertex_position,0.0,1.0);

// set the fixpoints for the tex coordinates at this vertex
mask_tex_position = mask_tex_coordinates;
base_tex_position = base_tex_coordinates;
}
157 changes: 157 additions & 0 deletions assets/test_shaders/batch.frag.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
#version 330 core
out vec4 FragColor;

in vec4 ourColor;
in vec2 pos;
in vec2 uv;
in float a_id;
uniform vec2 mouse_pos = vec2(0.0,0.0);

uniform sampler2D texture_0;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid this horrible duplication, a sampler2DArray would serve well.

uniform sampler2D texture_1;
uniform sampler2D texture_2;
uniform sampler2D texture_3;
uniform sampler2D texture_4;
uniform sampler2D texture_5;
uniform sampler2D texture_6;
uniform sampler2D texture_7;
uniform sampler2D texture_8;
uniform sampler2D texture_9;
uniform sampler2D texture_10;
uniform sampler2D texture_11;
uniform sampler2D texture_12;
uniform sampler2D texture_13;
uniform sampler2D texture_14;
uniform sampler2D texture_15;
uniform sampler2D texture_16;
uniform sampler2D texture_17;
uniform sampler2D texture_18;
uniform sampler2D texture_19;
uniform sampler2D texture_20;
uniform sampler2D texture_21;
uniform sampler2D texture_22;
uniform sampler2D texture_23;
uniform sampler2D texture_24;
uniform sampler2D texture_25;
uniform sampler2D texture_26;
uniform sampler2D texture_27;
uniform sampler2D texture_28;
uniform sampler2D texture_29;
uniform sampler2D texture_30;
uniform sampler2D texture_31;

void switcher(in int index,out vec4 color){

switch(index){
case 0:
color = texture(texture_0, uv);
break;
case 1:
color = texture(texture_1, uv);
break;
case 2:
color = texture(texture_2, uv);
break;
case 3:
color = texture(texture_3, uv);
break;
case 4:
color = texture(texture_4, uv);
break;
case 5:
color = texture(texture_5, uv);
break;
case 6:
color = texture(texture_6, uv);
break;
case 7:
color = texture(texture_7, uv);
break;
case 8:
color = texture(texture_8, uv);
break;
case 9:
color = texture(texture_9, uv);
break;
case 10:
color = texture(texture_10, uv);
break;
case 11:
color = texture(texture_11, uv);
break;
case 12:
color = texture(texture_12, uv);
break;
case 13:
color = texture(texture_13, uv);
break;
case 14:
color = texture(texture_14, uv);
break;
case 15:
color = texture(texture_15, uv);
break;
case 16:
color = texture(texture_16, uv);
break;
case 17:
color = texture(texture_17, uv);
break;
case 18:
color = texture(texture_18, uv);
break;
case 19:
color = texture(texture_19, uv);
break;
case 20:
color = texture(texture_20, uv);
break;
case 21:
color = texture(texture_21, uv);
break;
case 22:
color = texture(texture_22, uv);
break;
case 23:
color = texture(texture_23, uv);
break;
case 24:
color = texture(texture_24, uv);
break;
case 25:
color = texture(texture_25, uv);
break;
case 26:
color = texture(texture_26, uv);
break;
case 27:
color = texture(texture_27, uv);
break;
case 28:
color = texture(texture_28, uv);
break;

case 29:
color = texture(texture_29, uv);
break;
case 30:
color = texture(texture_30, uv);
break;

case 31:
color = texture(texture_31, uv);
break;
}
}
void main()
{
float intensity = 500.0/(length(pos - mouse_pos));
FragColor = ourColor*intensity;
if(a_id != -1.0){
int index = int(a_id + 0.5);
vec4 tex_color;
switcher(index,tex_color);
FragColor = tex_color;//*intensity;
}

}
27 changes: 27 additions & 0 deletions assets/test_shaders/batch.vert.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#version 330 core
layout (location = 0) in vec2 aPos;
layout (location = 1) in vec4 aColor;
layout (location = 2) in vec2 auv;
layout (location = 3) in float active_id;
layout (location = 4) in float is_terrain;
uniform mat4 ortho = mat4(1.0);
uniform mat4 dimet = mat4(1.0);
out vec4 ourColor;
out vec2 pos;
out vec2 uv;
out float a_id;



void main()
{
if(is_terrain == 1.0){
gl_Position = ortho*dimet*vec4(aPos,0.0, 1.0);
}
else
gl_Position = ortho*vec4(aPos,0.0, 1.0);
ourColor = aColor;
pos =aPos;
uv = auv;
a_id = active_id;
}
10 changes: 10 additions & 0 deletions assets/test_shaders/fshader_display_src.frag.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#version 330

uniform sampler2D color_texture;

in vec2 v_uv;
out vec4 col;

void main() {
col = texture(color_texture, v_uv);
}
17 changes: 17 additions & 0 deletions assets/test_shaders/fshader_src.frag.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#version 330

in vec2 v_uv;
uniform sampler2D tex;
uniform uint u_id;

layout(location=0) out vec4 col;
layout(location=1) out uint id;

void main() {
vec4 tex_val = texture(tex, v_uv);
if (tex_val.a == 0) {
discard;
}
col = tex_val;
id = u_id + 1u;
}
15 changes: 15 additions & 0 deletions assets/test_shaders/not_batch.frag.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#version 330 core
out vec4 FragColor;

in vec4 ourColor;
in vec2 pos;
in vec2 auv;
uniform sampler2DArray texture_array;
uniform int layer = 0;
//uniform sampler2D texture_array;
void main()
{
//float intensity = 100.0/(length(pos - mouse_pos));
//FragColor = ourColor;//*intensity;
FragColor = texture(texture_array,vec3(auv,layer));
}
21 changes: 21 additions & 0 deletions assets/test_shaders/not_batch.vert.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#version 330 core
layout (location = 0) in vec2 aPos;
layout (location = 1) in vec4 aColor;
layout (location = 2) in vec2 uv;
uniform mat4 ortho = mat4(1.0);
uniform mat4 dimet = mat4(1.0);
/*mat4 ortho = mat4(2.0/1920.0,0.0,0.0,-1.0,
0.0,-2.0/1080.0,0.0,1.0,
0.0,0.0,1.0,0.0,
0.0,0.0,1.0,1.0);
*/
out vec4 ourColor;
out vec2 pos;
out vec2 auv;
void main()
{
gl_Position = ortho*dimet*vec4(aPos,0.0, 1.0);
ourColor = aColor;
pos =aPos;
auv = uv;
}
11 changes: 11 additions & 0 deletions assets/test_shaders/terrain.frag.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#version 330 core
out vec4 FragColor;

in vec2 pos;
in vec2 auv;
in float tex_ind;
uniform sampler2DArray texture_array;
void main()
{
FragColor = texture(texture_array,vec3(auv,tex_ind));
}
23 changes: 23 additions & 0 deletions assets/test_shaders/terrain.vert.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#version 330 core
layout (location = 0) in vec2 aPos;
layout (location = 1) in vec2 uv;
layout (location = 2) in float terrain_index;
layout (location = 3) in float alpha_mask;

uniform mat4 ortho = mat4(1.0);
uniform mat4 dimet = mat4(1.0);
/*mat4 ortho = mat4(2.0/1920.0,0.0,0.0,-1.0,
0.0,-2.0/1080.0,0.0,1.0,
0.0,0.0,1.0,0.0,
0.0,0.0,1.0,1.0);
*/
out vec2 pos;
out vec2 auv;
out float tex_ind;
void main()
{
gl_Position = ortho*dimet*vec4(aPos,0.0, 1.0);
pos =aPos;
auv = uv;
tex_ind = terrain_index;
}
11 changes: 11 additions & 0 deletions assets/test_shaders/vshader_display_src.vert.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#version 330

layout(location=0) in vec2 position;
layout(location=1) in vec2 uv;
uniform mat4 proj;
out vec2 v_uv;

void main() {
gl_Position = proj * vec4(position, 0.0, 1.0);
v_uv = uv;
}
Loading