fgettext("2x"),
fgettext("4x"),
fgettext("8x")
+ },
+ shadow_levels = {
+ fgettext("Disabled"),
+ fgettext("Very Low"),
+ fgettext("Low"),
+ fgettext("Medium"),
+ fgettext("High"),
+ fgettext("Ultra High")
}
}
antialiasing = {
table.concat(labels.antialiasing, ","),
{"0", "2", "4", "8"}
+ },
+ shadow_levels = {
+ table.concat(labels.shadow_levels, ","),
+ { "0", "1", "2", "3", "4", "5" }
}
}
end
end
return 1
+ end,
+ ShadowMapping = function()
+ local shadow_setting = core.settings:get("shadow_levels")
+ for i = 1, #dd_options.shadow_levels[2] do
+ if shadow_setting == dd_options.shadow_levels[2][i] then
+ return i
+ end
+ end
+ return 1
end
}
"box[8,0;3.75,4.5;#999999]"
local video_driver = core.settings:get("video_driver")
- local shaders_supported = video_driver == "opengl"
- local shaders_enabled = false
- if shaders_supported then
- shaders_enabled = core.settings:get_bool("enable_shaders")
+ local shaders_enabled = core.settings:get_bool("enable_shaders")
+ if video_driver == "opengl" then
tab_string = tab_string ..
"checkbox[8.25,0;cb_shaders;" .. fgettext("Shaders") .. ";"
.. tostring(shaders_enabled) .. "]"
+ elseif video_driver == "ogles2" then
+ tab_string = tab_string ..
+ "checkbox[8.25,0;cb_shaders;" .. fgettext("Shaders (experimental)") .. ";"
+ .. tostring(shaders_enabled) .. "]"
else
core.settings:set_bool("enable_shaders", false)
+ shaders_enabled = false
tab_string = tab_string ..
"label[8.38,0.2;" .. core.colorize("#888888",
fgettext("Shaders (unavailable)")) .. "]"
if shaders_enabled then
tab_string = tab_string ..
- "checkbox[8.25,0.5;cb_bumpmapping;" .. fgettext("Bump Mapping") .. ";"
- .. dump(core.settings:get_bool("enable_bumpmapping")) .. "]" ..
- "checkbox[8.25,1;cb_tonemapping;" .. fgettext("Tone Mapping") .. ";"
+ "checkbox[8.25,0.5;cb_tonemapping;" .. fgettext("Tone Mapping") .. ";"
.. dump(core.settings:get_bool("tone_mapping")) .. "]" ..
- "checkbox[8.25,1.5;cb_generate_normalmaps;" .. fgettext("Generate Normal Maps") .. ";"
- .. dump(core.settings:get_bool("generate_normalmaps")) .. "]" ..
- "checkbox[8.25,2;cb_parallax;" .. fgettext("Parallax Occlusion") .. ";"
- .. dump(core.settings:get_bool("enable_parallax_occlusion")) .. "]" ..
- "checkbox[8.25,2.5;cb_waving_water;" .. fgettext("Waving Liquids") .. ";"
+ "checkbox[8.25,1;cb_waving_water;" .. fgettext("Waving Liquids") .. ";"
.. dump(core.settings:get_bool("enable_waving_water")) .. "]" ..
- "checkbox[8.25,3;cb_waving_leaves;" .. fgettext("Waving Leaves") .. ";"
+ "checkbox[8.25,1.5;cb_waving_leaves;" .. fgettext("Waving Leaves") .. ";"
.. dump(core.settings:get_bool("enable_waving_leaves")) .. "]" ..
- "checkbox[8.25,3.5;cb_waving_plants;" .. fgettext("Waving Plants") .. ";"
- .. dump(core.settings:get_bool("enable_waving_plants")) .. "]"
+ "checkbox[8.25,2;cb_waving_plants;" .. fgettext("Waving Plants") .. ";"
+ .. dump(core.settings:get_bool("enable_waving_plants")) .. "]"..
+ "label[8.25,3.0;" .. fgettext("Dynamic shadows: ") .. "]" ..
+ "dropdown[8.25,3.5;3.5;dd_shadows;" .. dd_options.shadow_levels[1] .. ";"
+ .. getSettingIndex.ShadowMapping() .. "]"
else
tab_string = tab_string ..
"label[8.38,0.7;" .. core.colorize("#888888",
- fgettext("Bump Mapping")) .. "]" ..
- "label[8.38,1.2;" .. core.colorize("#888888",
fgettext("Tone Mapping")) .. "]" ..
+ "label[8.38,1.2;" .. core.colorize("#888888",
+ fgettext("Waving Liquids")) .. "]" ..
"label[8.38,1.7;" .. core.colorize("#888888",
- fgettext("Generate Normal Maps")) .. "]" ..
+ fgettext("Waving Leaves")) .. "]" ..
"label[8.38,2.2;" .. core.colorize("#888888",
- fgettext("Parallax Occlusion")) .. "]" ..
+ fgettext("Waving Plants")) .. "]"..
"label[8.38,2.7;" .. core.colorize("#888888",
- fgettext("Waving Liquids")) .. "]" ..
- "label[8.38,3.2;" .. core.colorize("#888888",
- fgettext("Waving Leaves")) .. "]" ..
- "label[8.38,3.7;" .. core.colorize("#888888",
- fgettext("Waving Plants")) .. "]"
+ fgettext("Dynamic shadows")) .. "]"
end
return tab_string
end
return true
end
- if fields["cb_bumpmapping"] then
- core.settings:set("enable_bumpmapping", fields["cb_bumpmapping"])
- return true
- end
if fields["cb_tonemapping"] then
core.settings:set("tone_mapping", fields["cb_tonemapping"])
return true
end
- if fields["cb_generate_normalmaps"] then
- core.settings:set("generate_normalmaps", fields["cb_generate_normalmaps"])
- return true
- end
- if fields["cb_parallax"] then
- core.settings:set("enable_parallax_occlusion", fields["cb_parallax"])
- return true
- end
if fields["cb_waving_water"] then
core.settings:set("enable_waving_water", fields["cb_waving_water"])
return true
ddhandled = true
end
+ for i = 1, #labels.shadow_levels do
+ if fields["dd_shadows"] == labels.shadow_levels[i] then
+ core.settings:set("shadow_levels", dd_options.shadow_levels[2][i])
+ ddhandled = true
+ end
+ end
+
+ if fields["dd_shadows"] == labels.shadow_levels[1] then
+ core.settings:set("enable_dynamic_shadows", "false")
+ else
+ local shadow_presets = {
+ [2] = { 80, 512, "true", 0, "false" },
+ [3] = { 120, 1024, "true", 1, "false" },
+ [4] = { 350, 2048, "true", 1, "false" },
+ [5] = { 350, 2048, "true", 2, "true" },
+ [6] = { 450, 4096, "true", 2, "true" },
+ }
+ local s = shadow_presets[table.indexof(labels.shadow_levels, fields["dd_shadows"])]
+ if s then
+ core.settings:set("enable_dynamic_shadows", "true")
+ core.settings:set("shadow_map_max_distance", s[1])
+ core.settings:set("shadow_map_texture_size", s[2])
+ core.settings:set("shadow_map_texture_32bit", s[3])
+ core.settings:set("shadow_filters", s[4])
+ core.settings:set("shadow_map_color", s[5])
+ end
+ end
+
return ddhandled
end