From 7b84fbdc019a3744b313756adbdeddd5f696e3e3 Mon Sep 17 00:00:00 2001 From: Shariq Shah Date: Fri, 1 Nov 2019 14:08:47 +1100 Subject: [PATCH] Fixed default config values --- assets/entities/Spot.symtres | 36 ++++++++++++++++----------------- assets/entities/Suzanne.symtres | 18 ++++++++--------- src/game/renderer.c | 4 ++-- src/system/config_vars.c | 14 ++++++------- src/system/main.c | 2 +- src/system/platform.c | 7 +++++++ todo.txt | 5 +++-- 7 files changed, 47 insertions(+), 39 deletions(-) diff --git a/assets/entities/Spot.symtres b/assets/entities/Spot.symtres index 46764a4..703e16b 100644 --- a/assets/entities/Spot.symtres +++ b/assets/entities/Spot.symtres @@ -1,18 +1,18 @@ -Entity -{ - type : 5 - inner_angle : 20.0000 - falloff : 1.5000 - light_type : 2 - depth_bias : 0.0005 - cast_shadow : false - intensity : 1.0000 - color : 1.000 1.000 1.000 - active : true - radius : 20.0000 - outer_angle : 30.0000 - name : Test_Light - pcf_enabled : false - valid : true -} - +Entity +{ + type : 5 + inner_angle : 20.0000 + falloff : 1.5000 + light_type : 2 + depth_bias : 0.0005 + cast_shadow : false + intensity : 1.0000 + color : 1.000 1.000 1.000 + active : true + radius : 20.0000 + outer_angle : 30.0000 + name : Test_Light + pcf_enabled : false + valid : true +} + diff --git a/assets/entities/Suzanne.symtres b/assets/entities/Suzanne.symtres index 5284f62..e4419a3 100644 --- a/assets/entities/Suzanne.symtres +++ b/assets/entities/Suzanne.symtres @@ -1,9 +1,9 @@ -Entity -{ - type : 6 - material : 0 - geometry : suzanne.symbres - active : true - name : Suzanne_0 -} - +Entity +{ + type : 6 + material : 0 + geometry : suzanne.symbres + active : true + name : Suzanne_0 +} + diff --git a/src/game/renderer.c b/src/game/renderer.c index 45b6efd..bd9ee35 100755 --- a/src/game/renderer.c +++ b/src/game/renderer.c @@ -326,8 +326,8 @@ void renderer_render(struct Renderer* renderer, struct Scene* scene) int width, height; struct Game_State* game_state = game_state_get(); window_get_size(game_state->window, &width, &height); - glViewport(0, 0, width * 2, height * 2); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glViewport(0, 0, width, height); + GL_CHECK(glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)); shader_bind(renderer->composition_shader); int final_render_tex = active_camera->render_tex == -1 ? renderer->def_albedo_tex : active_camera->render_tex; texture_bind(final_render_tex); diff --git a/src/system/config_vars.c b/src/system/config_vars.c index 776f329..79929df 100755 --- a/src/system/config_vars.c +++ b/src/system/config_vars.c @@ -16,19 +16,19 @@ void config_vars_init(struct Hashmap* cvars) hashmap_int_set(cvars, "render_width", 1280); hashmap_int_set(cvars, "render_height", 720); hashmap_bool_set(cvars, "vsync_enabled", true); - hashmap_int_set(cvars, "fog_mode", 0); - hashmap_vec3_setf(cvars, "fog_color", 0.9f, 0.2f, 0.2f); + hashmap_int_set(cvars, "fog_mode", 1); + hashmap_vec3_setf(cvars, "fog_color", 0.17f, 0.49f, 0.63f); hashmap_float_set(cvars, "fog_density", 0.1f); hashmap_float_set(cvars, "fog_start_dist", 10.f); - hashmap_float_set(cvars, "fog_max_dist", 50.f); + hashmap_float_set(cvars, "fog_max_dist", 450.f); hashmap_vec3_setf(cvars, "ambient_light", 0.1f, 0.1f, 0.1f); - hashmap_bool_set(cvars, "msaa_enabled", 1); + hashmap_bool_set(cvars, "msaa_enabled", true); hashmap_int_set(cvars, "msaa_levels", 4); - hashmap_bool_set(cvars, "debug_draw_enabled", true); - hashmap_bool_set(cvars, "debug_draw_physics", true); + hashmap_bool_set(cvars, "debug_draw_enabled", false); + hashmap_bool_set(cvars, "debug_draw_physics", false); hashmap_int_set(cvars, "video_driver_linux", VD_WAYLAND); hashmap_int_set(cvars, "debug_draw_mode", 0); - hashmap_vec4_setf(cvars, "debug_draw_color", 1.f, 0.f, 0.f, 1.f); + hashmap_vec4_setf(cvars, "debug_draw_color", 0.8f, 0.4f, 0.1f, 1.f); hashmap_float_set(cvars, "player_move_speed", 10.f); hashmap_float_set(cvars, "player_move_speed_multiplier", 2.f); hashmap_float_set(cvars, "player_turn_speed", 5.f); diff --git a/src/system/main.c b/src/system/main.c index 822aadd..f230b19 100755 --- a/src/system/main.c +++ b/src/system/main.c @@ -78,7 +78,7 @@ bool init(void) int width = hashmap_int_get(cvars, "render_width"); int height = hashmap_int_get(cvars, "render_height"); - int msaa = hashmap_bool_get(cvars, "msaa_enabled"); + bool msaa = hashmap_bool_get(cvars, "msaa_enabled"); int msaa_levels = hashmap_int_get(cvars, "msaa_levels"); bool vsync = hashmap_bool_get(cvars, "vsync_enabled"); window = window_create("Symmetry", width, height, msaa, msaa_levels, vsync); diff --git a/src/system/platform.c b/src/system/platform.c index 365d17f..b24037a 100755 --- a/src/system/platform.c +++ b/src/system/platform.c @@ -91,6 +91,13 @@ struct Window* window_create(const char* title, int width, int height, int msaa, SDL_GL_GetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, &major); SDL_GL_GetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, &minor); log_message("Window created and initialized with opengl core context %d.%d", major, minor); + + + int msaa_recieved = 0, msaa_recieved_levels = 0; + SDL_GL_GetAttribute(SDL_GL_MULTISAMPLEBUFFERS, &msaa_recieved); + SDL_GL_GetAttribute(SDL_GL_MULTISAMPLESAMPLES, &msaa_recieved_levels); + log_message("MSAA : %d MSAA Levels : %d", msaa_recieved, msaa_recieved_levels); + return new_window; } diff --git a/todo.txt b/todo.txt index ea293bc..da09748 100644 --- a/todo.txt +++ b/todo.txt @@ -1,6 +1,4 @@ Todo: - - Implement HiDPI support - - Implement/Fix copying libraries to executable folder after build completes on mac os - Fix all sound related bugs before moving on and finish sound serialization to file - Finish mesh and material properties serialization to and from file @@ -82,6 +80,7 @@ Todo: ? Better handling incase assets folder is not found - Write entity to/from file - Ogg format loading and playback + - Implement HiDPI support - Sound streaming - Implment missing sound source properties (inner/outer cone, getting sound source data) - Shadow maps @@ -105,6 +104,7 @@ Improvements: - Improve picking and automatically improve everything in editor - Improve culling - Allow scaling on all axes at once + - Improve grid/immediate mode drawing by switching to glDrawElements instead of glDrawArrays. Bugs: - Better handling of wav format checking at load time @@ -316,3 +316,4 @@ Done: * Moved MAX_LIGHTS shader definition from inside the shader to be dynamically defined and added to the shader code when it is compiled to reduce inconsistencies * Fixed symlink issue in genie for macos which interferes with fopen operations + * Implement/Fix copying libraries to executable folder after build completes on mac os