Coder Social home page Coder Social logo

mrlixm / agxc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sobotka/agx

89.0 89.0 8.0 50.29 MB

Fork of Troy.S AgX, a display rendering transform available via OCIO and more

HLSL 33.32% Python 57.75% Lua 8.87% Shell 0.06%
cgi color-science image-processing

agxc's Introduction

Liam Collod

python lua qt katana nuke mari maya

Python Software Engineer and VFX artist. I am specialized in surfacing, lighting compositing, color-science and image-processing.

Projects

I share a lot of the code I write on my personal time so make sure to check some of those projects :

stars name description tags
GitHub Repo stars lqtTextEditor A more advanced text/code editor for PyQt qt
GitHub Repo stars lqtPushButtonAligned A Qt button where you can set in which direction the text and its icon is aligned. qt
GitHub Repo stars AgXc Fork of Troy.S AgX, a display rendering transform available via OCIO and more.
GitHub Repo stars Frmb Convert file structures to right-click context menu for Windows. windows
GitHub Repo stars Autodesk_Maya Collection of resources for Autodesk's Maya DCC (modelling, scene assembly, ...). maya
GitHub Repo stars Foundry_Mari Collection of resources for Foundry's Mari DCC (texturing). mari
GitHub Repo stars Foundry_Nuke Collection of resources for Foundry's Nuke DCC (compositing). nuke
GitHub Repo stars Foundry_Katana Collection of resources for Foundry's Katana DCC (scene assembly). katana
GitHub Repo stars lllogger A simple lua logging module inspired from Python's one. katana
GitHub Repo stars opscripting Improving Katana OpScripting workflow in a pipeline context. katana
GitHub Repo stars katananodling Custom API to create and register custom Katana nodes in python. katana
GitHub Repo stars KUI Katana OpScript for flexible instancing setup. katana
GitHub Repo stars Streamlit_Temperature2RGB web-app to convert Kelvin temperature to RGB colorspaces. streamlit
GitHub Repo stars streamlit-colour-plotting web-app to plot colors, images and colorspaces in graphs. streamlit

agxc's People

Contributors

bean-mhm avatar mrlixm avatar sobotka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

agxc's Issues

License?

Hello!

I was just wondering if there is any licensing required to use code from this repository.

Thanks,
Gustav

[nuke] AgXc DRT investigation

This will act as a logbook for the further investigation of the AgXc DRT for Nuke that was release in v0.10.0.

I will note anything that I found that could help improve it.

[reshade] add inverse tonemapping options

A simple thing I thought about : the notion of tonemapping is not new in video game and games have been using "tonemapping" for a pretty long time. In big AAA games most of the time you an be sure the displayed result has received some kind of "tonemapping".

This is something we could ideally try to remove because it should be AgX job. Even though applying the tonemapper would lead no magic result, it could allow to perhaps retrieve data in a closer state that what expect AgX.

So the idea would be to implement a new option to select a popular tonemapper transform, and to apply its inverse on the image. Just after the IDT.

resources

[OBS] add more input/ouput colorspaces option

The first release of the OBS integration was to make sure I had a basic working version. I might not spend too much time again on it but at least add more colorspaces options.

This is in relation with the latest 28 update for OBS that added support for HDR sources. Even if I don't have access to HDR source via my hardware, adding more input/output options would not be a bad thing.

[OCIO] ACES interchange inaccuracy

The conversion to ACES2065-1 for interchange seems to be incorrect-- I found this error originally with the following process:
I have a scene-referred render from Maya + V-Ray with the Linear sRGB rendering space from your config. I bring this into a Nuke scene set up with your OCIO config with a read node with the IDT set to Linear sRGB. Using an OCIOColorSpace node, I convert Linear sRGB -> ACES2065-1. I write this out to a 16bit EXR using a write node with the ODT set to Passthrough.

In a different nuke scene using the cg-config-v1.0.0_aces-v1.3_ocio-v2.0.ocio OCIO config from https://github.com/AcademySoftwareFoundation/OpenColorIO-Config-ACES/releases, I read in the 16bit EXR from the previous Nuke scene with the IDT set to Raw. With a second read node, I read in the original scene-referred render with the IDT set to Raw. I then use an OCIOColorSpace node to convert the second read node from Linear Rec.709 -> ACES2065-1. If I set my viewer to Raw (sRGB - Display) and compare the two, they are close but still pretty off. Liam was able to recreate this issue as well.

[obs] shader doesn't compile on Apple M1 Max

Issue reported by jackson hayes on Twitter.

initial error

1:06:34.668: Error compiling shader:
11:06:34.668: ERROR: 0:312: 'output' : Reserved word. 
11:06:34.668: ERROR: 0:312: 'output' : syntax error: syntax error
11:06:34.668: 
11:06:34.668: 
11:06:34.668: device_pixelshader_create (GL) failed
11:06:34.668: Pass (0) <> missing pixel shader!
11:06:34.668: [source_info.create] Loaded effect /Users/user/Documents/OBS/AgXc-main/obs/obs-script/AgX.hlsl
11:06:34.668: Effect compilation failed for /Users/user/Documents/OBS/AgXc-main/obs/obs-script/AgX.hlsl
11:06:34.668: 
11:06:34.668: Failed to create source 'AgX'!

a first fix has been issued in 245ed20

second error

After the above fix, a second new error can be observed

OBS 30.1.0 log file uploaded at 2024-03-24, 13:02:34
13:02:09.299: [AgXc][source_info.create] Loading effect /Users/user/Downloads/AgXc-main/obs/obs-script/AgX.hlsl
13:02:09.306: Error compiling shader:
13:02:09.306: ERROR: 0:709: '{' : syntax error: syntax error
13:02:09.306: 
13:02:09.306: 
13:02:09.306: device_pixelshader_create (GL) failed
13:02:09.306: Pass (0) <> missing pixel shader!
13:02:09.306: [AgXc][source_info.create] Effect compilation failed for /Users/user/Downloads/AgXc-main/obs/obs-script/AgX.hlsl

which is very vague and impossible to find what could be causing it if I can't reproduce on my side.

context

For the last error.

commit 3fac5fb

13:02:08.598: CPU Name: Apple M1 Max
13:02:08.598: Physical Cores: 10, Logical Cores: 10
13:02:08.598: Physical Memory: 65536MB Total
13:02:08.598: Model Identifier: MacBookPro18,2
13:02:08.598: OS Name: macOS
13:02:08.598: OS Version: Version 14.4 (Build 23E214)
13:02:08.598: Rosetta translation used: false
13:02:08.598: Kernel Version: 23.4.0
13:02:08.599: hotkeys-cocoa: Using layout 'com.apple.keylayout.US'
13:02:08.599: Current Date/Time: 2024-03-24, 13:02:08
13:02:08.599: Browser Hardware Acceleration: true
13:02:08.599: Qt Version: 6.6.2 (runtime), 6.6.2 (compiled)
13:02:08.599: Portable mode: false
13:02:08.693: OBS 30.1.0 (mac)

[OCIO] Pure black (0.0,0.0,0.0) and near values get "lifted", compared to original main-AgX (ociov2) version.

Hi, I have been trying this config looking for a v1 compatible version of AgX. Troubleshooting it with Troy we found some interesting inconsistencies between this version and his original OCIOv2 one.

Here are some examples (made with this test image):

Image viewed with Troy's original main AgX (OCIO v2)
image

Image viewed with this v1 compatible fork:
image

Delta/difference pass between both:
image

Same diff pass as above, but gain-boosted for clarity:
image

Here is the analisys of a single pixel that is pure 0.0, 0.0, 0.0 on the original file, and remains like that with Troy's original config (bottom read), but gets lifted to 0.06219 on this fork (top read)
image

So it seems the changes in appearance are the strongest at pure black values and fade out from near there to higher values.
In grading, a simple "offset" doesn't fix it. A black-point re-map seems to get quite close to a perfect match, but non-uniformly (matching an area of the image gets another area further away, and so on). So it seems like a nuanced change on the "toe" of it?
He suspects is something about the allocation variables or MatrixTransform.

I understand there is a disclaimer on the fork description about them not being 100% garanteed in accuracy, but maybe this is a useful insight, since that "lift" is kinda weird.

Cheers!

[OCIO] increase compatibility with Redshift.

Update

A thread has been opened on the Redshift forum

https://redshift.maxon.net/topic/44651/ocio-colorspace-discovering-process-is-too-obscure

Original issue

(Info initally provided by Saul Espinoza)
When parsing config, Redshift will be looking for the "sRGB EOTF" colorspace to perform some transformations when needed.
The discovery process is hardcoded and not very clear yet but seems you need a colorspace named with at least "sRGB" in the name
and then a specific transform. (probably does a regex on values or on transform name ?)
Saul recommended to try first the true EOTF with

- !<ExponentWithLinearTransform> {gamma: 2.4, offset: 0.055, direction: inverse}

But let's also try the power function to see if its looking for the ExponentTransform or for the "2.4" value.

-!<ExponentTransform> { value: [ 2.2, 2.2, 2.2, 1 ], direction: inverse }

OBS Implementation

Something that I have been hammering myself with for a long time. Apply AgX on live camera source like webcams. I already done it in the past in Python but performance were not there: https://twitter.com/MrLixm/status/1520877184373694466.

So at some point I tried to see to create a small application that was combining virtual camera streaming + OCIO Gpu processing but it's been in wip for ever. But that's a good thing because I missed the most obvious solution, extends what already exists. I.e. OBS has a robust camera streaming system, and what looks like to be a nice plugin/scripting framework.

In this issue, I will try to create an OBS script/plugin to implement AgX :

Resources

Getting Started With OBS Scripting

https://obsproject.com/wiki/Getting-Started-With-OBS-Scripting

Scripting Tutorial Halftone Filter

https://obsproject.com/wiki/Scripting-Tutorial-Halftone-Filter

Python/Lua Scripting documentation

https://obsproject.com/docs/scripting.html

Plan

By having a look at the documentation shared above, I can use 2 languages I'm familiar with which are lua and python. Then looking at the Halftone-Filter example, which looks to be what I want to do, I can see that we introduce hlsl in the mix which is perfect as I already have a hlsl implementation for Reshade.

I will start looking in a first implementation when I find the time/motivation.

[OCIO] Handling of negatives values

Following #9, I discovered that the ocio config is not handling negative properly in the AgX Log transform.

Initially I was using this kind of combinaison of transform to create a negative clamp :

- !<AllocationTransform> { allocation: lg2, vars: [ -10, 7, 0.0056065625 ] }
- !<FileTransform> { src: dummy.spi1d, interpolation: linear }
- !<AllocationTransform> { allocation: lg2, vars: [ -10, 7, 0.0056065625 ], direction: inverse }
...

The dummy LUT clipping to 0-1 range, but this actually doesn't work and introduce more negatives because of the <AllocationTransform>.

As such this has been removed in #10 .

Objective

Find a way to clamp negative values before the Matrix + Log2 transform are applied

Comparison

test_log after
↳ img1 current behavior

test_log ref
↳ img2 original AgX on OCIOv2

test_log reference negatives ↳ img3 reference image (unprocessed) - negatives mask

You can see some hard clipping on the small ColorsBars that initially have a lot of negatives.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.