Trying to make a scrolling grid using UV offsets. It flickers hard when moving, and causes odd color shifting with small offset changes. Possibly related to my earlier post on how DrawLine is drawing white as grey at different times.
What am I doing wrong here?
Example code:
SetErrorMode(2)
SetWindowTitle( "flicker" )
SetWindowSize( 1024, 768, 0 )
SetVirtualResolution( 1920, 1080 )
SetOrientationAllowed( 1, 1, 1, 1 )
x1 = 0
x2 = 64
y1 = 0
y2 = y1+1
color_white = MakeColor(255, 255, 255)
DrawBox(x1, y1, x2, y2, color_white, color_white, color_white, color_white, 1)
x1 = 0
x2 = x1+1
y1 = 0
y2 = 64
DrawBox(x1, y1, x2, y2, color_white, color_white, color_white, color_white, 1)
Render()
img_id = GetImage(0, 0, 63, 63)
ResizeImage(img_id, 64, 64)
sid = CreateSprite(img_id)
SetImageWrapU( img_id, 1 )
SetImageWrapV( img_id, 1 )
SetSpriteSize(sid, 1920, 1080)
SetSpriteVisible(sid, 1)
SetSpriteColor(sid, 255, 255, 255, 255)
cols# = 1920/64
rows# = 1080/64
SetSpriteUVScale( sid, 1.0/cols#, 1.0/rows# )
xo# = 0
yo# = 0
do
//uncomment these 2 lines to get a weird color cycling effect from left of screen to right
// inc xo#, 0.001
// inc yo#, 0.001
//uncomment these lines to see the screen flicker as the grid moves
// inc xo#, 0.01
// inc yo#, 0.01
SetSpriteUVOffset(sid, xo#, yo#)
sync()
loop