Commit 3b90a7bf authored by Harmonikater's avatar Harmonikater
Browse files

Attempt to fix gamma issues in terrain splitting

parent 2e839641
......@@ -39,7 +39,7 @@ fn SplitTerrainLightMap source patches outFolder =
)
local patchName = "tx" + xStr + "x" + yStr + ".tga"
local patchFile = outFolder + "\\" + patchName
local dest = Bitmap patchsize patchsize
local dest = Bitmap patchsize patchsize gamma:2.2
local patchUniform = True
local closePixels = #()
local cumError = 0
......@@ -47,7 +47,14 @@ fn SplitTerrainLightMap source patches outFolder =
for row = 0 to patchsize-1 do
(
sourcePatchRow = getPixels source (Point2 (x*patchsize) (((size-y)*patchsize) - row - 1)) patchsize
try
(
sourcePatchRow = getPixels source (Point2 (x*patchsize) (((size-y)*patchsize) - row - 1)) patchsize linear:true
)
catch
(
sourcePatchRow = getPixels source (Point2 (x*patchsize) (((size-y)*patchsize) - row - 1)) patchsize
)
destRow = getPixels dest (Point2 0 row) patchsize
if closePixels.count == 0 do append closePixels sourcePatchRow[1]
for col = 1 to sourcePatchRow.count 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