DX11 texture fx in VL.Stride

Hi all

I am taking my first baby steps into gamma/VL and I would like to port some of my old work.
One of the most essential parts are the texture effects.
I can see from @tonfilms NODE20 workshop that it is possible to make shades, but to a shader imbecile like myself, the thought of converting what is pretty simple shades into the new slightly tweaked shader language is a barrier for sure.
Will there be a relatively simple way to convert pixel shaders and will the set of default shaders expand?
It will be of no surprise that I miss an edge detect filter.

Sune

SDSL is the same as HLSL plus a few additions, so you can copy and paste everything. there is just the difference that you have to enclose it with a:

shader MyShaderName
{
    //Shader code
}

and the file has to be called exactly as the shader name, MyShaderName.sdsl in this case.

the help patch how to write a shader will tell you all about it, and here is an example:
VL.Stride.Runtime/src/Effects/TextureFX/Filters/ColorManipulation/Invert_TextureFX.sdsl

1 Like

I tried to just copy paste the DX11 edge shader, Now I can see it but the node is red and there is a long error message when I hover the node. see this example. I also added some stuff after looking at the shader in the link. See BeginnerGamma.zip (2.1 KB)

And how do you copy the error message?

A yea there is quite few semantic changes & doubt it will work like that… Would look on it, but it seems i got sick…

1 Like

Hi so played a bit with it, and have few questions:

// question 1 Immutable doesn't work
SamplerState s0:IMMUTABLE 
// this type of annotation either 
float Bright <float uimin=0.0;> = 1.0;
// this also 
float2 R:TARGETSIZE;
// question 2 Multipass > ??
// question 3 Pass annotations like
pass P0 <bool mips=true;>
// question 4 i try to add second texture input via adding 
float4 test = Texture1.SampleLevel(s0,x,0).a;
// but doesn't seems to work, i mean i got this Texture0 from 
// somewhere - from where and how?

Otherwise there you go Sune…
BeginnerGamma.zip (2.8 KB)

1 Like

Thanks @antokhio I will test it out in the coming week.

It still doesn’t solve the general challenge of porting the old textureFX to gamma.

@tonfilm it would be cool to have a step by step guide with an example. I imagine that the transition can be pretty quick if there is a simple guide a shader noob like myself could follow. Then it could be added to the repo continuously.

yes, the specific of the beta texture fx are not implemented, and they will probably be different in VL.Stride. so the extra features “invented” by the beta texture fx are not available in VL.Stride.

that was a bit misleading by me. what I meant is that the syntax is the same and that you can copy the individual functions. the shader setup itself is slightly different. for that please have a look at the existing texture fx in VL.Stride and see how they are built.

for extensive documentation it is still too early, since we will probably change a few things before the first official release.

We now have documentation for Writing custom TextureFX for VL.Stride.

4 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.