https://github.com/al20ov/godot-davinci-intermediate
https://github.com/al20ov/godot-davinci-intermediate
color colorgrading davinci godot log lut resolve
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/al20ov/godot-davinci-intermediate
- Owner: al20ov
- Created: 2025-06-15T21:18:13.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-06-15T22:25:31.000Z (4 months ago)
- Last Synced: 2025-06-15T23:36:04.412Z (4 months ago)
- Topics: color, colorgrading, davinci, godot, log, lut, resolve
- Language: GDScript
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A linear gamma to DaVinci Intermediate OETF shader
Based on https://documents.blackmagicdesign.com/InformationNotes/DaVinci_Resolve_17_Wide_Gamut_Intermediate.pdf
## Usage
1. Clone this repo, or just copy the .glsl shader as well as the .gd file into your project
2. If necessary, change the path of the .glsl shader in `_initialize_compute()` so it points to the location of `linear_to_di.glsl` in your project
3. In your WorldEnvironment, make sure Tonemap is set to **Linear** and that exposure is set to 1.0 to ensure no other tonemappers are enabled
4. In your WorldEnvironment again, create a Compositor, then a CompositorEffect. You should now see a new option called "PostProcessLinearToDI"; Click on it

Your viewport should now look something like this:

Now if you want to create your own LUT in Resolve, I recommend taking an EXR screenshot with this piece of code:
```
var viewport = get_viewport()viewport.size = Vector2(3840, 2160)
viewport.get_texture().get_image().save_exr('screenshot.exr')
```Once that's done, you can import the EXR into DaVinci Resolve/Resolve Studio and grade to your heart's content:

Make sure your CST's input color space is sRGB, input gamma is **DaVinci Intermediate**, output color space is set to sRGB or Rec709, and finally output gamma should be sRGB or Gamma 2.2
Then finally, to export your LUT, right click on your graded clip, go to Generate > 65 Point CUBE

Then head to the Fusion tab:
1. Disconnect the MediaIn node if necessary
2. Add a LUTCubeCreator node, set it to horizontal and whatever size you want (most people recommend 33, 51 or 65)
3. Then, add a FileLUT node with the .cube you exported earlier
4. Add a Transform node (under Tools > Transform > Transform) and set it to flip vertically
5. Connect all the nodes, you should now see your LUT applied to the strip
6. Right click on the LUT displayed in the viewport, and save it as a TGA or PNG file
Now, back in Godot, add the TGA or PNG LUT strip you exported and set it to a Texture3D with the following settings in the import tab:

The horizontal slices should match the size of your LUT (in my case, 51)
Then, click "Reimport" and drag your TGA or PNG lut into the Color Correction slot in WorldEnvironment > Adjustments
And you should be able to see your LUT applied to your viewport:
