Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Harmonikater
BF2-3dsMax-Tools
Commits
2e839641
Commit
2e839641
authored
Sep 08, 2019
by
Harmonikater
Browse files
Revert "auto lm: always disable gamma correction"
This reverts commit
cadac1ca
.
parent
cadac1ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
scripts/bf2/Statics/auto_lm.ms
View file @
2e839641
...
...
@@ -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"
...
...
scripts/bf2/levels/TerrainLightmap.ms
View file @
2e839641
...
...
@@ -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 =
Tru
e
local printed =
Fals
e
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
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment