[0.1-5] added an option to swap the quad order for very rare GPUs like the Intel 3000 HD

This commit is contained in:
Ben Russell (300178622) 2013-07-08 11:58:15 +12:00
parent 834f550126
commit 02df41ffc4
7 changed files with 20 additions and 5 deletions

View File

@ -31,6 +31,7 @@
"gl_chunks_tesselated_per_frame": 4,
"gl_shaders": true,
"gl_frustum_cull": true,
"gl_flip_quads": false,
"gl_vbo": true
},

View File

@ -61,6 +61,10 @@ clsave/config.json:
Set this to "false" if the artifacts are digging your head in,
or if it somehow makes rendering *slower*.
"gl_flip_quads" changes the order in which quads are assembled.
Enable this if you have smooth lighting enabled and it looks like you have dark squares
at each of the corners.
"gl_vbo" enables vertex buffer objects (default: true)
May fail on older computers. Enable for a faster FPS.
It is recommended you disable these on old Intel integrated GPUs.

View File

@ -19,7 +19,7 @@
#define VERSION_X 1
#define VERSION_Y 0
#define VERSION_A 0
#define VERSION_Z 4
#define VERSION_Z 5
// Remember to bump "Z" basically every time you change the engine!
// Remember to bump the version in Lua too!
// Remember to document API changes in a new version!
@ -458,6 +458,7 @@ extern int screen_smooth_lighting;
extern int gl_expand_textures;
extern int gl_use_vbo;
extern int gl_frustum_cull;
extern int gl_flip_quads;
extern int gl_chunk_size;
extern int gl_visible_chunks;
extern int gl_chunks_tesselated_per_frame;

View File

@ -16,9 +16,9 @@
]]
VERSION_ENGINE = {
cmp={0,1,0,0,4},
num=4194304+4,
str="0.1-4",
cmp={0,1,0,0,5},
num=4194304+5,
str="0.1-5",
}
VERSION_BUGS = {
@ -92,5 +92,6 @@ VERSION_BUGS = {
{intro=nil, fix=nil, msg="Sound distance attenuation affected by zoom (workaround implemented)"},
{intro=nil, fix=4194304+3, msg="[OpenGL] Frustum culling not supported"},
{intro=nil, fix=4194304+4, msg="[OpenGL] Ambient occlusion on sides not rendered equally"},
{intro=4194304+4, fix=4194304+5, msg="[OpenGL] Ambient occlusion on sides rendered very unequally on very rare GPUs such as the Intel 3000HD"},
}

View File

@ -779,7 +779,9 @@ void render_gl_cube_map(map_t *map, map_chunk_t *chunk, float x, float y, float
}
/* Check if the quad needs to be rotated (fix for ambient occlusion on sides) */
if (average_light_vertex1 + average_light_vertex3 > average_light_vertex2 + average_light_vertex4)
if ((average_light_vertex1 + average_light_vertex3 > average_light_vertex2 + average_light_vertex4
? !gl_flip_quads
: gl_flip_quads))
{
/* Quad 1 rotated */

View File

@ -376,6 +376,11 @@ int icelua_init(void)
if(!lua_isnil(Lc, -1)) gl_use_vbo = v;
lua_pop(Lc, 1);
lua_getfield(Lc, -1, "gl_flip_quads");
v = lua_toboolean(Lc, -1);
if(!lua_isnil(Lc, -1)) gl_flip_quads = v;
lua_pop(Lc, 1);
lua_getfield(Lc, -1, "gl_frustum_cull");
v = lua_toboolean(Lc, -1);
if(!lua_isnil(Lc, -1)) gl_frustum_cull = v;

View File

@ -36,6 +36,7 @@ int gl_visible_chunks = 49;
int gl_chunks_tesselated_per_frame = 2;
int gl_use_vbo = 1;
int gl_frustum_cull = 1;
int gl_flip_quads = 0;
int force_redraw = 1;