only make a dot3 map from desktop (take few sec.)
SYNC RATE 60 : SYNC ON : SET WINDOW LAYOUT 0, 0, 0
AUTOCAM OFF : BACKDROP OFF : DRAW TO BACK
#CONSTANT user32 = 1
#CONSTANT gdi32 = 2
LOAD DLL "user32.dll", user32
LOAD DLL "gdi32.dll", gdi32
DOT3()
MAKE OBJECT SPHERE 1, 400, 32, 32
TEXTURE OBJECT 1, 1
SET BUMP MAPPING ON 1, 2
REPEAT
PASTE IMAGE 1, 0, 0
TURN OBJECT LEFT 1, COS(A) * 2
POSITION OBJECT 1, 0, 0, 500 - SIN(A) * 100
MX = MX - MOUSEMOVEX()
MY = MY + MOUSEMOVEY()
POINT LIGHT 0, MX, MY, 50
SET CURSOR 0, 0
PRINT "FPS: ", SCREEN FPS()
INC A
SYNC
UNTIL MOUSECLICK()
DELETE DLL user32
DELETE DLL gdi32
END
FUNCTION DOT3()
HIDE WINDOW
hDsk = CALL DLL(user32, "GetDesktopWindow")
hDC = CALL DLL(user32, "GetWindowDC", hDsk)
DskW = CALL DLL(gdi32, "GetDeviceCaps", hDC, 8)
DskH = CALL DLL(gdi32, "GetDeviceCaps", hDC, 10)
CREATE BITMAP 1, SCREEN WIDTH(), SCREEN HEIGHT()
LOCK PIXELS
FOR DskX = DskW / 2 - SCREEN WIDTH() / 2 TO DskW / 2 + SCREEN WIDTH() / 2 - 1
FOR DskY = DskH / 2 - SCREEN HEIGHT() / 2 TO DskH / 2 + SCREEN HEIGHT() / 2 - 1
C = CALL DLL(gdi32, "GetPixel", hDC, DskX, DskY)
DOT BmpX, BmpY, RGB(RGBB(C), RGBG(C), RGBR(C))
INC BmpY
NEXT DskY
BmpY = 0
INC BmpX
NEXT DskX
UNLOCK PIXELS
GET IMAGE 1, 0, 0, SCREEN WIDTH(), SCREEN HEIGHT(), 1
MAKE MEMBLOCK FROM BITMAP 1, 1
LOCK PIXELS
FOR X = 0 TO BITMAP WIDTH() - 1
FOR Y = 0 TO BITMAP HEIGHT() - 1
R = (GrayScale(1, X - 1, Y) - GrayScale(1, X + 1, Y) + 255) / 2
G = (GrayScale(1, X, Y - 1) - GrayScale(1, X, Y + 1) + 255) / 2
DOT X, Y, RGB(R, G, 255)
NEXT Y
NEXT X
UNLOCK PIXELS
GET IMAGE 2, 0, 0, BITMAP WIDTH(), BITMAP HEIGHT(), 1
DELETE MEMBLOCK 1
DELETE BITMAP 1
CALL DLL user32, "ReleaseDC", hDsk, hDC
RESTORE WINDOW
ENDFUNCTION
FUNCTION GrayScale(MB, X, Y)
if X < 0 then X = 0
if Y < 0 then Y = 0
if X > MEMBLOCK DWORD(MB, 0) - 1 THEN X = MEMBLOCK DWORD(MB, 0) - 1
if Y > MEMBLOCK DWORD(MB, 4) - 1 THEN Y = MEMBLOCK DWORD(MB, 4) - 1
C = MEMBLOCK DWORD(MB, 12 + (MEMBLOCK DWORD(MB, 0) * Y + X) * 4)
C = RGBR(C) * 0.30 + RGBG(C) * 0.59 + RGBB(C) * 0.11
ENDFUNCTION C
ps: in windowed mode it looks better, this can take more as 10 sec.