demofx
demofx copied to clipboard
Running with arbitrary resolutions
Hello, first thanks for these nice demos !
I was playing with the tunnel demo and saw it works because the texture size is 256x256.
Is it possible to get it running with any resolution ? For example, I'd like to use this demo on a HD screen with a 1920x1080 texture.
Thanks !
for a texture 512x512 (make sure the texture is seamless (GIMP can transform a picture into a seamless form)
Essentially you would have to change the below line of codes (this would works only for 512x512)
u = (distances[srcOfs] + shiftx) & 0xff
v = (angles[srcOfs] + shifty) & 0xff
And you need to adjust
pixOfs = (u + (v << 9)) << 3
Best of luck
Thanks for the response ! What if i want to run it on arbitrary resolutions ? I.e. 960x540 or 1920x1080 ?