[Library] SPP (SimplePixelProc) - GFX library [Win x64/x86]

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
Mijikai
Addict
Addict
Posts: 1520
Joined: Sun Sep 11, 2016 2:17 pm

Re: [Library] SPP (SimplePixelProc) - GFX library [Win x64/x86]

Post by Mijikai »

Torus Knot Example

Image

Code:

Code: Select all

EnableExplicit

;Torus Knot Raymarching - SPP Example
;I followed along the great tutorial by The Art of Code (Martijn)
;https://www.youtube.com/watch?v=2dzJZx0yngg
;Great channel if you want to learn about shaders :)

XIncludeFile "spp.pbi"

Structure VEC2
  x.f
  y.f
EndStructure

Structure VEC3
  x.f
  y.f
  z.f
EndStructure

Structure VEC4
  x.f
  y.f
  z.f
  w.f
EndStructure

Global time.f

Macro vlMix(_x_,_y_,_a_)
  (_x_ * (1 - _a_) + _y_ * _a_)
EndMacro

Macro v2(_v_,_x_,_y_)
  _v_\x = _x_
  _v_\y = _y_
EndMacro

Macro v2Length(_v_)
  Sqr((_v_\x * _v_\x) + (_v_\y * _v_\y))
EndMacro

Macro v2Rotate(_v_,_a_,_out_)
  _out_\x = (_v_\x * Cos(_a_)) - (_v_\y * Sin(_a_))
  _out_\y = (_v_\x * Sin(_a_)) + (_v_\y * Cos(_a_))
EndMacro

Macro v2RotateXY(_x_,_y_,_a_,_out_)
  _out_\x = (_x_ * Cos(_a_)) - (_y_ * Sin(_a_))
  _out_\y = (_x_ * Sin(_a_)) + (_y_ * Cos(_a_))
EndMacro

Macro v3(_v_,_x_,_y_,_z_)
  _v_\x = _x_
  _v_\y = _y_
  _v_\z = _z_
EndMacro

Macro v3Add(_v1_,_v2_,_out_)
  _out_\x = _v1_\x + _v2_\x
  _out_\y = _v1_\y + _v2_\y
  _out_\z = _v1_\z + _v2_\z
EndMacro

Macro v3Sub(_v1_,_v2_,_out_)
  _out_\x = _v1_\x - _v2_\x
  _out_\y = _v1_\y - _v2_\y
  _out_\z = _v1_\z - _v2_\z
EndMacro

Macro v3MulVal(_v_,_val_,_out_)
  _out_\x = _v_\x * _val_
  _out_\y = _v_\y * _val_
  _out_\z = _v_\z * _val_
EndMacro

Macro v3DivVal(_v_,_val_,_out_)
  _out_\x = _v_\x / _val_
  _out_\y = _v_\y / _val_
  _out_\z = _v_\z / _val_
EndMacro

Macro v3Cross(_v1_,_v2_,_out_)
  _out_\x = (_v1_\y * _v2_\z) - (_v1_\z * _v2_\y)
  _out_\y = (_v1_\z * _v2_\x) - (_v1_\x * _v2_\z)
  _out_\z = (_v1_\x * _v2_\y) - (_v1_\y * _v2_\x)
EndMacro

Macro v3Dot(_v1_,_v2_)
  ((_v1_\x * _v2_\x) + (_v1_\y * _v2_\y) + (_v1_\z * _v2_\z))
EndMacro

Macro v3Length(_v_)
  Sqr((_v_\x * _v_\x) + (_v_\y * _v_\y) + (_v_\z * _v_\z))
EndMacro

Macro v3RayPos(_ro_,_rd_,_dst_,_out_)
  v3MulVal(_rd_,_dst_,_out_)
  v3Add(_ro_,_out_,_out_)
EndMacro

Macro v3NormalSub(_ray_,_normal_,_out_)
  v3Sub(_ray_,_normal_,_out_)
  v3Normalize(_out_)
EndMacro

Macro v3MixColor(_c1_,_c2_,_factor_,_out_)
  _out_\x + vlMix(_c1_\x,_c2_\x,_factor_)
  _out_\y + vlMix(_c1_\y,_c2_\y,_factor_)
  _out_\z + vlMix(_c1_\z,_c2_\z,_factor_)
EndMacro

Macro v3PowVal(_v_,_val_,_out_)
  _out_\x = Pow(_v_\x,_val_) 
  _out_\y = Pow(_v_\y,_val_)
  _out_\z = Pow(_v_\z,_val_)
EndMacro

Procedure.i v3Normal(*p.VEC3,val.f,*out1.VEC3,*out2.VEC3,*out3.VEC4)
  v3(*out1,*p\x - val,*p\y,*p\z)
  v3(*out2,*p\x,*p\y - val,*p\z)
  v3(*out3,*p\x,*p\y,*p\z - val)
  ProcedureReturn
EndProcedure

Procedure.i v3Normalize(*v.vec3)
  Protected length.f
  length = v3Length(*v)
  v3DivVal(*v,length,*v)
  ProcedureReturn
EndProcedure

Procedure v3Reflect(*pos.VEC3,*normal.VEC3,*out.VEC3)
  Protected dot.f
  dot = v3Dot(*pos,*normal)
  *out\x = *pos\x - 2.0 * dot * *normal\x
  *out\y = *pos\y - 2.0 * dot * *normal\y
  *out\z = *pos\z - 2.0 * dot * *normal\z
  ProcedureReturn
EndProcedure

Procedure.f GetDist(*p.VEC3)
  Protected.f r1,r2,a,d
  Protected.VEC2 cp,cr
  r1 = 1.7
  r2 = 0.2
  v2(cp,*p\x,*p\z)
  v2(cp,(v2Length(cp) - r1),*p\y)
  a = ATan2(*p\x,*p\z)
  v2Rotate(cp,(a * 3.0 + time),cr)
  cp = cr
  cp\y = Abs(cp\y) - 0.3
  d = v2Length(cp) - r2
  ProcedureReturn d
EndProcedure

Procedure.f RayMarch(*ro.VEC3,*rd.VEC3)
  Protected index.i,p.VEC3,do.f,ds.f
  For index = 0 To 99
    v3RayPos(*ro,*rd,do,p)
    ds = GetDist(@p)
    do + ds
    If do > 100.0 Or Abs(ds) < 0.01
      Break  
    EndIf
  Next
  ProcedureReturn do
EndProcedure

Procedure.i GetNormal(*p.VEC3,*out.VEC3)
  Protected.VEC3 n0,n1,n2,n3
  v3Normal(*p,0.01,@n0,@n1,@n2)
  v3(n3,GetDist(@n0),GetDist(@n1),GetDist(@n2))
  v3NormalSub(*p,n3,*out)
  ProcedureReturn
EndProcedure

Procedure.i GetRayDir(*uv.VEC2,*p.VEC3,*l.VEC3,z.f,*out.VEC3)
  Protected.VEC3 f,r,v,u,c
  v3Sub(*l,*p,f)
  v3Normalize(@f)
  v3(v,0.0,1.0,0.0)
  v3Cross(v,f,r)
  v3Normalize(@r)
  v3Cross(f,r,u)
  v3MulVal(f,z,c)
  *out\x = c\x + *uv\x * r\x + *uv\y * u\x
  *out\y = c\y + *uv\x * r\y + *uv\y * u\y
  *out\z = c\z + *uv\x * r\z + *uv\y * u\z
  v3Normalize(*out)
  ProcedureReturn
EndProcedure

Procedure.i Background(*rd.VEC3,*color.VEC4)
  Protected.VEC3 a,b
  v3(a,0.2,0.1,0.1)
  v3(b,0.2,0.5,1.0)
  v3MixColor(a,b,(*rd\y * 0.5 + 0.5),*color)
  ProcedureReturn
EndProcedure

Procedure.i Callback(*coord.VEC2,*color.VEC4,*output.VEC2)
  Protected.VEC2 uv
  Protected.VEC3 ro,rd,v,p,n,r
  Protected.f d,dif
  v2(uv,(*coord\x - 0.5 * *output\x) / *output\y,(*coord\y - 0.5 * *output\y) / *output\y)
  v3(ro,1.0,1.0,- 3.0)
  v2RotateXY(ro\y,ro\z,time,ro)
  v3(v,0.0,0.0,0.0)
  GetRayDir(@uv,@ro,@v,0.5,@rd)
  d = RayMarch(@ro,@rd)
  v3(*color,0.0,0.0,0.0)
  Background(@rd,*color)
  If d < 100.0
    v3RayPos(ro,rd,d,p)
    GetNormal(@p,@n)
    v3Reflect(@rd,@n,@r)
    v3(v,1.0,2.0,3.0)
    v3Normalize(@v)
    dif = v3Dot(n,v) * 0.1 + 0.5
    v3(*color,dif,dif,dif)
  EndIf
  v3PowVal(*color,0.4545,*color)
  ProcedureReturn
EndProcedure

sppCreate(#Null$,512,512,#SPP_WINDOW_NORMAL,256,256,@Callback(),#True,60,@time)

End
User avatar
Mijikai
Addict
Addict
Posts: 1520
Joined: Sun Sep 11, 2016 2:17 pm

Re: [Library] SPP (SimplePixelProc) - GFX library [Win x64/x86]

Post by Mijikai »

Fluid dynamics adapted for SPP
Original thread: viewtopic.php?t=82801

Image

Code: Select all

EnableExplicit

;By threedslider / pjay: https://www.purebasic.fr/english/viewtopic.php?p=610415#p610415
;Original: fluid dynamics (flame) - PB conversion of https://github.com/983/Fluid-Simulation  - Phil James 2023

XIncludeFile "spp.pbi"

Structure VEC2
  x.f:y.f
EndStructure

Structure VEC3
  x.f:y.f:z.f
EndStructure

Structure VEC4
  x.f:y.f:z.f:w.f
EndStructure

Global time.f

Macro Vec4(_v_,_x_,_y_,_z_,_w_)
  _v_\x = _x_:_v_\y = _y_:_v_\z = _z_:_v_\w = _w_
EndMacro

Structure vec2f
  x.f : y.f
EndStructure

;#nx = 256 : #ny = 256 : #Upscale = 4 ; ~7ms on 5800h
;#nx = 160 : #ny = 120 : #Upscale = 8 ; ~2ms on 5800h
;#nx = 320 : #ny = 160 : #Upscale = 6 ; ~5ms on 5800h
;#nx = 512 : #ny = 256 : #Upscale = 4 ; ~12ms on 5800h
;#nx = 320 : #ny = 400 : #Upscale = 2 ; ~12ms on 5800h

#nx = 128 : #ny = 128 : #Upscale = 4 ; ~7ms on 5800h

#nx1 = #nx - 1 : #ny1 = #ny - 1 : #nx2 = #nx - 2 : #ny2 = #ny - 2
Global dt.f = 0.02, iterations = 5, vorticity.f = 10.0, mouse.point, lmb, w.i = #nx * #Upscale, h = #ny * #Upscale, texture
Global v1size = #nx * #ny * SizeOf(float), v2size = v1size * 2, onframe

Global Dim old_velocity.vec2f(#ny1,#nx1), Dim new_velocity.vec2f(#ny1,#nx1)
Global Dim old_density.f(#ny1, #nx1), Dim new_density.f(#ny1, #nx1)
Global Dim pixels.l(#ny1,#nx1)

Macro LengthM(x,y) : Sqr((x*x) + (y*y)) : EndMacro
Macro LerpM(a, b, t) : ( a + t * (b - a) ) : EndMacro
Macro Log2M(v) : (Log(v) / 0.6931471805599453094) : EndMacro ; not sure if this is correct Log2...
Macro RandomFloatM(a, b) : LerpM(a, b, Random(1000000) / 1000000.0) : EndMacro
 
Procedure Init()
  Protected x, y
  For y = 0 To #ny1 : For x = 0 To #nx1
      old_density(y,x) = 0.0 : old_velocity(y,x)\x = 0 : old_velocity(y,x)\y = 0
  Next : Next
EndProcedure

Procedure.f interpolate(Array grid.f(2), *p.vec2f, *d.float)
  Protected ix = Round(*p\x,#PB_Round_Down), iy = Round(*p\y,#PB_Round_Down), ux.f = *p\x - ix, uy.f = *p\y - iy
  *d\f = LerpM(LerpM(grid(iy,ix),grid(iy,ix + 1), ux),LerpM(grid(iy+1,ix),grid(iy+1,ix+1), ux), uy)
EndProcedure

Procedure.f interpolateVec2(Array grid.vec2f(2), *p.vec2f, *d.vec2f)
  Protected ix = Round(*p\x,#PB_Round_Down), iy = Round(*p\y,#PB_Round_Down), ux.f = *p\x - ix, uy.f = *p\y - iy
  *d\x = LerpM(LerpM(grid(iy,ix)\x,grid(iy,ix+1)\x, ux), LerpM(grid(iy+1,ix)\x,grid(iy+1,ix+1)\x, ux), uy)
  *d\y = LerpM(LerpM(grid(iy,ix)\y,grid(iy,ix+1)\y, ux), LerpM(grid(iy+1,ix)\y,grid(iy+1,ix+1)\y, ux), uy)
EndProcedure

Procedure advect_density()
  Protected pos.vec2f, x, y
  For y = 1 To #ny2 : For x = 1 To #nx2
      pos\x = x - dt * old_velocity(y,x)\x
      pos\y = y - dt * old_velocity(y,x)\y
      If pos\y < 1 : pos\y = 1 : ElseIf pos\y > #ny2 : pos\y = #ny2 : EndIf 
      If pos\x < 1 : pos\x = 1 : ElseIf pos\x > #nx2 : pos\x = #nx2 : EndIf
      interpolate(old_density(), @pos, @new_density(y,x));
  Next : Next
  CopyMemory(@new_density(),@old_density(),v1size)
EndProcedure

Procedure advect_velocity()
  Protected pos.vec2f, x, y
  For y = 1 To #ny2 : For x = 1 To #nx2
      pos\x = x - dt * old_velocity(y,x)\x;
      pos\y = y - dt * old_velocity(y,x)\y;
      If pos\y < 1 : pos\y = 1 : ElseIf pos\y > #ny2 : pos\y = #ny2 : EndIf 
      If pos\x < 1 : pos\x = 1 : ElseIf pos\x > #nx2 : pos\x = #nx2 : EndIf
      interpolateVec2(old_velocity(), @pos,@new_velocity(y,x))
  Next : Next
  CopyMemory(@new_velocity(),@old_velocity(),v2size)
EndProcedure

Procedure diffuse_density()
  Protected pos.vec2f, x, y, diffusion.f = dt * 100.01, sum.f
  For y = 1 To #ny2 : For x = 1 To #nx2
      sum = diffusion * (old_density(y, x - 1) + old_density(y, x + 1) + old_density(y - 1, x) + old_density(y + 1, x)) + old_density(y,x);
      new_density(y, x) = 1.0 / (1.0 + 4.0 * diffusion) * sum 
  Next : Next
  CopyMemory(@new_density(),@old_density(),v1size)
EndProcedure

Procedure diffuse_velocity()
  Protected viscosity = dt*0.000001, x, y, sum.vec2f
  For y = 1 To #ny2 : For x = 1 To #nx2
      sum\x = viscosity * (old_velocity(y, x - 1)\x + old_velocity(y, x + 1)\x + old_velocity(y - 1, x)\x + old_velocity(y + 1, x)\x) + old_velocity(y, x)\x
      sum\y = viscosity * (old_velocity(y, x - 1)\y + old_velocity(y, x + 1)\y + old_velocity(y - 1, x)\y + old_velocity(y + 1, x)\y) + old_velocity(y, x)\y
      new_velocity(y,x)\x = 1.0 / (1.0 + 4.0 * viscosity) * sum\x
      new_velocity(y,x)\y = 1.0 / (1.0 + 4.0 * viscosity) * sum\y
  Next : Next
  CopyMemory(@new_velocity(),@old_velocity(),v2size)
EndProcedure

Procedure project_velocity()
  Protected x, y, dx.f, dy.f, k, sum.f
  Static Dim p.f(#ny,#nx), Dim p2.f(#ny,#nx), Dim div.f(#ny,#nx)

  For y = 1 To #ny2 : For x = 1 To #nx2
      dx = old_velocity(y    , x + 1)\x - old_velocity(y    ,x - 1)\x
      dy = old_velocity(y + 1, x    )\y - old_velocity(y - 1,x    )\y
      div(y,x) = dx + dy : p(y,x) = 0.0
  Next : Next
  For k = 1 To iterations
    For y = 1 To #ny2 : For x = 1 To #nx2
        sum = -div(y,x) + p(y ,x + 1) + p(y ,x - 1) + p(y + 1,x) + p(y - 1,x)
        p2(y,x) = 0.25 * sum
    Next : Next
    CopyMemory(@p2(),@p(),v1size)
  Next
  For y = 1 To #ny2 : For x = 1 To #nx2
      old_velocity(y,x)\x - (0.5 * (p(y    ,x + 1) - p(y    , x - 1)))
      old_velocity(y,x)\y - (0.5 * (p(y + 1,x  ) - p(y - 1, x )))
  Next : Next
EndProcedure

Procedure.f curl(y,x)
  ProcedureReturn old_velocity(y + 1,x)\x - old_velocity(y - 1,x)\x + old_velocity(y,x - 1)\y - old_velocity(y, x + 1)\y;
EndProcedure

Procedure vorticity_confinement()
  Protected direction.vec2f, length.f, x, y;
  Static Dim abs_curl.f(#ny1,#nx1)
  For y = 1 To #ny2 : For x = 1 To #nx2
      abs_curl(y,x) = Abs(curl(y,x));
  Next : Next
  
  For y = 1 To #ny2 : For x = 1 To #nx2
      direction\x = abs_curl(y - 1, x    ) - abs_curl(y + 1, x    );
      direction\y = abs_curl(y    , x + 1) - abs_curl(y    , x - 1);
      length = lengthM(direction\x,direction\y)
      direction\x = vorticity / (length + 1e-5) * direction\x;
      direction\y = vorticity / (length + 1e-5) * direction\y;
      
      If x < #nx * 0.5 : direction\x = 0.0 : direction\y = 0.0 : EndIf
      
      new_velocity(y,x)\x = old_velocity(y,x)\x + dt * curl(y,x) * direction\x;
      new_velocity(y,x)\y = old_velocity(y,x)\y + dt * curl(y,x) * direction\y;
  Next : Next
  CopyMemory(@new_velocity(),@old_velocity(),v2size)
EndProcedure

Procedure.f Clamp(v.f,Low.f = 0.0, High.f = 1.0)
  If v < Low : ProcedureReturn Low : ElseIf v > High : ProcedureReturn High : EndIf
  ProcedureReturn v
EndProcedure

Procedure.f SmoothStep(Low.f, High.f, v.f)
  V = Clamp((v - low) / (high - low));
  ProcedureReturn v * v * (3.0 - 2.0 * v);
EndProcedure

Procedure add_density(px, py, r = 10, value.f = 0.5)
  Protected x, y, u.f, rf.f = r, x2, y2
  For y = -r To r : For x = -r To  r
      y2 = py + y : x2 = px + x
      If x2 < 0 : x2 = 0 : ElseIf x2 > #nx1 : x2 = #nx1 : EndIf
      If y2 < 0 : y2 = 0 : ElseIf y2 > #ny1 : y2 = #ny1 : EndIf
      u = SmoothStep(rf, 0.0, Sqr(x*x + y*y));
      old_density(y2, x2) + u * value
  Next : Next
  
EndProcedure

Procedure fluid_simulation_step()
  Protected x,y, r.f = 10.0 ; r is resolution dependant
  
  For y = 0 To #ny1 : For x = 0 To #nx1
      If x > #nx * 0.5
        old_velocity(y,x)\x + RandomFloatM(-r, r)
        old_velocity(y,x)\y + RandomFloatM(-r, r)
      EndIf
  Next : Next
  
  ;// dense regions rise up
  For y = 0 To #ny1 : For x = 0 To #nx1
      old_velocity(y,x)\y + (old_density(y,x) * 20.0 - 5.0) * dt;
  Next : Next
 
  ;// fast movement is dampened
  For y = 0 To #ny1 : For x = 0 To #nx1
      old_velocity(y,x)\x * 0.999 : old_velocity(y,x)\y * 0.999;
  Next : Next
  
  ;// fade away
  For y = 0 To #ny1 : For x = 0 To #nx1
      old_density(y,x) * 0.99;
  Next : Next

  add_density(#nx*0.25, #ny*0.1, 10.0, 0.5);
  add_density(#nx*0.75, #ny*0.1, 10.0, 0.5);
  
  ;If mouse\x > 0 And mouse\y > 0 And mouse\x < #nx And mouse\y < #ny1 : add_density(Mouse\x, #ny - Mouse\y, #nx * 0.025,0.5) : EndIf
  
  vorticity_confinement()
  ;diffuse_velocity()
  ;project_velocity()
  advect_velocity()
  project_velocity()
  ;diffuse_density();
  advect_density()

  ;/ wipe out borders as prevents crashes
  For y = 0 To #ny1 
      old_density(y,0) = 0.0 : old_velocity(y,0)\x = 0 : old_velocity(y,0)\y = 0      
      old_density(y,1) = 0.0 : old_velocity(y,1)\x = 0 : old_velocity(y,1)\y = 0    
      old_density(y,#nx1) = 0.0 : old_velocity(y,#nx1)\x = 0 : old_velocity(y,#nx1)\y = 0      
      old_density(y,#nx2) = 0.0 : old_velocity(y,#nx2)\x = 0 : old_velocity(y,#nx2)\y = 0      
  Next
  For x = 0 To #nx1 
      old_density(0,x) = 0.0 : old_velocity(0,x)\x = 0 : old_velocity(0,x)\y = 0      
      old_density(#ny1,x) = 0.0 : old_velocity(#ny1,x)\x = 0 : old_velocity(#ny1,x)\y = 0      
      old_density(1,x) = 0.0 : old_velocity(1,x)\x = 0 : old_velocity(1,x)\y = 0      
      old_density(#ny2,x) = 0.0 : old_velocity(#ny2,x)\x = 0 : old_velocity(#ny2,x)\y = 0      
  Next
EndProcedure

Procedure.i Callback(*coord.VEC2,*color.VEC4,*output.VEC2)
  Protected x, y, f.f, f3.f, r.f, g.f, b.f
  x = *coord\x
  y = *coord\y
  If x = 0 And y = 0
    fluid_simulation_step()  
  EndIf
  f = old_density(y,x);
  f = log2m( f * 0.25 + 1.0)        ;
  f3 = f*f*f
  r = 1.5 * f : g = 1.5 * f3 : b = (f3 *f3)
  Vec4(*color,r, g, b, 1.0)
  ProcedureReturn
EndProcedure

Init()
sppCreate("Example - FPS: ",#nx * #Upscale,#ny * #Upscale,#SPP_WINDOW_NORMAL,#nx,#ny,@Callback(),#True,60,@time,#Null,#True)

End
User avatar
Caronte3D
Addict
Addict
Posts: 1361
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: [Library] SPP (SimplePixelProc) - GFX library [Win x64/x86]

Post by Caronte3D »

---------------------------
PureBasic
---------------------------
Linea 252: sppCreate() is not a function, array, list, map or macro.
---------------------------
Aceptar
---------------------------
User avatar
Caronte3D
Addict
Addict
Posts: 1361
Joined: Fri Jan 22, 2016 5:33 pm
Location: Some Universe

Re: [Library] SPP (SimplePixelProc) - GFX library [Win x64/x86]

Post by Caronte3D »

Nevermind It needs alpha7 (maybe is better to update the first post?).
Nice an fast :wink:
User avatar
Mijikai
Addict
Addict
Posts: 1520
Joined: Sun Sep 11, 2016 2:17 pm

Re: [Library] SPP (SimplePixelProc) - GFX library [Win x64/x86]

Post by Mijikai »

Thx :)
I changed the first post.
User avatar
idle
Always Here
Always Here
Posts: 5886
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: [Library] SPP (SimplePixelProc) - GFX library [Win x64/x86]

Post by idle »

Looking good
BarryG
Addict
Addict
Posts: 4166
Joined: Thu Apr 18, 2019 8:17 am

Re: [Library] SPP (SimplePixelProc) - GFX library [Win x64/x

Post by BarryG »

Mijikai wrote: Sun Jan 10, 2021 10:36 amSDF Raymarching
I get an error about "Line 206: Structure not found: SPP" for this. Can you fix it? Thanks. I'm using the latest alpha.
User avatar
Mijikai
Addict
Addict
Posts: 1520
Joined: Sun Sep 11, 2016 2:17 pm

Re: [Library] SPP (SimplePixelProc) - GFX library [Win x64/x

Post by Mijikai »

BarryG wrote: Thu Nov 09, 2023 10:03 am
Mijikai wrote: Sun Jan 10, 2021 10:36 amSDF Raymarching
I get an error about "Line 206: Structure not found: SPP" for this. Can you fix it? Thanks. I'm using the latest alpha.
To make the code viewtopic.php?p=564161#p564161 work with Alpha 7 replace Main() with:

Code: Select all

sppCreate(#Null$,#SPP_W,#SPP_H,#SPP_WINDOW_NORMAL,320,200,@Callback(),#True,60,@time)
Post Reply