Forum

Float3ToFloat2 in ShaderFx?

Hi everyone,
I am trying to understand why in Functions for ShaderFX there is no Float3ToFloat2.sdsl, I am trying to recreate FieldTrip on my own (for learning purposes) while following Inigo Quilez live coding video, and I am at the point where I need to create a composition with ShaderFx with the “float2 myFunk (float3)” type. So my question is, is there are particular reason there is no Float3ToFloat2 function to override it in my shader? Or how do I actually make it work.

Sorry if it cumbersome, I am not a real programmer, just learning

Are you trying to patch a shader or writing code in an editor? And where exactly did you see the Float3ToFloat2 function - somewhere in FieldTrip or in Quilez’s video?

So in Quilez’s video, he is making “map” function (for SDF distance), but it should return not float as usual, but vector2, where is first float would be the distance (as normally sdf function does) and the second float will be an identifier (for texturing I assume).

I am writing code in editor but also patching a composition (i think that’s how it is called), for example, I have a myRayMarching node (that uses sdsl file with raymarching algorithm) to which I connect mySDF node (that is using sdsl file with SDFs and so on, inside those I use node “create GPUFunc 1->1”.

there is no particular reason, it was just not implemented at the time. please note that ShaderFX is still experimental and will be updated in the next months.

i’ve added the base shader for the next preview, should be online in about 30 minutes.

1 Like

oh wow! thank you very much!

@lenappss the new preview can be downloaded now, let us know if you run into any other troubles.

1 Like