Commit 2e839641 authored by Harmonikater's avatar Harmonikater
Browse files

Revert "auto lm: always disable gamma correction"

This reverts commit cadac1ca.
parent cadac1ca
......@@ -35,27 +35,11 @@ fn auto_lm_prelim mapFolder =
units.DisplayType = #Generic
units.SystemScale = 1.0
units.SystemType = #inches
try
(
IDisplayGamma.colorCorrectionMode = #None
IDisplayGamma.gamma = 1.0
print "Set gamma off"
)
catch()
)
fn auto_lm_load_scene mapFolder =
(
try
(
IDisplayGamma.colorCorrectionMode = #None
IDisplayGamma.gamma = 1.0
print "Set gamma off"
)
catch()
LM_log "Opening lightmap scene."
local savePath = pathconfig.appendpath mapFolder "Lightmaps/MaxLight/LightmapScene.max"
......
......@@ -20,21 +20,12 @@ fn RedToRed source dest =
fn SplitTerrainLightMap source patches outFolder =
(
try
(
IDisplayGamma.colorCorrectionMode = #None
IDisplayGamma.gamma = 1.0
format "IDisplayGamma.colorCorrectionMode = %\n" IDisplayGamma.colorCorrectionMode
format "IDisplayGamma.gamma = %\n" IDisplayGamma.gamma
)
catch()
local size = sqrt(patches) as integer
local patchsize = source.width / size
for x = 0 to size-1 do
(
xStr = (x as string)
xStr = (x as string)
while xStr.count < (size as string).count or xStr.count < 2 do
(
xStr = "0" + xStr
......@@ -52,7 +43,7 @@ fn SplitTerrainLightMap source patches outFolder =
local patchUniform = True
local closePixels = #()
local cumError = 0
local printed = True
local printed = False
for row = 0 to patchsize-1 do
(
......@@ -103,6 +94,7 @@ fn SplitTerrainLightMap source patches outFolder =
setPixels dest (Point2 0 y) destRow
)
format "Patch % was optimized. (Cumulative error: %)\n" patchName cumError
print
)
dest.filename = patchFile
save dest
......@@ -166,6 +158,7 @@ fn Bf2RenderTerrainLight t fName s:10.0 size:undefined =
function Bf2RenderTerrain outPath size:undefined s:10.0 =
(
if g_bf2_lightMappingTerrain == undefined do
(
g_bf2_lightMappingTerrain = bf2ImportHeightmap ()
......@@ -181,7 +174,7 @@ function Bf2RenderTerrain outPath size:undefined s:10.0 =
-- render water transparency to red channel
if g_bf2_lightMappingTerrain != undefined and g_bf2_lightMappingTerrain.min[3] < (g_bf2_lightMappingSeaLevel * s) do
(
g_bf2_lightMappingTerrain.pos.z = 0
-- Turn off all lights but the waterlight
for l in lights do l.enabled = off
......@@ -207,6 +200,7 @@ function Bf2RenderTerrain outPath size:undefined s:10.0 =
close bmR
free bmR
)
local bmGB = undefined
if g_bf2_lightMappingTerrain != undefined do
(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment