demofx icon indicating copy to clipboard operation
demofx copied to clipboard

Running with arbitrary resolutions

Open oliv3 opened this issue 5 years ago • 2 comments

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 !

oliv3 avatar Jul 17 '20 11:07 oliv3

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

yoyoberenguer avatar Sep 15 '21 12:09 yoyoberenguer

Thanks for the response ! What if i want to run it on arbitrary resolutions ? I.e. 960x540 or 1920x1080 ?

oliv3 avatar Sep 15 '21 14:09 oliv3