Skip to content

Commit

Permalink
Add a 3D tonemapping and color correction demo
Browse files Browse the repository at this point in the history
This showcases various tonemapping operators and their interaction
with several color correction textures (1D and 3D).

A script generating neutral 3D LUT textures is also included.
  • Loading branch information
Calinou committed Sep 26, 2024
1 parent a87fded commit 0537563
Show file tree
Hide file tree
Showing 63 changed files with 1,399 additions and 0 deletions.
14 changes: 14 additions & 0 deletions 3d/tonemap_color_correction/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Tonemapping and Color Correction

This showcases various tonemapping operators and their interaction with several
color correction textures (1D and 3D).

A script generating neutral 3D LUT textures is also included.

Language: GDScript

Renderer: Forward Plus

## Screenshots

![Screenshot](screenshots/tonemap_color_correction.webp)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://8iyvvj75q6bd"
path="res://.godot/imported/detect_white_clipping.png-ff83ca2587cf6e3783223e00c5b42bce.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://example_luts/1d/detect_white_clipping.png"
dest_files=["res://.godot/imported/detect_white_clipping.png-ff83ca2587cf6e3783223e00c5b42bce.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions 3d/tonemap_color_correction/example_luts/1d/frozen.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://3fu2y401e2wn"
path="res://.godot/imported/frozen.png-457f8ff344433e9f459b5caaede7bfab.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://example_luts/1d/frozen.png"
dest_files=["res://.godot/imported/frozen.png-457f8ff344433e9f459b5caaede7bfab.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions 3d/tonemap_color_correction/example_luts/1d/heat.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://t3ag4e6j1i7n"
path="res://.godot/imported/heat.png-27bfc7c4ee7ae772dcd2e3b8c4e82264.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://example_luts/1d/heat.png"
dest_files=["res://.godot/imported/heat.png-27bfc7c4ee7ae772dcd2e3b8c4e82264.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://b76jtu3lfrof8"
path="res://.godot/imported/incandescent.png-b204183d282b9168fd54f936bbf329ce.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://example_luts/1d/incandescent.png"
dest_files=["res://.godot/imported/incandescent.png-b204183d282b9168fd54f936bbf329ce.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions 3d/tonemap_color_correction/example_luts/1d/posterized.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://emt27ho4felt"
path="res://.godot/imported/posterized.png-a34de9ef248db176b274e5299bfdfe43.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://example_luts/1d/posterized.png"
dest_files=["res://.godot/imported/posterized.png-a34de9ef248db176b274e5299bfdfe43.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://cy3n57u6o0x5t"
path="res://.godot/imported/posterized_outline.png-a5caa8e602fc1e5b6e6b8ce44670a14d.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://example_luts/1d/posterized_outline.png"
dest_files=["res://.godot/imported/posterized_outline.png-a5caa8e602fc1e5b6e6b8ce44670a14d.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions 3d/tonemap_color_correction/example_luts/1d/rainbow.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://0y7x46bwdm8q"
path="res://.godot/imported/rainbow.png-3f78eb0d72b9b81b1fbcb63640e8b7c7.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://example_luts/1d/rainbow.png"
dest_files=["res://.godot/imported/rainbow.png-3f78eb0d72b9b81b1fbcb63640e8b7c7.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions 3d/tonemap_color_correction/example_luts/1d/toxic.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://cacjitmb1bk88"
path="res://.godot/imported/toxic.png-b2acad2fbcf1706454391fb0b2887380.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://example_luts/1d/toxic.png"
dest_files=["res://.godot/imported/toxic.png-b2acad2fbcf1706454391fb0b2887380.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[remap]

importer="3d_texture"
type="CompressedTexture3D"
uid="uid://1e0vurlkfhcc"
path="res://.godot/imported/brighten_shadows.png-61280821ebde1ed825cfb67e480939d6.ctex3d"
metadata={
"vram_texture": false
}

[deps]

source_file="res://example_luts/3d/brighten_shadows.png"
dest_files=["res://.godot/imported/brighten_shadows.png-61280821ebde1ed825cfb67e480939d6.ctex3d"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
slices/horizontal=33
slices/vertical=1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions 3d/tonemap_color_correction/example_luts/3d/burned_blue.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[remap]

importer="3d_texture"
type="CompressedTexture3D"
uid="uid://clhpel6jn4gus"
path="res://.godot/imported/burned_blue.png-3fa578a6aed0a39c8ea444d1fdfa2bd0.ctex3d"
metadata={
"vram_texture": false
}

[deps]

source_file="res://example_luts/3d/burned_blue.png"
dest_files=["res://.godot/imported/burned_blue.png-3fa578a6aed0a39c8ea444d1fdfa2bd0.ctex3d"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
slices/horizontal=33
slices/vertical=1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions 3d/tonemap_color_correction/example_luts/3d/cold_color.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[remap]

importer="3d_texture"
type="CompressedTexture3D"
uid="uid://b4jlxhcbyp0e8"
path="res://.godot/imported/cold_color.png-210fff9bc7f9e391d44adb29f141a6a0.ctex3d"
metadata={
"vram_texture": false
}

[deps]

source_file="res://example_luts/3d/cold_color.png"
dest_files=["res://.godot/imported/cold_color.png-210fff9bc7f9e391d44adb29f141a6a0.ctex3d"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
slices/horizontal=33
slices/vertical=1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0537563

Please sign in to comment.