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

Direct2D Support #27

Open
WindowsNT opened this issue Feb 3, 2021 · 0 comments
Open

Direct2D Support #27

WindowsNT opened this issue Feb 3, 2021 · 0 comments

Comments

@WindowsNT
Copy link

WindowsNT commented Feb 3, 2021

I found the tool after I have already converted lots of shaders in HLSL. It seems interesting, it could be nice if you can add Direct2D pixel shader support.

Direct2D HLSL has a factor passed as uw in the coordinates main function so the coordinates passed to the main can be converted to [0,1].

In Turbo Play I use this set of wrappers:


float2 FindSpace(float2 MV)
{
    float2 LastSample = float2(0, 0) + float2(center.x*2,center.y * 2)* MV;
    return LastSample;
}

float2 GetNormalized(float2 UV,float2 MV)
{
    float2 s = FindSpace(MV);
    return UV / s;
}

float2 FromNormalized(float2 UV, float2 MV)
{
    float2 s = FindSpace(MV);
    return UV * s;
}


See more at https://docs.microsoft.com/en-us/windows/win32/direct2d/custom-effects

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

No branches or pull requests

1 participant