; LoadShader Example ; ------------------ ; Requires Extended mode. Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() PositionEntity camera,0,0,-5 light=CreateLight() RotateEntity light,35,-30,0 cube=CreateCube() ; Load one of the packaged built-in shaders by its alias shader=LoadShader("builtin:toon") If shader=0 Then RuntimeError "Could not load shader" EntityShader cube,shader bands=4 While Not KeyDown(1) ; Press [ / ] to change the toon shader's band count If KeyHit(26) And bands>1 Then bands=bands-1 If KeyHit(27) And bands<8 Then bands=bands+1 ShaderFloat shader,"Bands",bands TurnEntity cube,0.25,0.5,0 ; Arrow keys move the camera If KeyDown(200) Then MoveEntity camera,0,0,0.1 If KeyDown(208) Then MoveEntity camera,0,0,-0.1 If KeyDown(203) Then TurnEntity camera,0,1,0 If KeyDown(205) Then TurnEntity camera,0,-1,0 RenderWorld Color 255,255,255 Text 0,0,"[ / ] : toon bands Arrow keys: move camera Esc: exit" Text 0,20,"shader=LoadShader("+Chr$(34)+"builtin:toon"+Chr$(34)+") Bands "+bands Flip Wend FreeShader shader End