Dither.bb 633 B

123456789101112131415161718192021222324252627282930313233
  1. ; Dither Example
  2. ; --------------
  3. Graphics3D 640,480,16
  4. SetBuffer BackBuffer()
  5. camera=CreateCamera()
  6. light=CreateLight()
  7. ; Rotate light so that it creates maximum shading effect on sphere
  8. RotateEntity light,90,0,0
  9. sphere=CreateSphere( 32 )
  10. PositionEntity sphere,0,0,2
  11. While Not KeyDown( 1 )
  12. ; Toggle dither enable value between true and false when spacebar is pressed
  13. If KeyHit( 57 )=True Then enable=1-enable
  14. ; Enable/disable hardware dithering
  15. Dither enable
  16. RenderWorld
  17. Text 0,0,"Press spacebar to toggle between Dither True/False"
  18. If enable=True Then Text 0,20,"Dither True" Else Text 0,20,"Dither False"
  19. Flip
  20. Wend
  21. End