; ShaderFloat 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() ; The shader declares a float parameter named Amount (tint mix) shader=LoadShader("assets/help_surface.b3shader") EntityShader cube,shader amount#=0.75 While Not KeyDown(1) ; Press [ / ] to change the Amount parameter If KeyDown(26) And amount>0 Then amount=amount-0.01 If KeyDown(27) And amount<1 Then amount=amount+0.01 ; Send the new float value to the shader ShaderFloat shader,"Amount",amount TurnEntity cube,0.2,0.4,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,"[ / ] : amount Arrow keys: move camera Esc: exit" Text 0,20,"ShaderFloat shader,"+Chr$(34)+"Amount"+Chr$(34)+","+amount Flip Wend FreeShader shader End