ShopDreamUp AI ArtDreamUp
Deviation Actions
Description
//the really first version of kaleidoscopic Iterated Function System
//by Knighty
float DE(float3 z0, inout float min_dist)
{
float r=z0.x*z0.x+z0.y*z0.y+z0.z*z0.z;
int i;
for ( i=0;i<maxIterations && r<bailout;i++){
float3 zz0;
if( z0.x+ z0.y<0.0){zz0.x=-z0.y;z0.y=-z0.x;z0.x=zz0.x;}
if( z0.x+ z0.z<0.0){zz0.x=-z0.z;z0.z=-z0.x;z0.x=zz0.x;}
if( z0.y+ z0.z<0.0){zz0.y=-z0.z;z0.z=-z0.y;z0.y=zz0.y;}
z0.x=scale*z0.x-(scale-1.0);
z0.y=scale*z0.y-(scale-1.0);
z0.z=scale*z0.z-(scale-1.0);
r=z0.x*z0.x+z0.y*z0.y+z0.z*z0.z;
}
return (sqrt(r)-2.0)*pow(scale,float(-i));
}
//pixelbender's version
//here scale=2.0;
//by Knighty
float DE(float3 z0, inout float min_dist)
{
float r=z0.x*z0.x+z0.y*z0.y+z0.z*z0.z;
int i;
for ( i=0;i<maxIterations && r<bailout;i++){
float3 zz0;
if( z0.x+ z0.y<0.0){zz0.x=-z0.y;z0.y=-z0.x;z0.x=zz0.x;}
if( z0.x+ z0.z<0.0){zz0.x=-z0.z;z0.z=-z0.x;z0.x=zz0.x;}
if( z0.y+ z0.z<0.0){zz0.y=-z0.z;z0.z=-z0.y;z0.y=zz0.y;}
z0.x=scale*z0.x-(scale-1.0);
z0.y=scale*z0.y-(scale-1.0);
z0.z=scale*z0.z-(scale-1.0);
r=z0.x*z0.x+z0.y*z0.y+z0.z*z0.z;
}
return (sqrt(r)-2.0)*pow(scale,float(-i));
}
//pixelbender's version
//here scale=2.0;
Image size
1699x555px 961.09 KB
© 2010 - 2024 bermarte
Comments1
Join the community to add your comment. Already a deviant? Log In
thanks for watching