Skip to content

Commit

Permalink
The original challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
utensil committed Aug 16, 2024
1 parent 6413c60 commit 0f8207b
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions trees/math-000K.tree
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,18 @@ float mySDF2(vec3 p) {
float z = p.z;
float y2 = pow(y, 2.);
float z3 = pow(z, 3.);
float x4 = pow(x, 4.);
float y4 = pow(y, 4.);
float z4 = pow(z, 4.);
float x2 = pow(x, 2.);
float z2 = pow(z, 2.);
float y3 = pow(y, 3.);

// return y2+z3-z4-x2*z2;
return 5.*(z2+y3-y4-x2*y2);

// return x2*z2+z4-y2-z3;
// return (y2-x2-z2);

// return -x2+y2*z2+z3;

// return z2-x2-y2;

return x2-z2*y2+y3;
// return (x2-z2*y2+y3);
}

Material raymarchMap( in vec3 pos ) {
Expand All @@ -79,7 +77,7 @@ Material raymarchMap( in vec3 pos ) {

// res = opUnion(res, materialNew( vec3(1.0, 2.0, 1.0), opIntersection(0.05 * abs(mySDF2(pos)), cubeSDF(pos, 1.0))) );

Material res = materialNew( vec3(1.0, 2.0, 1.0), opIntersection(0.05 * abs(mySDF2(pos)), cubeSDF(pos, 1.0)));
Material res = materialNew( vec3(1.0, 2.0, 1.0), opIntersection(0.05 * abs(mySDF2(pos)), sphereSDF(pos, 1.8)));

// res = opUnion( res, materialNew( vec3(1.0, 1.0, 1.0), 1.0, 0.0, sphereSDF(pos-vec3( 0.0, 2.0, 0.0), 0.5 ) ) );
// res = opUnion( res, materialNew( vec3(0.0, 1.0, 1.0), boxSDF( pos-vec3( 2.0, 0.5, 0.0), vec3(0.4, 0.4, 0.4) ) ) );
Expand Down

0 comments on commit 0f8207b

Please sign in to comment.