Skip to content

Commit

Permalink
teapot.h: Added TEAPOT_MESH_CUBE_ROUNDED, TEAPOT_MESH_FLIPPER_RIGHT a…
Browse files Browse the repository at this point in the history
…nd TEAPOT_MESH_FLIPPER_LEFT. Added some math functions.

minimath.h: Added nm_Mat4_PickMatrix(...), similar to gluPickMatrix(...).
dynamic_resolution.h: Added fixed resolution factor. Basically now we can manually set the (maximum) internal resolution. It always works (even when dynamic resolution is disabled), so that we can avoid the popping pixel noise of the dynamic resolution by turning dynamic resolution off and allow users to manually adjust the fixed resolution factor (not shown in the demos). BREAKING CHANGE: Added the fixed_resolution_factor to: void Dynamic_Resolution_Init(float desiredFPS, int dr_enabled, float fr_factor); default (and fallback) value of fr_factor is 1.f. So just adding 1.f to existing code should restore the old behavior.
  • Loading branch information
Flix01 committed Nov 23, 2020
1 parent 75686c4 commit 61215aa
Show file tree
Hide file tree
Showing 6 changed files with 660 additions and 163 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ Tests/test_sdf_c
c_vector*
bvh.h
Tests/test_bvh*
*.bak




Expand Down
2 changes: 1 addition & 1 deletion Tests/test_character.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ static struct cha_character_instance* mouseSelectedCharacterInstance = NULL;
void InitGL(void) {

// IMPORTANT CALL--------------------------------------------------------
Dynamic_Resolution_Init(config.dynamic_resolution_target_fps,config.dynamic_resolution_enabled);
Dynamic_Resolution_Init(config.dynamic_resolution_target_fps,config.dynamic_resolution_enabled,1.f); // last arg is the fixed_resolution_factor, in (0.1f,1.f]. Default is 1.f. It means: (max) internal_resolution = full_window_resolution*fixed_resolution_factor. Works even when dynamic resolution is disabled.
//-----------------------------------------------------------------------
// IMPORTANT CALL--------------------------------------------------------
Teapot_Init();
Expand Down
3 changes: 2 additions & 1 deletion Tests/test_shadows.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ for glut.h, glew.h, etc. with something like:

// "dynamic_resolution.h" implements the first shadow mapping step and optionally dynamic resolution (that by default should keep frame rate > config.dynamic_resolution_target_fps)
//#define DYNAMIC_RESOLUTION_USE_GLSL_VERSION_330 // (Optional) Not sure it's faster...
//#define DYNAMIC_RESOLUTION_USE_NEAREST_TEXTURE_FILTER // (optional) Default is GL_LINEAR, and should be better than GL_NEAREST
//#define DYNAMIC_RESOLUTION_SHADOW_MAP_SIZE_FORCE_POT // There are other definitions that affect the shadow map resolution. Please see dynamic_resolution.h.
//#define DYNAMIC_RESOLUTION_SHADOW_MAP_RECTANGULAR // more flickering but slightly better resolution
//#define DYNAMIC_RESOLUTION_SHADOW_MAP_SIZE_MULTIPLIER 2.0 // 1.5 default value [better resolution, but more expensive]
Expand Down Expand Up @@ -289,7 +290,7 @@ static float Colors[NUM_COLORS][3]={
void InitGL(void) {

// IMPORTANT CALL--------------------------------------------------------
Dynamic_Resolution_Init(config.dynamic_resolution_target_fps,config.dynamic_resolution_enabled);
Dynamic_Resolution_Init(config.dynamic_resolution_target_fps,config.dynamic_resolution_enabled,1.f); // last arg is the fixed_resolution_factor, in (0.1f,1.f]. Default is 1.f. It means: (max) internal_resolution = full_window_resolution*fixed_resolution_factor. Works even when dynamic resolution is disabled.
//-----------------------------------------------------------------------
# ifdef TEST_ADD_USER_MESH
Teapot_Set_Init_UserMeshCallback(&Teapot_Init_User_Mesh_Callback); // if used must be called BEFORE Teapot_Init()
Expand Down
Loading

0 comments on commit 61215aa

Please sign in to comment.