raymarching shader toy conversion?

Hello.
I was wondering after reading few posts if its is possible to convert a shader from shadertoys with raymarching in it.
Only few, Not at all or is it just a question of converting the raymarching section of code to a special touch designer. thx

shadertoy.com/view/XsKGRW

this would be super usefull in many animations

Mike Walczyk has a great post about understanding Ray Marching and how to apply the technique in Touch:

michaelwalczyk.com/blog/2017 … y-marching

You might start by giving that a read first. Once you have a handle on how this works you should give the hg_sdf library a look as well:

mercury.sexy/hg_sdf/

smashing thx, by the sound of it, it cannot be simple.
Still I’ll give it a bash!

i dont know if this helps anyone but I was importing some raymarching shaders from shadertoy and was having issues that were fixed by changing the ‘input extend mode UV’ to repeat…

Hi there,

I’m having some issues with raymarching also … currently
i trying to convert this from shadertoy.

shadertoy.com/view/Mdf3z7

I have managed to iron out most errors but am stuck on this
one …

Pixel Shader Compile Results:
ERROR: 0:160: ‘rayMarch’ : no matching overloaded function found (using implicit conversion)
ERROR: 0:160: ‘rayMarch’ : function is not known
ERROR: 0:159: ‘assign’ : cannot convert from ‘const highp float’ to ‘FragUserData 4-component vector of highp float’

This corrospondeds to the final line in the code here …

[code]void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
// Camera position (eye), and camera target
vec3 camPos = 0.5iTimevec3(1.0,0.0,0.0);
vec3 target = camPos + vec3(1.0,0.0cos(iTime),0.0sin(0.4*iTime));
vec3 camUp = vec3(0.0,1.0,0.0);

// Calculate orthonormal camera reference system
vec3 camDir   = normalize(target-camPos); // direction for center ray
camUp = normalize(camUp-dot(camDir,camUp)*camDir); // orthogonalize
vec3 camRight = normalize(cross(camDir,camUp));

vec2 coord =-1.0+2.0*fragCoord.xy/iResolution.xy;
coord.x *= iResolution.x/iResolution.y;

// Get direction for this pixel
vec3 rayDir = normalize(camDir + (coord.x*camRight + coord.y*camUp)*FieldOfView);

fragColor = rayMarch(camPos, rayDir, fragCoord );

}[/code]

Any thoughts out there on how to fix this ? does touch using a different approach or syntax
for raymarching?

thanks!

puck.

It’s just GLSL, any shadertoy shader can be run on TD or any other system that supports GLSL shaders.
Please read this chapter on how to convert shadertoy shaders to TD:

nvoid.gitbooks.io/introduction- … ertoy.html