color grading workflow (#3152)

* color grading workflow assets, python scripts, ~and test data for Nuke and PS.

Signed-off-by: Jonny Gallowy <~gallowj@amazon.com>

* minor changes

Signed-off-by: Jonny Gallowy <~gallowj@amazon.com>

* pep8 reformate code style, clean up, address CR

Signed-off-by: Jonny Gallowy <~gallowj@amazon.com>

* Pep8 refactor, some DRY refactoring.

Signed-off-by: Jonny Gallowy <~gallowj@amazon.com>

* simplification write_azasset()

Signed-off-by: Jonny Gallowy <~gallowj@amazon.com>

* corrected code and further simplified ()

Signed-off-by: Jonny Gallowy <~gallowj@amazon.com>

* updated readme.txt, I was mistakenly converting the wrong lut to engine

Signed-off-by: Jonny Gallowy <~gallowj@amazon.com>

* refactoring, simplification and some re-org

Signed-off-by: Jonny Gallowy <~gallowj@amazon.com>

* fixed bad loop in old_lut_helper

Signed-off-by: Jonny Gallowy <~gallowj@amazon.com>

* improve the lut_helper and corrected lut shaping

Signed-off-by: Jonny Gallowy <~gallowj@amazon.com>

* skip non-digit metadata in 3DL files

Signed-off-by: Jonny Gallowy <~gallowj@amazon.com>

* file name fix

Signed-off-by: Jonny Gallowy <~gallowj@amazon.com>

* nit: renamed a tag in comment

Signed-off-by: Jonny Gallowy <~gallowj@amazon.com>

* style

Signed-off-by: Jonny Gallowy <~gallowj@amazon.com>

* cleanup, cmd readme

Signed-off-by: Jonny Gallowy <~gallowj@amazon.com>

* fixed WINGHOME

Signed-off-by: Jonny Gallowy <~gallowj@amazon.com>

* Updated the readme with basic instructions

Signed-off-by: Jonny Gallowy <~gallowj@amazon.com>

* fixed py bootstrapping errors

Signed-off-by: Jonny Gallowy <~gallowj@amazon.com>

* removed log file (shouldn't be there)

Signed-off-by: Jonny Gallowy <~gallowj@amazon.com>

* re-gen bad test lut (forgot)

Signed-off-by: Jonny Gallowy <~gallowj@amazon.com>

Co-authored-by: Jonny Gallowy <~gallowj@amazon.com>
monroegm-disable-blank-issue-2
Jonny Galloway 4 years ago committed by GitHub
parent 96a5f06ca3
commit 6f589ad50c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,258 @@
# coding:utf-8
#!/usr/bin/python
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
"""O3DE/Atom Color Grading Python Package"""
# -------------------------------------------------------------------------
import sys
import os
import site
import inspect
import logging as _logging
import pathlib
from pathlib import Path
import math
# -------------------------------------------------------------------------
__copyright__ = "Copyright 2021, Amazon"
__credits__ = ["Jonny Galloway", "Ben Black"]
__license__ = "EULA"
__version__ = "0.0.1"
__status__ = "Prototype"
__all__ = ['from_3dl_to_azasset',
'capture_displaymapperpassthrough',
'exr_to_3dl_azasset',
'initialize',
'lut_compositor',
'lut_helper',
'env_bool',
'makedirs',
'initialize_logger'
'inv_shaper_transform',
'shaper_transform',
'get_uv_coord',
'clamp',
'log2',
'is_power_of_two']
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
_MODULE_PATH = Path(os.path.abspath(__file__))
site.addsitedir(_MODULE_PATH.parent.absolute())
_PACKAGENAME = 'ColorGrading'
_MODULEENAME = 'ColorGrading.init'
# project cache log dir path
DCCSI_LOG_PATH = Path(_MODULE_PATH.parent.absolute(), '.tmp', 'logs')
# -------------------------------------------------------------------------
# -- envar util ----------------------------------------------------------
def env_bool(envar, default=False):
"""cast a env bool to a python bool"""
envar_test = os.getenv(envar, default)
# check 'False', 'false', and '0' since all are non-empty
# env comes back as string and normally coerced to True.
if envar_test in ('True', 'true', '1'):
return True
elif envar_test in ('False', 'false', '0'):
return False
else:
return envar_test
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# set these true if you want them set globally for debugging
DCCSI_GDEBUG = env_bool('DCCSI_GDEBUG', False)
DCCSI_DEV_MODE = env_bool('DCCSI_DEV_MODE', False)
DCCSI_GDEBUGGER = env_bool('DCCSI_GDEBUGGER', False)
DCCSI_LOGLEVEL = env_bool('DCCSI_LOGLEVEL', int(20))
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
FRMT_LOG_LONG = "[%(name)s][%(levelname)s] >> %(message)s (%(asctime)s; %(filename)s:%(lineno)d)"
def initialize_logger(name,
log_to_file=False,
default_log_level=_logging.NOTSET):
"""Start a azpy logger"""
_logger = _logging.getLogger(name)
_logger.propagate = False
if not _logger.handlers:
# default log level
_log_level = int(os.getenv('DCCSI_LOGLEVEL', default_log_level))
if DCCSI_GDEBUG:
_log_level = int(10) # force when debugging
if _log_level:
ch = _logging.StreamHandler(sys.stdout)
ch.setLevel(_log_level)
formatter = _logging.Formatter(FRMT_LOG_LONG)
ch.setFormatter(formatter)
_logger.addHandler(ch)
_logger.setLevel(_log_level)
else:
_logger.addHandler(_logging.NullHandler())
_logger.debug('_log_level: {}'.format(_log_level))
# optionally add the log file handler (off by default)
if log_to_file:
_logger.info('DCCSI_LOG_PATH: {}'.format(DCCSI_LOG_PATH))
try:
# exist_ok, isn't available in py2.7 pathlib
# because it doesn't exist for os.makedirs
# pathlib2 backport used instead (see above)
if sys.version_info.major >= 3:
DCCSI_LOG_PATH.mkdir(parents=True, exist_ok=True)
else:
makedirs(str(DCCSI_LOG_PATH.resolve())) # py2.7
except FileExistsError:
# except FileExistsError: doesn't exist in py2.7
_logger.debug("Folder is already there")
else:
_logger.debug("Folder was created")
_log_filepath = Path(DCCSI_LOG_PATH, '{}.log'.format(name))
try:
_log_filepath.touch(mode=0o666, exist_ok=True)
except FileExistsError:
_logger.debug("Log file is already there: {}".format(_log_filepath))
else:
_logger.debug("Log file was created: {}".format(_log_filepath))
if _log_filepath.exists():
file_formatter = _logging.Formatter(FRMT_LOG_LONG)
file_handler = _logging.FileHandler(str(_log_filepath))
file_handler.setLevel(_logging.DEBUG)
file_handler.setFormatter(file_formatter)
_logger.addHandler(file_handler)
return _logger
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
# _ROOT_LOGGER = _logging.getLogger() # only use this if debugging
# https://stackoverflow.com/questions/56733085/how-to-know-the-current-file-path-after-being-frozen-into-an-executable-using-cx/56748839
#os.chdir(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))))
# -------------------------------------------------------------------------
if DCCSI_GDEBUG:
DCCSI_LOGLEVEL = int(10)
# set up logger with both console and file _logging
if DCCSI_GDEBUG:
_LOGGER = initialize_logger(_MODULEENAME, log_to_file=True)
else:
_LOGGER = initialize_logger(_MODULEENAME, log_to_file=False)
_LOGGER.debug('Invoking __init__.py for {0}.'.format({_PACKAGENAME}))
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
def makedirs(folder, *args, **kwargs):
"""a makedirs for py2.7 support"""
try:
return os.makedirs(folder, exist_ok=True, *args, **kwargs)
except TypeError:
# Unexpected arguments encountered
pass
try:
# Should work is TypeError was caused by exist_ok, eg., Py2
return os.makedirs(folder, *args, **kwargs)
except OSError as e:
if e.errno != errno.EEXIST:
raise
if os.path.isfile(folder):
# folder is a file, raise OSError just like os.makedirs() in Py3
raise
# -------------------------------------------------------------------------
# -------------------------------------------------------------------------
class FileExistsError(Exception):
"""Implements a stand-in Exception for py2.7"""
def __init__(self, message, errors):
# Call the base class constructor with the parameters it needs
super(FileExistsError, self).__init__(message)
# Now for your custom code...
self.errors = errors
if sys.version_info.major < 3:
FileExistsError = FileExistsError
# -------------------------------------------------------------------------
# ------------------------------------------------------------------------
# commonly reused utilities
AZASSET_LUT = """\
{
"Type": "JsonSerialization",
"Version": 1,
"ClassName": "LookupTableAsset",
"ClassData": {
"Name": "LookupTable",
"Intervals": [%s],
"Values": [%s]
}
}"""
FLOAT_EPSILON = sys.float_info.epsilon
# pow(f, e) won't work if f is negative, or may cause inf / NAN.
def no_nan_pow(base, power):
return pow(max(abs(base), (FLOAT_EPSILON, FLOAT_EPSILON, FLOAT_EPSILON)), power)
# Transform from high dynamic range to normalized
def inv_shaper_transform(bias, scale, v):
return pow(2.0, (v - bias) / scale)
# Transform from normalized range to high dynamic range
def shaper_transform(bias, scale, v, clip_threshold=FLOAT_EPSILON):
if v > 0.0:
return math.log(v, 2.0) * scale + bias
# this is probably not correct, clamps, avoids a math domain error
elif v <= 0.0:
_LOGGER.debug(f'Clipping a value: bias={bias}, scale={scale}, v={v}')
return math.log(clip_threshold, 2.0) * scale + bias
def get_uv_coord(size, r, g, b):
u = g * size + r
v = b
return (u, v)
def clamp(v):
return max(0.0, min(1.0, v))
def log2(x):
return (math.log10(x) /
math.log10(2))
def is_power_of_two(n):
return (math.ceil(log2(n)) == math.floor(log2(n)))
# ------------------------------------------------------------------------
###########################################################################
# Main Code Block, runs this script as main (testing)
# -------------------------------------------------------------------------
if __name__ == '__main__':
del _LOGGER

@ -0,0 +1,61 @@
# coding:utf-8
#!/usr/bin/python
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
"""Frame capture of the Displaymapper Passthrough (outputs .dds image)"""
# ------------------------------------------------------------------------
import logging as _logging
from env_bool import env_bool
# ------------------------------------------------------------------------
_MODULENAME = 'ColorGrading.capture_displaymapperpassthrough'
import ColorGrading.initialize
ColorGrading.initialize.start()
_LOGGER = _logging.getLogger(_MODULENAME)
_LOGGER.debug('Initializing: {0}.'.format({_MODULENAME}))
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
import azlmbr.bus
import azlmbr.atom
default_passtree = ["Root",
"MainPipeline_0",
"MainPipeline",
"PostProcessPass",
"LightAdaptation",
"DisplayMapperPass",
"DisplayMapperPassthrough"]
default_path = "FrameCapture\DisplayMapperPassthrough.dds"
# To Do: we should try to set display mapper to passthrough,
# then back after capture?
# To Do: we can wrap this, to call from a PySide2 GUI
def capture(command="CapturePassAttachment",
passtree=default_passtree,
pass_type="Output",
output_path=default_path):
azlmbr.atom.FrameCaptureRequestBus(azlmbr.bus.Broadcast,
command,
passtree,
pass_type,
output_path, 1)
# ------------------------------------------------------------------------
###########################################################################
# Main Code Block, runs this script as main
# -------------------------------------------------------------------------
if __name__ == '__main__':
capture()

@ -0,0 +1,120 @@
# coding:utf-8
#!/usr/bin/python
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
"""
input: a shaped .exr representing a LUT (for instance coming out of photoshop)
output: a inverse shaped LUT as .exr
^ as a .3DL (normalized lut file type)
^ as a .azasset (for o3de engine)
"""
import sys
import os
import argparse
import math
import site
import pathlib
from pathlib import Path
import logging as _logging
import numpy as np
# ------------------------------------------------------------------------
_MODULENAME = 'ColorGrading.exr_to_3dl_azasset'
import ColorGrading.initialize
ColorGrading.initialize.start()
_LOGGER = _logging.getLogger(_MODULENAME)
_LOGGER.debug('Initializing: {0}.'.format({_MODULENAME}))
try:
import OpenImageIO as oiio
pass
except ImportError as e:
_LOGGER.error(f"invalid import: {e}")
sys.exit(1)
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
from ColorGrading.from_3dl_to_azasset import write_azasset
from ColorGrading import get_uv_coord
def generate_lut_values(image_spec, image_buffer):
lut_size = image_spec.height
lut_intervals = []
lut_values = []
# First line contains the vertex intervals
dv = 1023.0 / float(lut_size-1)
for i in range(lut_size):
lut_intervals.append(np.uint16(dv * i))
# Texels are in R G B per line with indices increasing first with blue, then green, and then red.
for r in range(lut_size):
for g in range(lut_size):
for b in range(lut_size):
uv = get_uv_coord(lut_size, r, g, b)
px = np.array(image_buffer.getpixel(uv[0], uv[1]), dtype='f')
px = np.clip(px, 0.0, 1.0)
px = np.uint16(px * 4095)
lut_values.append(px)
return lut_intervals, lut_values
# To Do: add some input file validation
# If the input file doesn't exist, you'll get a LUT with res of 0 x 0 and result in a math error
#Resolution is 0 x 0
#writing C:\Depot\o3de-engine\Gems\AtomLyIntegration\CommonFeatures\Tools\ColorGrading\TestData\Nuke\HDR\Nuke_Post_grade_LUT.3dl...
#Traceback (most recent call last):
#File "..\..\Editor\Scripts\ColorGrading\exr_to_3dl_azasset.py", line 103, in <module>
#dv = 1023.0 / float(lutSize)
# ZeroDivisionError: float division by zero
def write_3DL(file_path, lut_size, lut_intervals, lut_values):
lut_file_path = f'{file_path}.3dl'
_LOGGER.info(f"Writing {lut_file_path}...")
lut_file = open(lut_file_path, 'w')
for i in range(lut_size):
lut_file.write(f"{lut_intervals[i]} ")
lut_file.write("\n")
for px in lut_values:
lut_file.write(f"{px[0]} {px[1]} {px[2]}\n")
lut_file.close()
###########################################################################
# Main Code Block, runs this script as main (testing)
# -------------------------------------------------------------------------
if __name__ == '__main__':
"""Run this file as main"""
parser=argparse.ArgumentParser()
parser.add_argument('--i', type=str, required=True, help='input file')
parser.add_argument('--o', type=str, required=True, help='output file')
args=parser.parse_args()
# Read input image
# image_buffer = oiio.ImageBuf("linear_lut.exr")
image_buffer=oiio.ImageBuf(args.i)
image_spec=image_buffer.spec()
_LOGGER.info(f"Resolution is, x: {image_buffer.spec().width} and y: {image_buffer.spec().height}")
if image_spec.width != image_spec.height * image_spec.height:
_LOGGER.info(f"invalid input file dimensions. Expect lengthwise LUT with dimension W: s*s X H: s, where s is the size of the LUT")
sys.exit(1)
lut_intervals, lut_values = generate_lut_values(image_spec, image_buffer)
write_3DL(args.o, image_spec.height, lut_intervals, lut_values)
write_azasset(args.o, image_spec.height, lut_intervals, lut_values)
# example from command line
# python % DCCSI_COLORGRADING_SCRIPTS %\lut_helper.py - -i C: \Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\linear_32_LUT.exr - -op pre - grading - -shaper Log2 - 48nits - -o C: \Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\base_Log2-48nits_32_LUT.exr

@ -0,0 +1,114 @@
# coding:utf-8
#!/usr/bin/python
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
"""Takes a 3dl file and encodes it into a .azasset file that can be read by the AssetProcessor"""
# ------------------------------------------------------------------------
import json
import sys, getopt
import logging as _logging
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
_MODULENAME = 'ColorGrading.from_3dl_to_azasset'
import ColorGrading.initialize
ColorGrading.initialize.start()
_LOGGER = _logging.getLogger(_MODULENAME)
_LOGGER.debug('Initializing: {0}.'.format({_MODULENAME}))
try:
import OpenImageIO as oiio
pass
except ImportError as e:
_LOGGER.error(f"invalid import: {e}")
sys.exit(1)
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
from ColorGrading import AZASSET_LUT
# ------------------------------------------------------------------------
def find_first_line(alist):
for lno, line in enumerate(alist):
if line[0].isdigit(): # skip non-number metadata
return lno
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
def write_azasset(file_path, lut_intervals, lut_values, azasset_json=AZASSET_LUT):
values_str = ''
for idx, px in enumerate(lut_values):
values_str += f"{px[0]}, {px[1]}, {px[2]}"
if idx < (len(lut_values) - 1):
values_str += ",\n"
intervals_str = ', '.join(map(str, lut_intervals))
azasset_json = azasset_json % (intervals_str, values_str)
asset_file_path = f"{file_path}.azasset"
_LOGGER.info(f"Writting {asset_file_path}...")
asset_file = open(asset_file_path, 'w')
asset_file.write(azasset_json)
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
def convert_3dl_to_azasset(input_file, output_file):
lut_intervals = []
lut_values = []
with open(input_file) as lut_file:
alist = [line.rstrip().lstrip() for line in lut_file]
intervals_idx = find_first_line(alist)
lut_intervals = alist[intervals_idx].split(" ")
lut_values_range = range(intervals_idx + 1, len(alist))
for ln in lut_values_range:
values = alist[ln].split(" ")
if values is None or len(values) < 3:
continue
lut_values.append(values)
write_azasset(output_file, lut_intervals, lut_values)
# ------------------------------------------------------------------------
###########################################################################
# Main Code Block, runs this script as main (testing)
# -------------------------------------------------------------------------
if __name__ == '__main__':
"""Run this file as main"""
input_file = ''
output_file = ''
try:
opts, args = getopt.getopt(sys.argv[1:],"hi:o:",["ifile=","ofile="])
except getopt.GetoptError:
_LOGGER.info('test.py -i <input_file> -o <output_file>')
sys.exit(2)
for opt, arg in opts:
_LOGGER.info(f"opt {opt} arg {arg}")
if opt == '-h':
_LOGGER.info('test.py -i <input_file> -o <output_file>')
sys.exit()
elif opt in ("-i", "--ifile"):
input_file = arg
elif opt in ("-o", "--ofile"):
output_file = arg
_LOGGER.info(f'Input file is "{input_file}"')
_LOGGER.info(f'Output file is "{output_file}"')
if input_file == '' or output_file == '':
_LOGGER.info('test.py -i <input_file> -o <output_file>')
else:
convert_3dl_to_azasset(input_file, output_file)

@ -0,0 +1,123 @@
# coding:utf-8
#!/usr/bin/python
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
# standard imports
import sys
import os
import pathlib
import site
from pathlib import Path
import logging as _logging
# local imports
from ColorGrading import env_bool
from ColorGrading import initialize_logger
from ColorGrading import DCCSI_GDEBUG
from ColorGrading import DCCSI_DEV_MODE
from ColorGrading import DCCSI_GDEBUGGER
from ColorGrading import DCCSI_LOGLEVEL
from ColorGrading import FRMT_LOG_LONG
__all__ = ['start']
# ------------------------------------------------------------------------
_PACKAGENAME = 'ColorGrading'
_MODULENAME = 'ColorGrading.initialize'
if DCCSI_GDEBUG:
DCCSI_LOGLEVEL = int(10)
# set up logger with both console and file _logging
if DCCSI_GDEBUG:
_LOGGER = initialize_logger(_PACKAGENAME, log_to_file=True, default_log_level=DCCSI_LOGLEVEL)
else:
_LOGGER = initialize_logger(_PACKAGENAME, log_to_file=False, default_log_level=DCCSI_LOGLEVEL)
_LOGGER.debug('Initializing: {0}.'.format({_MODULENAME}))
# connect to the debugger
if DCCSI_DEV_MODE:
APP_DATA_WING = Path('C:/Users/gallowj/AppData/Roaming/Wing Pro 7')
APP_DATA_WING.resolve()
site.addsitedir(pathlib.PureWindowsPath(APP_DATA_WING).as_posix())
import wingdbstub as debugger
try:
debugger.Ensure()
_LOGGER.info("Wing debugger attached")
except Exception as e:
_LOGGER.debug('Can not attach Wing debugger (running in IDE already?)')
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
def start():
"""set up access to OpenImageIO, within o3de or without"""
# ------------------------------------------------------------------------
try:
# running in o3de
import azlmbr
_O3DE_DEV = Path(os.getenv('O3DE_DEV', Path(azlmbr.paths.engroot)))
os.environ['O3DE_DEV'] = pathlib.PureWindowsPath(_O3DE_DEV).as_posix()
_LOGGER.debug(_O3DE_DEV)
_O3DE_BIN_PATH = Path(str(_O3DE_DEV),Path(azlmbr.paths.executableFolder))
_O3DE_BIN = Path(os.getenv('O3DE_BIN', _O3DE_BIN_PATH.resolve()))
os.environ['O3DE_BIN'] = pathlib.PureWindowsPath(_O3DE_BIN).as_posix()
_LOGGER.debug(_O3DE_BIN)
site.addsitedir(_O3DE_BIN)
except Exception as e:
# running external, start this module from:
# "C:\Depot\o3de-engine\Gems\Atom\Feature\Common\Tools\ColorGrading\cmdline\CMD_ColorGradinTools.bat"
pass
try:
_O3DE_DEV = Path(os.getenv('O3DE_DEV'))
_O3DE_DEV = _O3DE_DEV.resolve()
os.environ['O3DE_DEV'] = pathlib.PureWindowsPath(_O3DE_DEV).as_posix()
_LOGGER.debug(f'O3DE_DEV is: {_O3DE_DEV}')
except EnvironmentError as e:
_LOGGER.error('O3DE engineroot not set or found')
raise e
try:
_TAG_LY_BUILD_PATH = os.getenv('TAG_LY_BUILD_PATH', 'build')
_DEFAULT_BIN_PATH = Path(str(_O3DE_DEV), _TAG_LY_BUILD_PATH, 'bin', 'profile')
_O3DE_BIN_PATH = Path(os.getenv('O3DE_BIN_PATH', _DEFAULT_BIN_PATH))
_O3DE_BIN_PATH = _O3DE_BIN_PATH.resolve()
os.environ['O3DE_BIN_PATH'] = pathlib.PureWindowsPath(_O3DE_BIN_PATH).as_posix()
_LOGGER.debug(f'O3DE_BIN_PATH is: {_O3DE_BIN_PATH}')
site.addsitedir(pathlib.PureWindowsPath(_O3DE_BIN_PATH).as_posix())
except EnvironmentError as e:
_LOGGER.error('O3DE bin folder not set or found')
raise e
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
try:
import OpenImageIO as OpenImageIO
except ImportError as e:
_LOGGER.error(f"invalid import: {e}")
sys.exit(1)
# ------------------------------------------------------------------------
###########################################################################
# Main Code Block, runs this script as main (testing)
# -------------------------------------------------------------------------
if __name__ == '__main__':
"""Run this file as main"""
start()

@ -0,0 +1,110 @@
# coding:utf-8
#!/usr/bin/python
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
# lut_compositor.py
import sys
import os
import site
import argparse
import math
import pathlib
from pathlib import Path
import logging as _logging
from env_bool import env_bool
# ------------------------------------------------------------------------
_MODULENAME = 'ColorGrading.lut_compositor'
# set these true if you want them set globally for debugging
_DCCSI_GDEBUG = env_bool('DCCSI_GDEBUG', False)
_DCCSI_DEV_MODE = env_bool('DCCSI_DEV_MODE', False)
_DCCSI_GDEBUGGER = env_bool('DCCSI_GDEBUGGER', False)
_DCCSI_LOGLEVEL = env_bool('DCCSI_LOGLEVEL', int(20))
if _DCCSI_GDEBUG:
_DCCSI_LOGLEVEL = int(10)
FRMT_LOG_LONG = "[%(name)s][%(levelname)s] >> %(message)s (%(asctime)s; %(filename)s:%(lineno)d)"
_logging.basicConfig(level=_DCCSI_LOGLEVEL,
format=FRMT_LOG_LONG,
datefmt='%m-%d %H:%M')
_LOGGER = _logging.getLogger(_MODULENAME)
_LOGGER.debug('Initializing: {0}.'.format({_MODULENAME}))
import ColorGrading.initialize
ColorGrading.initialize.start()
try:
import OpenImageIO as oiio
pass
except ImportError as e:
_LOGGER.error(f"invalid import: {e}")
sys.exit(1)
# ------------------------------------------------------------------------
operations = {"composite": 0, "extract": 1}
invalidOp = -1
parser = argparse.ArgumentParser()
parser.add_argument('--i', type=str, required=True, help='input file')
parser.add_argument('--l', type=str, required=False, help='LUT to composite with screenshot in \'composite\' mode')
parser.add_argument('--op', type=str, required=True, help='operation. Should be \'composite\' or \'extract\'')
parser.add_argument('--s', type=int, required=True, help='size of the LUT (i.e. 16)')
parser.add_argument('--o', type=str, required=True, help='output file')
args = parser.parse_args()
op = operations.get(args.op, invalidOp)
if op == invalidOp:
print("invalid operation")
sys.exit(1)
elif op == 0:
if args.l is None:
print("no LUT file specified")
sys.exit()
# read in the input image
inBuf = oiio.ImageBuf(args.i)
inSpec = inBuf.spec()
print("Input resolution is ", inBuf.spec().width, " x ", inBuf.spec().height)
if op == 0:
outFileName = args.o
print("writing %s..." % (outFileName))
lutBuf = oiio.ImageBuf(args.l)
lutSpec = lutBuf.spec()
print("Resolution is ", lutBuf.spec().width, " x ", lutBuf.spec().height)
if lutSpec.width != lutSpec.height*lutSpec.height:
print("invalid input file dimensions. Expect lengthwise LUT with dimension W: s*s X H: s, where s is the size of the LUT")
sys.exit(1)
lutSize = lutSpec.height
outSpec = oiio.ImageSpec(inSpec.width, inSpec.height, 3, oiio.TypeFloat)
outBuf = oiio.ImageBuf(outSpec)
outBuf.write(outFileName)
for y in range(outBuf.ybegin, outBuf.yend):
for x in range(outBuf.xbegin, outBuf.xend):
srcPx = inBuf.getpixel(x, y)
dstPx = (srcPx[0], srcPx[1], srcPx[2])
if y < lutSpec.height and x < lutSpec.width:
lutPx = lutBuf.getpixel(x, y)
dstPx = (lutPx[0], lutPx[1], lutPx[2])
outBuf.setpixel(x, y, dstPx)
outBuf.write(outFileName)
elif op == 1:
outFileName = args.o
print("writing %s..." % (outFileName))
lutSize = args.s
lutSpec = oiio.ImageSpec(lutSize*lutSize, lutSize, 3, oiio.TypeFloat)
lutBuf = oiio.ImageBuf(lutSpec)
for y in range(lutBuf.ybegin, lutBuf.yend):
for x in range(lutBuf.xbegin, lutBuf.xend):
srcPx = inBuf.getpixel(x, y)
dstPx = (srcPx[0], srcPx[1], srcPx[2])
lutBuf.setpixel(x, y, dstPx)
lutBuf.write(outFileName)

@ -0,0 +1,186 @@
# coding:utf-8
#!/usr/bin/python
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
# lut_helper.py
import sys
import os
import argparse
import math
import site
import pathlib
from pathlib import Path
import logging as _logging
import numpy as np
from pathlib import Path
# ------------------------------------------------------------------------
_MODULENAME = 'ColorGrading.lut_helper'
import ColorGrading.initialize
ColorGrading.initialize.start()
_LOGGER = _logging.getLogger(_MODULENAME)
_LOGGER.debug('Initializing: {0}.'.format({_MODULENAME}))
try:
import OpenImageIO as oiio
pass
except ImportError as e:
_LOGGER.error(f"invalid import: {e}")
sys.exit(1)
# ------------------------------------------------------------------------
# ------------------------------------------------------------------------
# Transform from high dynamic range to normalized
from ColorGrading import inv_shaper_transform
# Transform from normalized range to high dynamic range
from ColorGrading import shaper_transform
# utils
from ColorGrading import get_uv_coord
from ColorGrading import log2
from ColorGrading import is_power_of_two
shaper_presets = {"Log2-48nits": (-6.5, 6.5),
"Log2-1000nits": (-12.0, 10.0),
"Log2-2000nits": (-12.0, 11.0),
"Log2-4000nits": (-12.0, 12.0)}
def transform_exr(image_buffer, out_image_buffer, op, out_path, write_exr):
# Set the destination image pixels by applying the shaperfunction
for y in range(out_image_buffer.ybegin, out_image_buffer.yend):
for x in range(out_image_buffer.xbegin, out_image_buffer.xend):
src_pixel = image_buffer.getpixel(x, y)
# _LOGGER.debug(f'src_pixel is: {src_pixel}')
if op == 0:
dst_pixel = (inv_shaper_transform(bias, scale, src_pixel[0]),
inv_shaper_transform(bias, scale, src_pixel[1]),
inv_shaper_transform(bias, scale, src_pixel[2]))
out_image_buffer.setpixel(x, y, dst_pixel)
elif op == 1:
dst_pixel = (shaper_transform(bias, scale, src_pixel[0]),
shaper_transform(bias, scale, src_pixel[1]),
shaper_transform(bias, scale, src_pixel[2]))
out_image_buffer.setpixel(x, y, dst_pixel)
else:
# Unspecified operation. Just write zeroes
out_image_buffer.setpixel(x, y, 0.0, 0.0, 0.0)
if write_exr:
_LOGGER.info(f"writing {out_path}.exr ...")
out_image_buffer.write(out_path + '.exr', "float")
return out_image_buffer
###########################################################################
# Main Code Block, runs this script as main (testing)
# -------------------------------------------------------------------------
if __name__ == '__main__':
"""Run this file as main"""
operations = {"pre-grading": 0, "post-grading": 1}
parser = argparse.ArgumentParser()
parser.add_argument('--i', type=str, required=True, help='input file')
parser.add_argument('--shaper', type=str, required=True,
help='shaper preset. Should be one of \'Log2-48nits\', \'Log2-1000nits\', \'Log2-2000nits\', \'Log2-4000nits\'')
parser.add_argument('--op', type=str, required=True, help='operation. Should be \'pre-grading\' or \'post-grading\'')
parser.add_argument('--o', type=str, required=True, help='output file')
parser.add_argument('-e', dest='writeExr', action='store_true', help='output lut as exr file (float)')
parser.add_argument('-l', dest='write3dl', action='store_true', help='output lut as .3dl file')
parser.add_argument('-a', dest='writeAsset', action='store_true', help='write out lut as O3dE .azasset file')
args = parser.parse_args()
# Check for valid shaper type
invalid_shaper = (0, 0)
invalid_op = -1
shaper_limits = shaper_presets.get(args.shaper, invalid_shaper)
if shaper_limits == invalid_shaper:
_LOGGER.error("invalid shaper")
sys.exit(1)
op = operations.get(args.op, invalid_op)
if op == invalid_op:
_LOGGER.error("invalid operation")
sys.exit(1)
# input validation
input_file = Path(args.i)
if input_file.is_file():
# file exists
pass
else:
FILE_ERROR_MSG = f'File does not exist: {input_file}'
_LOGGER.error(FILE_ERROR_MSG)
#raise FileNotFoundError(FILE_ERROR_MSG)
sys.exit(1)
# Read input image
#buf = oiio.ImageBuf("linear_lut.exr")
image_buffer = oiio.ImageBuf(args.i)
image_spec = image_buffer.spec()
_LOGGER.info(f"Resolution is x:{image_spec.height}, y:{image_spec.width}")
if image_spec.height < 16:
_LOGGER.info(f"invalid input file dimensions: x is {image_spec.height}. Expected LUT with height dimension >= 16 pixels")
sys.exit(1)
if not is_power_of_two(image_buffer.spec().height):
_LOGGER.info(f"invalid input file dimensions: {buf.spec().height}. Expected LUT dimensions power of 2: 16, 32, or 64 height")
sys.exit(1)
elif image_spec.width != image_spec.height * image_spec.height:
_LOGGER.info("invalid input file dimensions. Expect lengthwise LUT with dimension W: s*s X H: s, where s is the size of the LUT")
sys.exit(1)
lut_size = image_spec.height
middle_grey = 0.18
lower_stops = shaper_limits[0]
upper_stops = shaper_limits[1]
middle_grey = math.log(middle_grey, 2.0)
log_min = middle_grey + lower_stops
log_max = middle_grey + upper_stops
scale = 1.0 / (log_max - log_min)
bias = -scale * log_min
_LOGGER.info("Shaper: range in stops %.1f -> %.1f (linear: %.3f -> %.3f) logMin %.3f logMax %.3f scale %.3f bias %.3f\n" %
(lower_stops, upper_stops, middle_grey * math.pow(2.0, lower_stops), middle_grey * math.pow(2.0, upper_stops),
log_min, log_max, scale, bias))
buffer_name = Path(args.o).name
# Create a writing image
out_image_spec = oiio.ImageSpec(image_buffer.spec().width, image_buffer.spec().height, 3, "float")
out_image_buffer = oiio.ImageBuf(out_image_spec)
# write out the modified exr file
write_exr = False
if args.writeExr:
write_exr = True
out_image_buffer = transform_exr(image_buffer, out_image_buffer, op, args.o, write_exr)
from ColorGrading.exr_to_3dl_azasset import generate_lut_values
lut_intervals, lut_values = generate_lut_values(image_spec, out_image_buffer)
if args.write3dl:
from ColorGrading.exr_to_3dl_azasset import write_3DL
write_3DL(args.o, lut_size, lut_intervals, lut_values)
if args.writeAsset:
from ColorGrading import AZASSET_LUT
from ColorGrading.from_3dl_to_azasset import write_azasset
write_azasset(args.o, lut_intervals, lut_values, AZASSET_LUT)

@ -0,0 +1,60 @@
# coding:utf-8
#!/usr/bin/python
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
"""
Boostraps O3DE editor access to the python scripts within Atom.Feature.Commmon
Example: color grading related scripts
"""
# ------------------------------------------------------------------------
# standard imports
import sys
import os
import inspect
import pathlib
import site
from pathlib import Path
import logging as _logging
# ------------------------------------------------------------------------
_MODULENAME = 'Gems.Atom.Feature.Common.bootstrap'
# print (inspect.getfile(inspect.currentframe()) # script filename (usually with path)
# script directory
_MODULE_PATH = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
_MODULE_PATH = Path(_MODULE_PATH)
site.addsitedir(_MODULE_PATH.resolve())
from ColorGrading import env_bool
from ColorGrading import initialize_logger
from ColorGrading import DCCSI_GDEBUG
from ColorGrading import DCCSI_DEV_MODE
from ColorGrading import DCCSI_LOGLEVEL
if DCCSI_GDEBUG:
DCCSI_LOGLEVEL = int(10)
_LOGGER = initialize_logger(_MODULENAME, log_to_file=False, default_log_level=DCCSI_LOGLEVEL)
_LOGGER.info('Initializing: {0}.'.format({_MODULENAME}))
_LOGGER.info(f'site.addsitedir({_MODULE_PATH.resolve()})')
# early connect to the debugger
if DCCSI_DEV_MODE:
APP_DATA_WING = Path('C:/Users/gallowj/AppData/Roaming/Wing Pro 7')
APP_DATA_WING.resolve()
site.addsitedir(pathlib.PureWindowsPath(APP_DATA_WING).as_posix())
import wingdbstub as debugger
try:
debugger.Ensure()
_LOGGER.info("Wing debugger attached")
except Exception as e:
_LOGGER.debug('Can not attach Wing debugger (running in IDE already?)')
from ColorGrading.initialize import start
start()
# ------------------------------------------------------------------------

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6c9f3506348d675c15d65e6f4a5cf1b773144cf5c8a2227c1f985806e6afe4b1
size 1042

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a269460a16993fce1d1973bccf53bc7f88a66ba1bad7b444b258bcd7b26527f8
size 3326

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:767ebd1863954ac04c16a68ec90c31c1ed15dfda26239dd0f0159fa279100661
size 18642

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:05e1fb5ea519499012cfe11b4fa245396e6ae49e476fe7a5951b20bf28a367b1
size 1063

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:52386c8753b282e5ff428819e79a5ad1675ad86cdf75c8402ea1ab41e630ac98
size 3328

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b6d7bc8a85561d37aaf3f5ed6547ce939759cd00db96874bc9e6107c3ee12e23
size 18421

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:937b4d3388f27947886f49cd935663142806bce38768b83c89b8765c03bbd67b
size 1047

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0ce932c419c11ed2366cd94e27547f65d11abcd604e5262583a36e661d4ad41b
size 3329

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8786dc9bcf1afe914fafaac63659e3d0fcdefa453c5bee153fa915094c0df132
size 18604

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:155b3ba516d77fcfc9a77a7e96acbf450759d87ee7f042730d1d75b0f2628902
size 1038

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ea718b119139cc8a55b944555ab0b0ad9d012a676c5e4c63bd338f26e8290a01
size 3309

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:75340a9238177b5bd3b8f8a3d4864fc75a613ec29222ecf7c90bc5e3b4bc8416
size 18349

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6305b5c0cedc945824906aa207bb8f182c811aee12a2f8ffd2ed870b2a60aa7b
size 2758

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:85c037b1b8118c85ecf288c6ecd2e870b5c1595c486029cc9e7c3348fcd777d1
size 3228

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e0612c6a43bec9d310da1dbfcba55f8e254e02af9fafca9201573e54dd24fa7f
size 18289

@ -0,0 +1,230 @@
#! C:/Program Files/Nuke13.0v3/nuke-13.0.3.dll -nx
version 13.0 v3
define_window_layout_xml {<?xml version="1.0" encoding="UTF-8"?>
<layout version="1.0">
<window x="108" y="0" w="3729" h="2127" screen="0">
<splitter orientation="1">
<split size="40"/>
<dock id="" hideTitles="1" activePageId="Toolbar.1">
<page id="Toolbar.1"/>
</dock>
<split size="3066" stretch="1"/>
<splitter orientation="2">
<split size="1224"/>
<dock id="" activePageId="Viewer.2">
<page id="Viewer.1"/>
<page id="Viewer.2"/>
</dock>
<split size="861"/>
<dock id="" activePageId="DAG.1" focus="true">
<page id="DAG.1"/>
<page id="Curve Editor.1"/>
<page id="DopeSheet.1"/>
</dock>
</splitter>
<split size="615"/>
<dock id="" activePageId="Properties.1">
<page id="Properties.1"/>
<page id="uk.co.thefoundry.backgroundrenderview.1"/>
</dock>
</splitter>
</window>
</layout>
}
Root {
inputs 0
name C:/Depot/o3de/Gems/Atom/Feature/Common/Tools/ColorGrading/Resources/TestData/Nuke/HDR/Test_Extreme_Grade/Nuke_Test_Extreme_Grade.nk
project_directory "\"C:/Depot/o3de-engine/Gems/AtomLyIntegration/CommonFeatures/Tools/ColorGrading/TestData/Nuke/"
format "2048 1556 0 0 2048 1556 1 2K_Super_35(full-ap)"
proxy_type scale
proxy_format "1024 778 0 0 1024 778 1 1K_Super_35(full-ap)"
colorManagement OCIO
OCIO_config aces_1.0.3
defaultViewerLUT "OCIO LUTs"
workingSpaceLUT scene_linear
monitorLut ACES/Rec.709
monitorOutLUT "sRGB (ACES)"
int8Lut matte_paint
int16Lut texture_paint
logLut compositing_log
floatLut scene_linear
}
Read {
inputs 0
file_type exr
file C:/Depot/o3de/Gems/Atom/Feature/Common/Tools/ColorGrading/Resources/LUTs/linear_32_LUT.exr
format "1024 32 0 0 1024 32 1 "
origset true
colorspace data
name Read_Linear_LUT_32
xpos -846
ypos 10
}
set Nb1e9800 [stack 0]
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer1
xpos -847
ypos 135
}
push $Nb1e9800
OCIOFileTransform {
file C:/Depot/o3de-engine/Tools/ColorGrading/OpenColorIO-Configs/aces_1.0.3/luts/Log2_48_nits_Shaper_to_linear.spi1d
working_space scene_linear
name Log2_48_nits_Shaper_to_linear
xpos -710
ypos 46
}
set Nb1e9000 [stack 0]
Transform {
center {1024 778}
name Transform_Position_LUT
xpos -579
ypos 3
}
set Nb1e8c00 [stack 0]
Read {
inputs 0
file_type exr
file C:/Depot/o3de/Gems/Atom/Feature/Common/Tools/ColorGrading/Resources/TestData/displaymapperpassthrough.exr
format "2802 1854 0 0 2802 1854 1 "
origset true
name Read_DisplayMapperPassthrough
xpos -577
ypos -119
}
ZMerge {
inputs 2
name ZMerge_Combine
xpos -413
ypos -83
}
set Nb18fc00 [stack 0]
HueShift {
ingray 0.136
outgray 0.31
saturation 2
color_saturation 0.3
hue_rotation -150
brightness 0.81
name HueShift1
xpos -256
ypos -83
}
set Nb18f800 [stack 0]
OCIOCDLTransform {
saturation 1.23
working_space scene_linear
name INV_Log2_48_nits_Shaper_to_linear
xpos -86
ypos -83
}
set Nb18f400 [stack 0]
Crop {
box {0 0 1024 32}
reformat true
crop false
name Crop1
xpos -86
ypos 32
}
set Nb18f000 [stack 0]
OCIOFileTransform {
file C:/Depot/o3de-engine/Tools/ColorGrading/OpenColorIO-Configs/aces_1.0.3/luts/Log2_48_nits_Shaper_to_linear.spi1d
direction inverse
working_space reference
name OCIOFileTransform2
xpos 84
ypos 32
}
Write {
file C:/Depot/o3de/Gems/Atom/Feature/Common/Tools/ColorGrading/Resources/TestData/Nuke/HDR/Test_Extreme_Grade/test-extreme-grade_inv-Log2-48nits_32_LUT.exr
colorspace data
raw true
file_type exr
write_ACES_compliant_EXR true
datatype "32 bit float"
first_part rgba
version 8
in_colorspace scene_linear
out_colorspace scene_linear
name Write_RAW_LUT
xpos 242
ypos 20
}
Viewer {
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer7
xpos 242
ypos 135
}
push $Nb18f400
Write {
file C:/Depot/o3de/Gems/Atom/Feature/Common/Tools/ColorGrading/Resources/TestData/Nuke/HDR/Test_Extreme_Grade/Shot_post_test-extreme-grade.exr
colorspace compositing_linear
file_type exr
write_ACES_compliant_EXR true
datatype "32 bit float"
first_part rgba
version 9
name Write_Shot_Grade_Comp
selected true
xpos 353
ypos -95
}
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer8
xpos 357
ypos 135
}
push $Nb1e9000
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer2
xpos -710
ypos 137
}
push $Nb1e8c00
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer3
xpos -579
ypos 135
}
push $Nb18fc00
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer4
xpos -413
ypos 133
}
push $Nb18f800
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer5
xpos -254
ypos 133
}
push $Nb18f000
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer6
xpos -86
ypos 134
}

@ -0,0 +1,232 @@
#! C:/Program Files/Nuke13.0v3/nuke-13.0.3.dll -nx
version 13.0 v3
define_window_layout_xml {<?xml version="1.0" encoding="UTF-8"?>
<layout version="1.0">
<window x="108" y="0" w="3729" h="2127" screen="0">
<splitter orientation="1">
<split size="40"/>
<dock id="" hideTitles="1" activePageId="Toolbar.1">
<page id="Toolbar.1"/>
</dock>
<split size="3066" stretch="1"/>
<splitter orientation="2">
<split size="1224"/>
<dock id="" activePageId="Viewer.6">
<page id="Viewer.1"/>
<page id="Viewer.2"/>
<page id="Viewer.3"/>
<page id="Viewer.4"/>
<page id="Viewer.5"/>
<page id="Viewer.6"/>
<page id="Viewer.7"/>
</dock>
<split size="861"/>
<dock id="" activePageId="DAG.1" focus="true">
<page id="DAG.1"/>
<page id="Curve Editor.1"/>
<page id="DopeSheet.1"/>
</dock>
</splitter>
<split size="615"/>
<dock id="" activePageId="Properties.1">
<page id="Properties.1"/>
<page id="uk.co.thefoundry.backgroundrenderview.1"/>
</dock>
</splitter>
</window>
</layout>
}
Root {
inputs 0
name C:/Depot/o3de/Gems/Atom/Feature/Common/Tools/ColorGrading/Resources/TestData/Nuke/HDR/Test_Extreme_Grade/Nuke_Test_Extreme_Grade.nk
project_directory "\"C:/Depot/o3de-engine/Gems/AtomLyIntegration/CommonFeatures/Tools/ColorGrading/TestData/Nuke/"
format "2048 1556 0 0 2048 1556 1 2K_Super_35(full-ap)"
proxy_type scale
proxy_format "1024 778 0 0 1024 778 1 1K_Super_35(full-ap)"
colorManagement OCIO
OCIO_config aces_1.0.3
defaultViewerLUT "OCIO LUTs"
workingSpaceLUT scene_linear
monitorLut ACES/Rec.709
monitorOutLUT "sRGB (ACES)"
int8Lut matte_paint
int16Lut texture_paint
logLut compositing_log
floatLut scene_linear
}
Read {
inputs 0
file_type exr
file C:/Depot/o3de/Gems/Atom/Feature/Common/Tools/ColorGrading/Resources/LUTs/linear_32_LUT.exr
format "1024 32 0 0 1024 32 1 "
origset true
colorspace data
name Read_Linear_LUT_32
xpos -846
ypos 10
}
set Ncf69800 [stack 0]
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer1
xpos -847
ypos 135
}
push $Ncf69800
OCIOFileTransform {
file C:/Depot/o3de-engine/Tools/ColorGrading/OpenColorIO-Configs/aces_1.0.3/luts/Log2_48_nits_Shaper_to_linear.spi1d
working_space scene_linear
name Log2_48_nits_Shaper_to_linear
xpos -710
ypos 46
}
set Ncf69000 [stack 0]
Transform {
center {1024 778}
name Transform_Position_LUT
xpos -579
ypos 3
}
set Ncf68c00 [stack 0]
Read {
inputs 0
file_type exr
file C:/Depot/o3de/Gems/Atom/Feature/Common/Tools/ColorGrading/Resources/TestData/displaymapperpassthrough.exr
format "2802 1854 0 0 2802 1854 1 "
origset true
name Read_DisplayMapperPassthrough
xpos -577
ypos -119
}
ZMerge {
inputs 2
name ZMerge_Combine
xpos -413
ypos -83
}
set Ncef7c00 [stack 0]
HueShift {
ingray 0.136
outgray 0.31
saturation 2
color_saturation 0.3
hue_rotation -150
brightness 0.81
name HueShift1
xpos -256
ypos -83
}
set Ncef7800 [stack 0]
OCIOCDLTransform {
saturation 1.23
working_space scene_linear
name INV_Log2_48_nits_Shaper_to_linear
xpos -86
ypos -83
}
set Ncef7400 [stack 0]
Crop {
box {0 0 1024 32}
reformat true
crop false
name Crop1
xpos -86
ypos 32
}
set Ncef7000 [stack 0]
OCIOFileTransform {
file C:/Depot/o3de-engine/Tools/ColorGrading/OpenColorIO-Configs/aces_1.0.3/luts/Log2_48_nits_Shaper_to_linear.spi1d
direction inverse
working_space reference
name OCIOFileTransform2
xpos 84
ypos 32
}
Write {
file C:/Depot/o3de/Gems/Atom/Feature/Common/Tools/ColorGrading/Resources/TestData/Nuke/HDR/Test_Extreme_Grade/test-extreme-grade_inv-Log2-48nits_32_LUT.exr
colorspace data
raw true
file_type exr
write_ACES_compliant_EXR true
datatype "32 bit float"
first_part rgba
version 8
name Write_RAW_LUT
xpos 242
ypos 20
}
Viewer {
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer7
xpos 242
ypos 135
}
push $Ncef7400
Write {
file C:/Depot/o3de/Gems/Atom/Feature/Common/Tools/ColorGrading/Resources/TestData/Nuke/HDR/Test_Grade/Shot_post_test-extreme-grade.exr
colorspace compositing_linear
file_type exr
write_ACES_compliant_EXR true
datatype "32 bit float"
first_part rgba
version 7
name Write_Shot_Grade_Comp
xpos 353
ypos -95
}
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer8
xpos 357
ypos 135
}
push $Ncf69000
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer2
xpos -710
ypos 137
}
push $Ncf68c00
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer3
xpos -579
ypos 135
}
push $Ncef7c00
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer4
xpos -413
ypos 133
}
push $Ncef7800
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer5
xpos -254
ypos 133
}
push $Ncef7000
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer6
xpos -86
ypos 134
}

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7ea4288b55725bfa89d7add69ea45b0ac9315cfffd6acfba66082f4d21c1ac1a
size 31227624

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ad9a024034bfc356f7c6fd4c19d617a7321306c68b7f824fb44b73ad57613244
size 197689

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9ff499c054a259a3cd389b613382066f258287215f61da56115b3e958733dbe6
size 31227639

@ -0,0 +1,225 @@
#! C:/Program Files/Nuke13.0v3/nuke-13.0.3.dll -nx
version 13.0 v3
define_window_layout_xml {<?xml version="1.0" encoding="UTF-8"?>
<layout version="1.0">
<window x="108" y="0" w="3729" h="2127" screen="0">
<splitter orientation="1">
<split size="40"/>
<dock id="" hideTitles="1" activePageId="Toolbar.1">
<page id="Toolbar.1"/>
</dock>
<split size="3066" stretch="1"/>
<splitter orientation="2">
<split size="1224"/>
<dock id="" activePageId="Viewer.7">
<page id="Viewer.1"/>
<page id="Viewer.2"/>
<page id="Viewer.3"/>
<page id="Viewer.4"/>
<page id="Viewer.5"/>
<page id="Viewer.6"/>
<page id="Viewer.7"/>
</dock>
<split size="861"/>
<dock id="" activePageId="DAG.1" focus="true">
<page id="DAG.1"/>
<page id="Curve Editor.1"/>
<page id="DopeSheet.1"/>
</dock>
</splitter>
<split size="615"/>
<dock id="" activePageId="Properties.1">
<page id="Properties.1"/>
<page id="uk.co.thefoundry.backgroundrenderview.1"/>
</dock>
</splitter>
</window>
</layout>
}
Root {
inputs 0
name C:/Depot/o3de/Gems/Atom/Feature/Common/Tools/ColorGrading/Resources/TestData/Nuke/HDR/Test_Grade/Test-Grade.nk
project_directory "\"C:/Depot/o3de-engine/Gems/AtomLyIntegration/CommonFeatures/Tools/ColorGrading/TestData/Nuke/"
format "2048 1556 0 0 2048 1556 1 2K_Super_35(full-ap)"
proxy_type scale
proxy_format "1024 778 0 0 1024 778 1 1K_Super_35(full-ap)"
colorManagement OCIO
OCIO_config aces_1.0.3
defaultViewerLUT "OCIO LUTs"
workingSpaceLUT scene_linear
monitorLut ACES/Rec.709
monitorOutLUT "sRGB (ACES)"
int8Lut matte_paint
int16Lut texture_paint
logLut compositing_log
floatLut scene_linear
}
Read {
inputs 0
file_type exr
file C:/Depot/o3de/Gems/Atom/Feature/Common/Tools/ColorGrading/Resources/LUTs/linear_32_LUT.exr
format "1024 32 0 0 1024 32 1 "
origset true
colorspace data
raw true
name Read_Linear_LUT_32
xpos -846
ypos 10
}
set N16319800 [stack 0]
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer1
xpos -846
ypos 135
}
push $N16319800
OCIOFileTransform {
file C:/Depot/o3de-engine/Tools/ColorGrading/OpenColorIO-Configs/aces_1.0.3/luts/Log2_48_nits_Shaper_to_linear.spi1d
working_space rendering
name Log2_48_nits_Shaper_to_linear
xpos -710
ypos 46
}
set N16319000 [stack 0]
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer2
xpos -710
ypos 137
}
push $N16319000
Transform {
center {1024 778}
name Transform_Position_LUT
xpos -579
ypos 3
}
set N16318c00 [stack 0]
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer3
xpos -579
ypos 135
}
push $N16318c00
Read {
inputs 0
file_type exr
file C:/Depot/o3de/Gems/Atom/Feature/Common/Tools/ColorGrading/Resources/TestData/displaymapperpassthrough.exr
format "2802 1854 0 0 2802 1854 1 "
origset true
name Read_DisplayMapperPassthrough
xpos -580
ypos -146
}
ZMerge {
inputs 2
name ZMerge_Combine
xpos -413
ypos -83
}
set N16297c00 [stack 0]
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer4
xpos -413
ypos 128
}
push $N16297c00
HueShift {
ingray {0.18 0.18 0.18}
outgray {0.18 0.18 0.18}
saturation 1.26
color {0.12 0.12 0.12}
color_saturation 0.78
hue_rotation -150
brightness 0.74
name HueShift1
xpos -256
ypos -83
}
set N16297800 [stack 0]
Crop {
box {0 0 1024 32}
reformat true
crop false
name Crop1
xpos -86
ypos 32
}
set N16297400 [stack 0]
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer6
xpos -86
ypos 134
}
push $N16297800
Write {
file C:/Depot/o3de/Gems/Atom/Feature/Common/Tools/ColorGrading/Resources/TestData/Nuke/HDR/Test_Grade/Shot_post_test-grade.exr
colorspace compositing_linear
file_type exr
write_ACES_compliant_EXR true
datatype "32 bit float"
first_part rgba
version 11
name Write_Shot_Grade_Comp
xpos 353
ypos -95
}
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer8
xpos 353
ypos 135
}
push $N16297400
OCIOFileTransform {
file C:/Depot/o3de-engine/Tools/ColorGrading/OpenColorIO-Configs/aces_1.0.3/luts/Log2_48_nits_Shaper_to_linear.spi1d
direction inverse
working_space data
name invLog2_48_nits_Shaper_to_linear
xpos 74
ypos -14
}
Write {
file C:/Depot/o3de/Gems/Atom/Feature/Common/Tools/ColorGrading/Resources/TestData/Nuke/HDR/Test_Grade/test-grade_inv-Log2-48nits_32_LUT.exr
colorspace data
file_type exr
datatype "32 bit float"
first_part rgba
version 11
name Write_RAW_LUT
xpos 242
ypos 20
}
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer7
xpos 242
ypos 135
}
push $N16297800
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer5
xpos -256
ypos 130
}

@ -0,0 +1,227 @@
#! C:/Program Files/Nuke13.0v3/nuke-13.0.3.dll -nx
version 13.0 v3
define_window_layout_xml {<?xml version="1.0" encoding="UTF-8"?>
<layout version="1.0">
<window x="108" y="0" w="3729" h="2127" screen="0">
<splitter orientation="1">
<split size="40"/>
<dock id="" hideTitles="1" activePageId="Toolbar.1">
<page id="Toolbar.1"/>
</dock>
<split size="2883" stretch="1"/>
<splitter orientation="2">
<split size="1224"/>
<dock id="" activePageId="Viewer.1">
<page id="Viewer.1"/>
<page id="Viewer.2"/>
<page id="Viewer.3"/>
<page id="Viewer.4"/>
<page id="Viewer.5"/>
<page id="Viewer.6"/>
<page id="Viewer.7"/>
<page id="Viewer.8"/>
</dock>
<split size="861"/>
<dock id="" activePageId="DAG.1">
<page id="DAG.1"/>
<page id="Curve Editor.1"/>
<page id="DopeSheet.1"/>
</dock>
</splitter>
<split size="798"/>
<dock id="" activePageId="Properties.1" focus="true">
<page id="Properties.1"/>
<page id="uk.co.thefoundry.backgroundrenderview.1"/>
</dock>
</splitter>
</window>
</layout>
}
Root {
inputs 0
name C:/Depot/o3de/Gems/Atom/Feature/Common/Assets/ColorGrading/TestData/Nuke/HDR/Test_Grade/Test-Grade.nk
project_directory "\"C:/Depot/o3de-engine/Gems/AtomLyIntegration/CommonFeatures/Tools/ColorGrading/TestData/Nuke/"
format "2048 1556 0 0 2048 1556 1 2K_Super_35(full-ap)"
proxy_type scale
proxy_format "1024 778 0 0 1024 778 1 1K_Super_35(full-ap)"
colorManagement OCIO
OCIO_config aces_1.0.3
defaultViewerLUT "OCIO LUTs"
workingSpaceLUT scene_linear
monitorLut ACES/Rec.709
monitorOutLUT "sRGB (ACES)"
int8Lut matte_paint
int16Lut texture_paint
logLut compositing_log
floatLut scene_linear
}
Read {
inputs 0
file_type exr
file C:/Depot/o3de/Gems/Atom/Feature/Common/Tools/ColorGrading/Resources/LUTs/linear_32_LUT.exr
format "1024 32 0 0 1024 32 1 "
origset true
colorspace data
raw true
name Read_Linear_LUT_32
xpos -846
ypos 10
}
set N3bfa9800 [stack 0]
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer1
xpos -846
ypos 135
}
push $N3bfa9800
OCIOFileTransform {
file C:/Depot/o3de-engine/Tools/ColorGrading/OpenColorIO-Configs/aces_1.0.3/luts/Log2_48_nits_Shaper_to_linear.spi1d
working_space rendering
name Log2_48_nits_Shaper_to_linear
xpos -710
ypos 46
}
set N3bfa9000 [stack 0]
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer2
xpos -710
ypos 137
}
push $N3bfa9000
Transform {
center {1024 778}
name Transform_Position_LUT
xpos -579
ypos 3
}
set N3bfa8c00 [stack 0]
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer3
xpos -579
ypos 135
}
push $N3bfa8c00
Read {
inputs 0
file_type exr
file C:/Depot/o3de/Gems/Atom/Feature/Common/Tools/ColorGrading/Resources/TestData/displaymapperpassthrough.exr
format "2802 1854 0 0 2802 1854 1 "
origset true
name Read_DisplayMapperPassthrough
xpos -580
ypos -146
}
ZMerge {
inputs 2
name ZMerge_Combine
xpos -413
ypos -83
}
set N3bf5bc00 [stack 0]
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer4
xpos -413
ypos 128
}
push $N3bf5bc00
HueShift {
ingray {0.18 0.18 0.18}
outgray {0.18 0.18 0.18}
saturation 1.26
color {0.12 0.12 0.12}
color_saturation 0.78
hue_rotation -150
brightness 0.74
name HueShift1
xpos -256
ypos -83
}
set N3bf5b800 [stack 0]
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer5
xpos -256
ypos 130
}
push $N3bf5b800
Crop {
box {0 0 1024 32}
reformat true
crop false
name Crop1
xpos -86
ypos 32
}
set N3bf5ac00 [stack 0]
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer6
xpos -86
ypos 134
}
push $N3bf5b800
Write {
file C:/Depot/o3de/Gems/Atom/Feature/Common/Tools/ColorGrading/Resources/TestData/Nuke/HDR/Test_Grade/Nuke_Shot_post_grade.exr
colorspace compositing_linear
file_type exr
write_ACES_compliant_EXR true
datatype "32 bit float"
first_part rgba
version 10
name Write_Shot_Grade_Comp
selected true
xpos 353
ypos -95
}
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer8
xpos 353
ypos 135
}
push $N3bf5ac00
OCIOFileTransform {
file C:/Depot/o3de-engine/Tools/ColorGrading/OpenColorIO-Configs/aces_1.0.3/luts/Log2_48_nits_Shaper_to_linear.spi1d
direction inverse
working_space data
name invLog2_48_nits_Shaper_to_linear
xpos 74
ypos -14
}
Write {
file C:/Depot/o3de/Gems/Atom/Feature/Common/Tools/ColorGrading/Resources/TestData/Nuke/HDR/Test_Grade/test-grade_inv-Log2-48nits_32_LUT.exr
colorspace data
file_type exr
datatype "32 bit float"
first_part rgba
version 10
name Write_RAW_LUT
xpos 242
ypos 20
}
Viewer {
frame 1
frame_range 1-100
viewerProcess "sRGB (ACES)"
name Viewer7
xpos 242
ypos 135
}

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c11862c33eb828f32df7dd1a7dd8843f7553379334553551aae0aaadb2100a01
size 276701

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:20355376cea9da29e36086debf3d84a6453dcbd8c1616c3c57e5a6c0df0a9e0e
size 15105796

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:da5a5fcf9eff8064f27f7f146db353fde7207fc36b10cfde95dc6b45941663bf
size 5046039

@ -0,0 +1,57 @@
#! C:/Program Files/Nuke13.0v3/nuke-13.0.3.dll -nx
version 13.0 v3
define_window_layout_xml {<?xml version="1.0" encoding="UTF-8"?>
<layout version="1.0">
<window x="108" y="0" w="1864" h="1047" screen="0">
<splitter orientation="1">
<split size="40"/>
<dock id="" hideTitles="1" activePageId="Toolbar.1">
<page id="Toolbar.1"/>
</dock>
<split size="1201" stretch="1"/>
<splitter orientation="2">
<split size="590"/>
<dock id="" activePageId="Viewer.1">
<page id="Viewer.1"/>
</dock>
<split size="415"/>
<dock id="" activePageId="DAG.1">
<page id="DAG.1"/>
<page id="Curve Editor.1"/>
<page id="DopeSheet.1"/>
</dock>
</splitter>
<split size="615"/>
<dock id="" activePageId="Properties.1" focus="true">
<page id="Properties.1"/>
<page id="uk.co.thefoundry.backgroundrenderview.1"/>
</dock>
</splitter>
</window>
</layout>
}
Root {
inputs 0
name C:/Depot/o3de-engine/Gems/AtomLyIntegration/CommonFeatures/Tools/ColorGrading/TestData/Nuke/O3DE_HDR_Nuke_Color_Grading
project_directory "\[python \{nuke.script_directory()\}]"
label "This is a Nuke project template used to validate HDR / ACES color grading workflow in Nuke to generate 'Look Modification' (LMT) Luts for Oopen 3D Engine."
format "2048 1556 0 0 2048 1556 1 2K_Super_35(full-ap)"
proxy_type scale
proxy_format "1024 778 0 0 1024 778 1 1K_Super_35(full-ap)"
colorManagement Nuke
workingSpaceLUT linear
monitorLut sRGB
monitorOutLUT rec709
int8Lut sRGB
int16Lut sRGB
logLut Cineon
floatLut linear
}
Viewer {
inputs 0
frame 1
frame_range 1-100
name Viewer1
xpos -40
ypos -9
}

@ -0,0 +1,125 @@
#! C:/Program Files/Nuke13.0v3/nuke-13.0.3.dll -nx
version 13.0 v3
define_window_layout_xml {<?xml version="1.0" encoding="UTF-8"?>
<layout version="1.0">
<window x="107" y="-8" w="3732" h="2136" maximized="1" screen="0">
<splitter orientation="1">
<split size="40"/>
<dock id="" hideTitles="1" activePageId="Toolbar.1">
<page id="Toolbar.1"/>
</dock>
<split size="3069" stretch="1"/>
<splitter orientation="2">
<split size="1229"/>
<dock id="" activePageId="Viewer.2">
<page id="Viewer.2"/>
<page id="Viewer.3"/>
<page id="Viewer.1"/>
</dock>
<split size="865"/>
<dock id="" activePageId="DAG.1">
<page id="DAG.1"/>
<page id="Curve Editor.1"/>
<page id="DopeSheet.1"/>
</dock>
</splitter>
<split size="615"/>
<dock id="" activePageId="Properties.1" focus="true">
<page id="Properties.1"/>
<page id="uk.co.thefoundry.backgroundrenderview.1"/>
</dock>
</splitter>
</window>
</layout>
}
Root {
inputs 0
name C:/Depot/o3de-engine/Gems/AtomLyIntegration/CommonFeatures/Tools/ColorGrading/TestData/Nuke/O3DE_HDR_Nuke_Color_Grading
project_directory C:/Depot/o3de-engine/Gems/AtomLyIntegration/CommonFeatures/Tools/ColorGrading/TestData/Nuke
label "This is a Nuke project template used to validate HDR / ACES color grading workflow in Nuke to generate 'Look Modification' (LMT) Luts for Oopen 3D Engine."
frame 16
first_frame 16
last_frame 32
lock_range true
format "2048 1556 0 0 2048 1556 1 2K_Super_35(full-ap)"
proxy_type scale
proxy_format "1024 778 0 0 1024 778 1 1K_Super_35(full-ap)"
colorManagement OCIO
OCIOGPUSupport true
OCIO_config aces_1.0.3
defaultViewerLUT "OCIO LUTs"
workingSpaceLUT scene_linear
monitorLut ACES/sRGB
monitorOutLUT "sRGB (ACES)"
int8Lut matte_paint
int16Lut texture_paint
logLut compositing_log
floatLut scene_linear
}
Read {
inputs 0
file_type exr
file C:/Depot/o3de-engine/Gems/AtomLyIntegration/CommonFeatures/Tools/ColorGrading/LUTs/linear_lut_32.exr
format "1024 32 0 0 1024 32 1 "
origset true
colorspace scene_linear
name Read3
xpos -1727
ypos -81
}
OCIOFileTransform {
file C:/Depot/o3de-engine/Tools/ColorGrading/OpenColorIO-Configs/aces_1.0.3/luts/Log2_48_nits_Shaper_to_linear.spi1d
working_space scene_linear
name OCIOFileTransform1
xpos -1587
ypos -45
}
Viewer {
frame_range 16-32
viewerProcess "sRGB (ACES)"
name Viewer3
xpos -1586
ypos 10
}
Read {
inputs 0
file_type exr
file C:/Depot/o3de-engine/Gems/AtomLyIntegration/CommonFeatures/Tools/ColorGrading/TestData/Nuke/HDR/displaymapperpassthrough.exr
format "1167 1618 0 0 1167 1618 1 "
origset true
colorspace scene_linear
name Read1
xpos -1719
ypos -421
}
Read {
inputs 0
file_type exr
file C:/Depot/o3de-engine/Gems/AtomLyIntegration/CommonFeatures/Tools/ColorGrading/LUTs/linear_lut_32.exr
format "1024 32 0 0 1024 32 1 "
origset true
colorspace "Utility - Log2 48 nits Shaper - AP1"
name Read2
xpos -1720
ypos -311
}
Merge2 {
inputs 2
Achannels {rgba.red rgba.green rgba.blue -rgba.alpha}
Bchannels {rgba.red rgba.green rgba.blue -rgba.alpha}
output {rgba.red rgba.green rgba.blue -rgba.alpha}
also_merge all
mix 0
name Merge1
selected true
xpos -1495
ypos -340
}
Viewer {
frame 16
frame_range 16-32
viewerProcess "sRGB (ACES)"
name Viewer2
xpos -1495
ypos -272
}

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c0276e1d329cda3514f46a55fd1d3ce90fce617814198ab69d234f2c58c15882
size 98742272

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ce91088eaa54afab608bfcea6ab4009cbb3027cb83c76710a46470144e7d799d
size 98638424

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:facad074b84df87a0ab4baaf2bd95552e6eca3fed79a56875c9815f32d885b8a
size 11949493

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cfdfefb553fffd1a799a62e205fe13ebd88f3327d97d20cb900af6465ecc2dae
size 61384

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:dfced5571e7d681cc565a9be07fa199ecfee0d70ad4104ccb47c75a525737445
size 96548

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bd3fe7e7f016c1a3b2c3e8db5fbd23efbc8d8717c01fac4cf39b1ae7b3ae9325
size 41559412

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:facad074b84df87a0ab4baaf2bd95552e6eca3fed79a56875c9815f32d885b8a
size 11949493

@ -0,0 +1,52 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM
:: Set up and run O3DE Python CMD prompt
:: Sets up the DccScriptingInterface_Env,
:: Puts you in the CMD within the dev environment
:: Set up window
TITLE O3DE Color Grading CMD
:: Use obvious color to prevent confusion (Grey with Yellow Text)
COLOR 8E
%~d0
cd %~dp0
PUSHD %~dp0
SETLOCAL ENABLEDELAYEDEXPANSION
:: if the user has set up a custom env call it
IF EXIST "%~dp0User_env.bat" CALL %~dp0User_env.bat
:: Initialize env
CALL %~dp0\Env_Core.bat
CALL %~dp0\Env_Python.bat
CALL %~dp0\Env_Tools.bat
echo.
echo _____________________________________________________________________
echo.
echo ~ O3DE Color Grading Python CMD ...
echo _____________________________________________________________________
echo.
:: Change to root dir
CD /D ..
:: Create command prompt with environment
CALL %windir%\system32\cmd.exe
ENDLOCAL
:: Return to starting directory
POPD
:END_OF_FILE

@ -0,0 +1,129 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM
:: Sets up environment for O3DE DCC tools and code access
:: Set up window
TITLE O3DE Color Grading Env Core
:: Use obvious color to prevent confusion (Grey with Yellow Text)
COLOR 8E
:: Skip initialization if already completed
IF "%O3DE_ENV_INIT%"=="1" GOTO :END_OF_FILE
:: Store current dir
%~d0
cd %~dp0
PUSHD %~dp0
::SETLOCAL ENABLEDELAYEDEXPANSION
echo.
echo _____________________________________________________________________
echo.
echo ~ O3DE Color Grading Core Env ...
echo _____________________________________________________________________
echo.
IF "%CMD_LAUNCHERS%"=="" (set CMD_LAUNCHERS=%~dp0)
echo CMD_LAUNCHERS = %CMD_LAUNCHERS%
:: add to the PATH
SET PATH=%CMD_LAUNCHERS%;%PATH%
:: Constant Vars (Global)
:: global debug flag (propogates)
:: The intent here is to set and globally enter a debug mode
IF "%DCCSI_GDEBUG%"=="" (set DCCSI_GDEBUG=false)
echo DCCSI_GDEBUG = %DCCSI_GDEBUG%
:: initiates earliest debugger connection
:: we support attaching to WingIDE... PyCharm and VScode in the future
IF "%DCCSI_DEV_MODE%"=="" (set DCCSI_DEV_MODE=false)
echo DCCSI_DEV_MODE = %DCCSI_DEV_MODE%
:: sets debugger, options: WING, PYCHARM
IF "%DCCSI_GDEBUGGER%"=="" (set DCCSI_GDEBUGGER=WING)
echo DCCSI_GDEBUGGER = %DCCSI_GDEBUGGER%
:: Default level logger will handle
:: Override this to control the setting
:: CRITICAL:50
:: ERROR:40
:: WARNING:30
:: INFO:20
:: DEBUG:10
:: NOTSET:0
IF "%DCCSI_LOGLEVEL%"=="" (set DCCSI_LOGLEVEL=20)
echo DCCSI_LOGLEVEL = %DCCSI_LOGLEVEL%
:: This maps up to the \Dev folder
IF "%DEV_REL_PATH%"=="" (set DEV_REL_PATH=..\..\..\..\..\..)
echo DEV_REL_PATH = %DEV_REL_PATH%
:: You can define the project name
IF "%O3DE_PROJECT_NAME%"=="" (
for %%a in (%CD%..\..) do set O3DE_PROJECT_NAME=%%~na
)
echo O3DE_PROJECT_NAME = %O3DE_PROJECT_NAME%
CD /D ..\
IF "%O3DE_PROJECT_PATH%"=="" (set O3DE_PROJECT_PATH=%CD%)
echo O3DE_PROJECT_PATH = %O3DE_PROJECT_PATH%
IF "%ABS_PATH%"=="" (set ABS_PATH=%CD%)
echo ABS_PATH = %ABS_PATH%
:: Save current directory and change to target directory
pushd %ABS_PATH%
:: Change to root Lumberyard dev dir
CD /d %DEV_REL_PATH%
IF "%O3DE_DEV%"=="" (set O3DE_DEV=%CD%)
echo O3DE_DEV = %O3DE_DEV%
:: Restore original directory
popd
:: dcc scripting interface gem path
:: currently know relative path to this gem
set DCCSIG_PATH=%O3DE_DEV%\Gems\AtomLyIntegration\TechnicalArt\DccScriptingInterface
echo DCCSIG_PATH = %DCCSIG_PATH%
:: Change to DCCsi root dir
CD /D %DCCSIG_PATH%
:: per-dcc sdk path
set DCCSI_SDK_PATH=%DCCSIG_PATH%\SDK
echo DCCSI_SDK_PATH = %DCCSI_SDK_PATH%
:: temp log location specific to this gem
set DCCSI_LOG_PATH=%DCCSIG_PATH%\.temp\logs
echo DCCSI_LOG_PATH = %DCCSI_LOG_PATH%
:: O3DE build path
IF "%TAG_O3DE_BUILD_PATH%"=="" (set TAG_O3DE_BUILD_PATH=build)
echo TAG_O3DE_BUILD_PATH = %TAG_O3DE_BUILD_PATH%
IF "%O3DE_BUILD_PATH%"=="" (set O3DE_BUILD_PATH=%O3DE_DEV%\%TAG_O3DE_BUILD_PATH%)
echo O3DE_BUILD_PATH = %O3DE_BUILD_PATH%
IF "%O3DE_BIN_PATH%"=="" (set O3DE_BIN_PATH=%O3DE_BUILD_PATH%\bin\profile)
echo O3DE_BIN_PATH = %O3DE_BIN_PATH%
:: add to the PATH
SET PATH=%O3DE_BUILD_PATH%;%DCCSIG_PATH%;%DCCSI_AZPY_PATH%;%PATH%
::ENDLOCAL
:: Set flag so we don't initialize dccsi environment twice
SET O3DE_ENV_INIT=1
GOTO END_OF_FILE
:: Return to starting directory
POPD
:END_OF_FILE

@ -0,0 +1,102 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM
:: Sets up extended environment for O3DE and DCCsi python
:: Skip initialization if already completed
IF "%O3DE_ENV_PY_INIT%"=="1" GOTO :END_OF_FILE
:: Store current dir
%~d0
cd %~dp0
PUSHD %~dp0
CALL %~dp0\Env_Core.bat
::SETLOCAL ENABLEDELAYEDEXPANSION
echo.
echo _____________________________________________________________________
echo.
echo ~ O3DE Color Grading Python Env ...
echo _____________________________________________________________________
echo.
:: Python Version
:: Ideally these are set to match the O3DE python distribution
:: <O3DE>\python\runtime
IF "%DCCSI_PY_VERSION_MAJOR%"=="" (set DCCSI_PY_VERSION_MAJOR=3)
echo DCCSI_PY_VERSION_MAJOR = %DCCSI_PY_VERSION_MAJOR%
:: PY version Major
IF "%DCCSI_PY_VERSION_MINOR%"=="" (set DCCSI_PY_VERSION_MINOR=7)
echo DCCSI_PY_VERSION_MINOR = %DCCSI_PY_VERSION_MINOR%
IF "%DCCSI_PY_VERSION_RELEASE%"=="" (set DCCSI_PY_VERSION_RELEASE=10)
echo DCCSI_PY_VERSION_RELEASE = %DCCSI_PY_VERSION_RELEASE%
:: shared location for 64bit python 3.7 DEV location
:: this defines a DCCsi sandbox for lib site-packages by version
:: <O3DE>\Gems\AtomLyIntegration\TechnicalArt\DccScriptingInterface\3rdParty\Python\Lib
set DCCSI_PYTHON_PATH=%DCCSIG_PATH%\3rdParty\Python
echo DCCSI_PYTHON_PATH = %DCCSI_PYTHON_PATH%
:: add access to a Lib location that matches the py version (example: 3.7.x)
:: switch this for other python versions like maya (2.7.x)
IF "%DCCSI_PYTHON_LIB_PATH%"=="" (set DCCSI_PYTHON_LIB_PATH=%DCCSI_PYTHON_PATH%\Lib\%DCCSI_PY_VERSION_MAJOR%.x\%DCCSI_PY_VERSION_MAJOR%.%DCCSI_PY_VERSION_MINOR%.x\site-packages)
echo DCCSI_PYTHON_LIB_PATH = %DCCSI_PYTHON_LIB_PATH%
:: add to the PATH
SET PATH=%DCCSI_PYTHON_LIB_PATH%;%PATH%
:: shared location for default O3DE python location
set DCCSI_PYTHON_INSTALL=%O3DE_DEV%\Python
echo DCCSI_PYTHON_INSTALL = %DCCSI_PYTHON_INSTALL%
:: location for O3DE python 3.7 location
set DCCSI_PY_BASE=%DCCSI_PYTHON_INSTALL%\python.cmd
echo DCCSI_PY_BASE = %DCCSI_PY_BASE%
:: ide and debugger plug
set DCCSI_PY_DEFAULT=%DCCSI_PY_BASE%
set DCCSI_PY_IDE=%DCCSI_PYTHON_INSTALL%\runtime\python-3.7.10-rev1-windows\python
echo DCCSI_PY_IDE = %DCCSI_PY_IDE%
:: Wing and other IDEs probably prefer access directly to the python.exe
set DCCSI_PY_EXE=%DCCSI_PYTHON_INSTALL%\runtime\python-3.7.10-rev1-windows\python\python.exe
echo DCCSI_PY_EXE = %DCCSI_PY_EXE%
set DCCSI_PY_IDE_PACKAGES=%DCCSI_PY_IDE%\Lib\site-packages
echo DCCSI_PY_IDE_PACKAGES = %DCCSI_PY_IDE_PACKAGES%
set DCCSI_FEATURECOMMON_SCRIPTS=%O3DE_DEV%\Gems\Atom\Feature\Common\Editor\Scripts
echo DCCSI_FEATURECOMMON_SCRIPTS = %DCCSI_FEATURECOMMON_SCRIPTS%
set DCCSI_COLORGRADING_SCRIPTS=%DCCSI_FEATURECOMMON_SCRIPTS%\ColorGrading
echo DCCSI_COLORGRADING_SCRIPTS = %DCCSI_COLORGRADING_SCRIPTS%
:: add to the PATH
SET PATH=%DCCSI_PYTHON_INSTALL%;%DCCSI_PY_IDE%;%DCCSI_PY_IDE_PACKAGES%;%DCCSI_PY_EXE%;%DCCSI_COLORGRADING_SCRIPTS%;%PATH%
:: add all python related paths to PYTHONPATH for package imports
set PYTHONPATH=%DCCSIG_PATH%;%DCCSI_PYTHON_LIB_PATH%;%O3DE_BIN_PATH%;%DCCSI_COLORGRADING_SCRIPTS%;%DCCSI_FEATURECOMMON_SCRIPTS%;%PYTHONPATH%
echo PYTHONPATH = %PYTHONPATH%
::ENDLOCAL
:: Set flag so we don't initialize dccsi environment twice
SET O3DE_ENV_PY_INIT=1
GOTO END_OF_FILE
:: Return to starting directory
POPD
:END_OF_FILE

@ -0,0 +1,88 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM
:: Sets ocio and oiio tools for O3DE Color Grading
:: Skip initialization if already completed
IF "%O3DE_ENV_TOOLS_INIT%"=="1" GOTO :END_OF_FILE
:: Store current dir
%~d0
cd %~dp0
PUSHD %~dp0
:: Initialize env
CALL %~dp0\Env_Core.bat
CALL %~dp0\Env_Python.bat
::SETLOCAL ENABLEDELAYEDEXPANSION
echo.
echo _____________________________________________________________________
echo.
echo ~ O3DE Color Grading Tools Env ...
echo _____________________________________________________________________
echo.
::SET oiio_bin=%O3DE_PROJECT_PATH%\Tools\oiio\build\bin\Release
::SET oiiotool=%oiio_bin%\oiiotool.exe
:: Libs that ocio uses
SET vcpkg_bin=%O3DE_DEV%\Tools\ColorGrading\vcpkg\installed\x64-windows\bin
:: add to path
SET PATH=%PATH%;%vcpkg_bin%
SET ocio_bin=%O3DE_DEV%\Tools\ColorGrading\ocio\build\src\OpenColorIO\Release
echo ocio_bin = %ocio_bin%
:: add to the PATH
SET PATH=%PATH%;%ocio_bin%
IF "%OCIO_APPS%"=="" (set OCIO_APPS=%O3DE_DEV%\Tools\ColorGrading\ocio\build\src\apps)
echo OCIO_APPS = %OCIO_APPS%
SET ociobakelut=%OCIO_APPS%\ociobakelut\Release
echo ociobakelut = %ociobakelut%
SET PATH=%PATH%;%ociobakelut%
SET ociocheck=%OCIO_APPS%\ociocheck\Release
SET PATH=%PATH%;%ociocheck%
SET ociochecklut=%OCIO_APPS%\ociochecklut\Release
SET PATH=%PATH%;%ociochecklut%
SET ocioconvert=%OCIO_APPS%\ocioconvert\Release
SET PATH=%PATH%;%ocioconvert%
SET ociodisplay=%OCIO_APPS%\ociodisplay\Release
SET PATH=%PATH%;%ociodisplay%
SET ociolutimage=%OCIO_APPS%\ociolutimage\Release
SET PATH=%PATH%;%ociolutimage%
SET ociomakeclf=%OCIO_APPS%\ociomakeclf\Release
SET PATH=%PATH%;%ociomakeclf%
SET ocioperf=%OCIO_APPS%\ocioperf\Release
SET PATH=%PATH%;%ocioperf%
SET ociowrite=%OCIO_APPS%\ociowrite\Release
SET PATH=%PATH%;%ociowrite%
::ENDLOCAL
:: Set flag so we don't initialize this environment twice
SET O3DE_ENV_TOOLS_INIT=1
GOTO END_OF_FILE
:: Return to starting directory
POPD
:END_OF_FILE

@ -0,0 +1,67 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM
:: Sets up environment for Lumberyard DCC tools and code access
:: Skip initialization if already completed
IF "%DCCSI_ENV_WINGIDE_INIT%"=="1" GOTO :END_OF_FILE
:: Store current dir
%~d0
cd %~dp0
PUSHD %~dp0
:: WingIDE version Major
IF "%DCCSI_WING_VERSION_MAJOR%"=="" (set DCCSI_WING_VERSION_MAJOR=7)
:: WingIDE version Major
IF "%DCCSI_WING_VERSION_MINOR%"=="" (set DCCSI_WING_VERSION_MINOR=1)
:: Initialize env
CALL %~dp0\Env_Core.bat
CALL %~dp0\Env_Python.bat
:: Wing and other IDEs probably prefer access directly to the python.exe
set DCCSI_PY_IDE = %DCCSI_PYTHON_INSTALL%\runtime\python-3.7.10-rev1-windows\python
echo DCCSI_PY_IDE = %DCCSI_PY_IDE%
:: ide and debugger plug
set DCCSI_PY_DEFAULT=%DCCSI_PY_IDE%\python.exe
:: put project env variables/paths here
set WINGHOME=%PROGRAMFILES(X86)%\Wing Pro %DCCSI_WING_VERSION_MAJOR%.%DCCSI_WING_VERSION_MINOR%
IF "%WING_PROJ%"=="" (set WING_PROJ=%O3DE_PROJECT_PATH%\.solutions\.wing\o3de_color_grading_%DCCSI_WING_VERSION_MAJOR%x.wpr)
::SETLOCAL ENABLEDELAYEDEXPANSION
echo.
echo _____________________________________________________________________
echo.
echo ~ O3DE Color Grading Environment ...
echo _____________________________________________________________________
echo.
echo DCCSI_WING_VERSION_MAJOR = %DCCSI_WING_VERSION_MAJOR%
echo DCCSI_WING_VERSION_MINOR = %DCCSI_WING_VERSION_MINOR%
echo WINGHOME = %WINGHOME%
echo WING_PROJ = %WING_PROJ%
:: add to the PATH
SET PATH=%WINGHOME%;%PATH%
::ENDLOCAL
:: Set flag so we don't initialize dccsi environment twice
SET DCCSI_ENV_WINGIDE_INIT=1
GOTO END_OF_FILE
:: Return to starting directory
POPD
:END_OF_FILE

@ -0,0 +1,99 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM
:: Launches Wing IDE and the O3de Color Grading project files
:: Set up window
TITLE O3DE Color Grading Launch WingIDE 7x
:: Use obvious color to prevent confusion (Grey with Yellow Text)
COLOR 8E
:: Store current dir
%~d0
cd %~dp0
PUSHD %~dp0
:: if the user has set up a custom env call it
IF EXIST "%~dp0User_env.bat" CALL %~dp0User_env.bat
:: Constant Vars (Global)
:: global debug (propogates)
IF "%DCCSI_GDEBUG%"=="" (set DCCSI_GDEBUG=True)
echo DCCSI_GDEBUG = %DCCSI_GDEBUG%
:: initiates debugger connection
IF "%DCCSI_DEV_MODE%"=="" (set DCCSI_DEV_MODE=True)
echo DCCSI_DEV_MODE = %DCCSI_DEV_MODE%
:: sets debugger, options: WING, PYCHARM
IF "%DCCSI_GDEBUGGER%"=="" (set DCCSI_GDEBUGGER=WING)
echo DCCSI_GDEBUGGER = %DCCSI_GDEBUGGER%
:: Default level logger will handle
:: CRITICAL:50
:: ERROR:40
:: WARNING:30
:: INFO:20
:: DEBUG:10
:: NOTSET:0
IF "%DCCSI_LOGLEVEL%"=="" (set DCCSI_LOGLEVEL=10)
echo DCCSI_LOGLEVEL = %DCCSI_LOGLEVEL%
:: Initialize env
CALL %~dp0\Env_Core.bat
CALL %~dp0\Env_Python.bat
CALL %~dp0\Env_WingIDE.bat
echo.
echo _____________________________________________________________________
echo.
echo ~ WingIDE Version %DCCSI_WING_VERSION_MAJOR%.%DCCSI_WING_VERSION_MINOR%
echo ~ Launching O3DE %LY_PROJECT% project in WingIDE %DCCSI_WING_VERSION_MAJOR%.%DCCSI_WING_VERSION_MINOR% ...
echo _____________________________________________________________________
echo.
echo LY_DEV = %LY_DEV%
:: shared location for default O3DE python location
set DCCSI_PYTHON_INSTALL=%LY_DEV%\Python
echo DCCSI_PYTHON_INSTALL = %DCCSI_PYTHON_INSTALL%
:: Wing and other IDEs probably prefer access directly to the python.exe
set DCCSI_PY_IDE = %DCCSI_PYTHON_INSTALL%\runtime\python-3.7.10-rev1-windows\python
echo DCCSI_PY_IDE = %DCCSI_PY_IDE%
:: ide and debugger plug
set DCCSI_PY_BASE=%DCCSI_PY_IDE%\python.exe
echo DCCSI_PY_BASE = %DCCSI_PY_BASE%
:: ide and debugger plug
set DCCSI_PY_DEFAULT=%DCCSI_PY_BASE%
echo DCCSI_PY_DEFAULT = %DCCSI_PY_DEFAULT%
:: if the user has set up a custom env call it
IF EXIST "%~dp0User_Dev.bat" CALL %~dp0User_Dev.bat
echo.
:: Change to root dir
CD /D %O3DE_PROJECT_PATH%
IF EXIST "%WINGHOME%\bin\wing.exe" (
start "" "%WINGHOME%\bin\wing.exe" "%WING_PROJ%"
) ELSE (
Where wing.exe 2> NUL
IF ERRORLEVEL 1 (
echo wing.exe could not be found
pause
) ELSE (
start "" wing.exe "%WING_PROJ%"
)
)
:: Return to starting directory
POPD
:END_OF_FILE

@ -0,0 +1,26 @@
#
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
These are commandline tools for color grading workflow and authoring LUTs externally.
Note: may require OpenColorIO (ocio) and/or OpenImageIO (oiio) to be set up properly.
CMD_ColorGradingTools.bat :: opens a configured window env context in CMD
Env_Core.bat :: core O3DE env hooks (any envars DCCSI_ shares some overlay with DccScriptingInterface Gem)
Env_Python.bat :: sets up access and configures env for O3DE python (to run externally)
Env_Tools.bat :: hooks for ocio and oiio
:: note: currently you must build coio tools/apps yourself (we used vcpkg and cmake gui)
:: note: oiio, it's .pyd and oiiotool should build in O3DE (if you have troubel issue a ticket to investigate)
Env_WingIDE.bat :: hooks for WingIDE (a python IDE and debugger)
:: note: feel free to configure a different IDE, user choice.
Launch_WingIDE-7-1.bat :: this will launch WingIDE with envar hooks and access to O3DE python (for authroing, debugging)
:: note: you will need to make sure wingstub.py is configured correctly
:: note: you will need to create the wing project file/path (see Env_WingIDE.bat)
User_Env.bat.template :: this is an example of overriding or extending the envar hooks (set local engine root, or branch path, etc.)
:: note: to use, copy and rename to User_Env.bat
:: bote: we use this to primarily enable the debugging related envar hooks

@ -0,0 +1,41 @@
@echo off
REM
REM Copyright (c) Contributors to the Open 3D Engine Project
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM
:: copy this file, rename to User_Env.bat (remove .template)
:: use this file to override any local properties that differ from base
:: Skip initialization if already completed
IF "%O3DE_USER_ENV_INIT%"=="1" GOTO :END_OF_FILE
:: Store current dir
%~d0
cd %~dp0
PUSHD %~dp0
SETLOCAL ENABLEDELAYEDEXPANSION
SET O3DE_DEV=C:\Depot\o3de-engine
::SET OCIO_APPS=C:\Depot\o3de-engine\Tools\ColorGrading\ocio\build\src\apps
SET TAG_LY_BUILD_PATH=build
SET DCCSI_GDEBUG=True
SET DCCSI_DEV_MODE=True
SET WING_PROJ=%O3DE_PROJECT_PATH%\.solutions\.wing\o3de_color_grading_%DCCSI_WING_VERSION_MAJOR%x.wpr
::ENDLOCAL
:: Set flag so we don't initialize dccsi environment twice
SET O3DE_USER_ENV_INIT=1
GOTO END_OF_FILE
:: Return to starting directory
POPD
:END_OF_FILE

@ -0,0 +1,98 @@
################################
# create identity LUT
ociolutimage --generate --cubesize 16 --output C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\linear_16_LUT.exr
NOTE: ociolutimage is a OpenColorIO (ocio) app. O3DE does NOT currently build these, however you can build them yourself.
for example, we used vcpkg and cmake gui to build them locally.
we intend to add a fully built integration of ocio in the future.
for now, we have provided all of the LUTs below so that most users will not need the ocio tools.
################################
# create base 16x16x16 LUT shaped for grading in 48-nits (LDR), in 1000-nits (HDR), 2000nits, 4000-nits
python %DCCSI_COLORGRADING_SCRIPTS%\lut_helper.py --i C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\linear_16_LUT.exr --op pre-grading --shaper Log2-48nits --o C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\base_Log2-48nits_16_LUT.exr
python %DCCSI_COLORGRADING_SCRIPTS%\lut_helper.py --i C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\linear_16_LUT.exr --op pre-grading --shaper Log2-1000nits --o C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\base_Log2-1000nits_16_LUT.exr
python %DCCSI_COLORGRADING_SCRIPTS%\lut_helper.py --i C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\linear_16_LUT.exr --op pre-grading --shaper Log2-2000nits --o C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\base_Log2-2000nits_16_LUT.exr
python %DCCSI_COLORGRADING_SCRIPTS%\lut_helper.py --i C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\linear_16_LUT.exr --op pre-grading --shaper Log2-4000nits --o C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\base_Log2-4000nits_16_LUT.exr
################################
# create base 32x32x32 LUT shaped for grading in 48-nits (LDR), in 1000-nits (HDR), 2000nits, 4000-nits
ociolutimage --generate --cubesize 32 --output C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\linear_32_LUT.exr
python %DCCSI_COLORGRADING_SCRIPTS%\lut_helper.py --i C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\linear_32_LUT.exr --op pre-grading --shaper Log2-48nits --o C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\base_Log2-48nits_32_LUT.exr
python %DCCSI_COLORGRADING_SCRIPTS%\lut_helper.py --i C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\linear_32_LUT.exr --op pre-grading --shaper Log2-1000nits --o C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\base_Log2-1000nits_32_LUT.exr
python %DCCSI_COLORGRADING_SCRIPTS%\lut_helper.py --i C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\linear_32_LUT.exr --op pre-grading --shaper Log2-2000nits --o C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\base_Log2-2000nits_32_LUT.exr
python %DCCSI_COLORGRADING_SCRIPTS%\lut_helper.py --i C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\linear_32_LUT.exr --op pre-grading --shaper Log2-4000nits --o C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\base_Log2-4000nits_32_LUT.exr
################################
# create base 64x64x64 LUT shaped for grading in 48-nits (LDR), in 1000-nits (HDR), 2000nits, 4000-nits
# LUT size 64 broken output without --maxwidth 4096!!!
ociolutimage --generate --cubesize 64 --maxwidth 4096 --output C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\linear_64_LUT.exr
python %DCCSI_COLORGRADING_SCRIPTS%\lut_helper.py --i C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\linear_64_LUT.exr --op pre-grading --shaper Log2-48nits --o C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\base_Log2-48nits_64_LUT.exr
python %DCCSI_COLORGRADING_SCRIPTS%\lut_helper.py --i C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\linear_64_LUT.exr --op pre-grading --shaper Log2-1000nits --o C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\base_Log2-1000nits_64_LUT.exr
python %DCCSI_COLORGRADING_SCRIPTS%\lut_helper.py --i C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\linear_64_LUT.exr --op pre-grading --shaper Log2-2000nits --o C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\base_Log2-2000nits_64_LUT.exr
python %DCCSI_COLORGRADING_SCRIPTS%\lut_helper.py --i C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\linear_64_LUT.exr --op pre-grading --shaper Log2-4000nits --o C:\Depot\o3de\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\base_Log2-4000nits_64_LUT.exr
################################
# Photoshop, Basics
Examples: C:\Depot\o3de-engine\Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\TestData\Photoshop\
HDR_in_LDR_Log2-48nits\LUT_PreShaped_Composite\*
1. This must be installed (righ-click) before launching photoshop:
Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\from_ACEScg_to_sRGB.icc
^ this is to be used as 'custom color proof' (ACES view transform)
2. This is the O3DE 'displaymapper passthrough' capture, re-saved as a .exr:
"ColorGrading\Resources\TestData\Photoshop\Log2-48nits\framebuffer_ACEScg_to_sRGB_icc.exr"
^ open in photoshop, color proof with the above .icc
the image should proof such that it looks the same as camera in O3DE viewport
with the Displaymapper set to ACES
3. Composite this base LUT in a layer on top:
"Gems\Atom\Feature\Common\Tools\ColorGrading\Resources\LUTs\base_Log2-48nits_32_LUT.exr"
^ this is a pre-shaped 32x32x32 LUT we generated above
4. Color Grade using adjustment layers (and hope for the best, some photoshop grades may cause values to clip)
5. Select/crop just the LUT, 'Copy Merged' into a new document, save into a folder such as:
"ColorGrading\Resources\TestData\Photoshop\Log2-48nits\i_shaped\test_hue-sat_32_LUT.exr"
^ this lut is post-grade BUT still shaped (need to inv shape back to normailzed 0-1 values)
6. Use the provided cmd/python tools, we need to inverse shape:
Run: "Gems\Atom\Feature\Common\Tools\ColorGrading\cmdline\CMD_ColorGradingTools.bat"
C:\Depot\o3de-engine\Gems\Atom\Feature\Common\Tools\ColorGrading>>
python %DCCSI_COLORGRADING_SCRIPTS%\lut_helper.py --i "Resources\TestData\TestData\Photoshop\Log2-48nits\i_shaped\test_hue-sat_32_LUT.exr" --op post-grading --shaper Log2-48nits --o Resources\TestData\Photoshop\Log2-48nits\o_invShaped\test_hue-sat_32_LUT -l -a
^ this will inv-shaped LUT (3DL's are normalized in 0-1 space, values may clip!!!)
^ -e generates LUT as .exr
^ -l generates a .3DL version
^ -a generates a .azasset version <-- this copies/moves to an asset folder
Using LUTs In-engine:
Only the <LUT NAME>.azasset needs to be copied to a O3DE project assets folder to use in engine, example:
"C:\Depot\o3de-engine\Gems\Atom\Feature\Common\Assets\ColorGrading\TestData\Photoshop\inv-Log2-48nits\test_hue-sat_32_LUT.azasset"
^ this is just an example path within the engine folder
The <LUT NAME>.azasset can be loaded into a 'Look Modification Component'
If there are multiple properly configured 'Look Modification Components' you can blend LUTs/Looks (in world space, in a cinematic, etc.)
By default LUTs utilize linear sampling, but you can use the following CVAR to improve quality for 'any difficult lut':
r_lutSampleQuality=0, linear
r_lutSampleQuality=1, b-spline 7 taps
r_lutSampleQuality=2, b-spline 19 taps (highest quality)
Loading…
Cancel
Save