Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video stream coming in with green/blue tint in Unity 2019.3.7f1 #8

Open
thegladscientist opened this issue Sep 28, 2020 · 2 comments
Open
Assignees
Labels
question Further information is requested

Comments

@thegladscientist
Copy link

Just did some testing back and forth with this and the AvPro Decklink plugin, and found that the quality was higher using this code. Unfortunately when using it in 2019.3.7 version of Unity (with HDRP) the video was coming in tinted blue/green. Of course I had to update the way that the RenderPipelineManager was calling beginCameraRendering to work with newer versions of HDRP, but after that I am facing this issue. Any insights would be incredible. 👍

Avpro:
decklink capture 2 (quad scale 1)

Klinker on Standard Pipeline:
keijiro capture 2

Klinker on HDRP in newer Unity editors:
keijiro capture-HDRP

@keijiro keijiro self-assigned this Sep 28, 2020
@keijiro keijiro added the question Further information is requested label Sep 28, 2020
@Ludwig-Karl
Copy link

Same issue by me. I am also wondering if it is compatible with DX12 with the HDRP + DXR? Do you know something about it?

@spxyz
Copy link

spxyz commented Mar 2, 2021

Hello,
it looks like it's all about gamma color space.
Need some adjustments for linear version. I think it should work:

half4 uyvy = tex2D(_MainTex, uv);
    uyvy = LinearToGamma(uyvy);
 
half4 LinearToGamma(half4 col)
{
    if (col.r <= 0.0031308)
        col.r = col.r * 12.92;
    else
        col.r = 1.055 * pow(col.r, 0.4166667) - 0.055;
    if (col.g <= 0.0031308)
        col.g = col.g * 12.92;
    else
        col.g = 1.055 * pow(col.g, 0.4166667) - 0.055;
    if (col.b <= 0.0031308)
        col.b = col.b * 12.92;
    else
        col.b = 1.055 * pow(col.b, 0.4166667) - 0.055;
    col.a = col.a;
    return col;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants