Added a setting for disabling smooth lighting. Updated changelog.

master
Perttu Ahola 2011-04-24 12:31:19 +03:00
parent 8c1f7a0dd2
commit b21c7de3ed
4 changed files with 97 additions and 81 deletions

View File

@ -3,6 +3,9 @@ Minetest-c55 changelog
This should contain all the major changes. This should contain all the major changes.
For minor stuff, refer to the commit log of the repository. For minor stuff, refer to the commit log of the repository.
X:
- Smooth lighting with simple ambient occlusion
2011-04-23_0_test: 2011-04-23_0_test:
- Small bug fixes - Small bug fixes
- Item drop multiplication fixed - Item drop multiplication fixed

View File

@ -27,6 +27,8 @@
#new_style_water = true #new_style_water = true
# Enable nice leaves; disable for speed # Enable nice leaves; disable for speed
#new_style_leaves = true #new_style_leaves = true
# Enable smooth lighting with simple ambient occlusion; disable for speed
#smooth_lighting = true
# Whether to draw a frametime graph # Whether to draw a frametime graph
#frametime_graph = false #frametime_graph = false
# Enable combining mainly used textures to a bigger one # Enable combining mainly used textures to a bigger one

View File

@ -41,6 +41,7 @@ void set_default_settings()
g_settings.setDefault("enable_fog", "true"); g_settings.setDefault("enable_fog", "true");
g_settings.setDefault("new_style_water", "false"); g_settings.setDefault("new_style_water", "false");
g_settings.setDefault("new_style_leaves", "true"); g_settings.setDefault("new_style_leaves", "true");
g_settings.setDefault("smooth_lighting", "true");
g_settings.setDefault("frametime_graph", "false"); g_settings.setDefault("frametime_graph", "false");
g_settings.setDefault("enable_texture_atlas", "true"); g_settings.setDefault("enable_texture_atlas", "true");
g_settings.setDefault("texture_path", ""); g_settings.setDefault("texture_path", "");

View File

@ -400,7 +400,8 @@ void updateFastFaceRow(
core::array<FastFace> &dest, core::array<FastFace> &dest,
NodeModMap &temp_mods, NodeModMap &temp_mods,
VoxelManipulator &vmanip, VoxelManipulator &vmanip,
v3s16 blockpos_nodes) v3s16 blockpos_nodes,
bool smooth_lighting)
{ {
v3s16 p = startpos; v3s16 p = startpos;
@ -508,10 +509,13 @@ void updateFastFaceRow(
scale.Z = continuous_tiles_count; scale.Z = continuous_tiles_count;
} }
//u8 li = decode_light(light); if(smooth_lighting == false)
li0 = li1 = li2 = li3 = decode_light(light);
// If node at sp (tile0) is more solid // If node at sp (tile0) is more solid
if(mf == 1) if(mf == 1)
{
if(smooth_lighting)
{ {
if(face_dir == v3s16(0,0,1)) if(face_dir == v3s16(0,0,1))
{ {
@ -550,14 +554,16 @@ void updateFastFaceRow(
vmanip, daynight_ratio); vmanip, daynight_ratio);
} }
else assert(0); else assert(0);
}
//makeFastFace(tile0, li, li, li, li,
makeFastFace(tile0, li0, li1, li2, li3, makeFastFace(tile0, li0, li1, li2, li3,
sp, face_dir, scale, sp, face_dir, scale,
posRelative_f, dest); posRelative_f, dest);
} }
// If node at sp is less solid (mf == 2) // If node at sp is less solid (mf == 2)
else else
{
if(smooth_lighting)
{ {
// Offset to the actual solid block // Offset to the actual solid block
p_map += face_dir; p_map += face_dir;
@ -600,8 +606,8 @@ void updateFastFaceRow(
vmanip, daynight_ratio); vmanip, daynight_ratio);
} }
else assert(0); else assert(0);
}
//makeFastFace(tile1, li, li, li, li,
makeFastFace(tile1, li0, li1, li2, li3, makeFastFace(tile1, li0, li1, li2, li3,
sp+face_dir_f, -face_dir, scale, sp+face_dir_f, -face_dir, scale,
posRelative_f, dest); posRelative_f, dest);
@ -731,6 +737,7 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data)
*/ */
bool new_style_water = g_settings.getBool("new_style_water"); bool new_style_water = g_settings.getBool("new_style_water");
bool new_style_leaves = g_settings.getBool("new_style_leaves"); bool new_style_leaves = g_settings.getBool("new_style_leaves");
bool smooth_lighting = g_settings.getBool("smooth_lighting");
float node_water_level = 1.0; float node_water_level = 1.0;
if(new_style_water) if(new_style_water)
@ -762,7 +769,8 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data)
fastfaces_new, fastfaces_new,
data->m_temp_mods, data->m_temp_mods,
data->m_vmanip, data->m_vmanip,
blockpos_nodes); blockpos_nodes,
smooth_lighting);
} }
} }
/* /*
@ -779,7 +787,8 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data)
fastfaces_new, fastfaces_new,
data->m_temp_mods, data->m_temp_mods,
data->m_vmanip, data->m_vmanip,
blockpos_nodes); blockpos_nodes,
smooth_lighting);
} }
} }
/* /*
@ -796,7 +805,8 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data)
fastfaces_new, fastfaces_new,
data->m_temp_mods, data->m_temp_mods,
data->m_vmanip, data->m_vmanip,
blockpos_nodes); blockpos_nodes,
smooth_lighting);
} }
} }
} }