bernds / GAPFixFractal

A program to generate pictures of Mandelbrot or Julia sets, using arbitrary precision arithmetic on CUDA GPUs.
20 stars 1 forks source link

Feature request: Fullscreen #1

Open trathborne opened 2 years ago

trathborne commented 2 years ago

This program is amazing! ☺

I'd like to be able to render wallpaper without using the batch renderer, so I'm requesting a fullscreen mode. In Xaos, it looks like this was approximately as simple as:

https://github.com/xaos-project/XaoS/commit/fe58f09de3d696d9b6527e21ca5884c8c600cfb1 https://github.com/xaos-project/XaoS/commit/23aa0f8d572a29a2ad84ea7ea79af3df72342825

bernds commented 2 years ago

Hmm, what's the problem with using the batch renderer? It's there for exactly this purpose.

I will note that I can enter fullscreen in XaoS, but with my setup here, it won't let me leave again :)

trathborne commented 2 years ago

It's just what I'm used to, I guess: saving what I'm looking at and/or having a larger canvas than my window. ;) Come to think of it I'll definitely use batch rendering for supersampling=4 which is super smooth, whereas interactive only supports 2.

What I really need from batch render mode is larger dimensions. I'm guessing that 8191 is a GPU buffer limitation. I like to render for 1440ppi printing on A3+ paper, which is 18316x27046 px. I would be happy to send you your favourite params printed on archival paper if you can make that possible. ;)

The XaoS fullscreen toggle is Ctrl-F11, looks like it's a default Qt key and was added in https://github.com/xaos-project/XaoS/commit/bd51da2f8824513460e0fe6694820f5d7161c2a0

bernds commented 2 years ago

From what I remember, the size limitation was because of pixel counts being stored in 16 bit on the GPU side, and you have to multiply the dimensions with the number of supersampling pixels. I guess it could be relaxed for lower supersample counts.

bernds commented 2 years ago

Could also add a mode where it renders multiple pieces of the picture, column-wise, into different files. That way there wouldn't be any storage or memory size limitations, but you'd have to stitch the images together afterwards. Does that sound like something you'd want?

trathborne commented 2 years ago

I like lots of oversampling, so the 16-bit limit in real pixels is still a limit for me. Would be nice to have it match the oversampling level, though.

I have no problem with stitching images with e.g. gm montage so a truly unlimited tile renderer would be amazing!

bernds commented 2 years ago

I've implemented a tiled renderer. So far I've only tested this with exactly one image, so it's not in master yet, but in a branch called "tiled-render". Let me know if you check it out and it works for you.

trathborne commented 2 years ago

Thanks! I will give it a try the next time my GPU comes up for air.

trathborne commented 2 years ago

I am trying a low-zoom Mandelbrot (precision 3) at 27046x18316 pixels. At supersampling 3, I got a segfault at gpuhandler.cc line 351 (fd->pic_result[idx] += count;) and at supersampling 2 ... so far I have 3 all-black 965x15213 PNGs which does not seem right.☺

I am recovering from COVID but will look more closely at it when I stop feeling stupid. What a nasty virus.

trathborne commented 2 years ago

It wrote 5 all-black files, then this really weird one, with stripe artifacts and unexpected colours: http://loki.aceldama.com/stuff/sqr0001_5.png

(the palette was echo -n 'AAAAA///Pz//P/8//z8//w==' | base64 -d > firestrm.fpal)

... and then it crashed at the same place ...

Thread 8 "QThread" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd1d3b700 (LWP 1253010)]
0x00005555555a1cfe in GPU_handler::slot_start_kernel (this=0x555555acaaa0, fd=<optimized out>, generation=1467, max_nwords=<optimized out>, steps=2000, batch=true) at ../src/gpuhandler.cc:351
351                                     fd->pic_result[idx] += count;
(gdb) where
#0  0x00005555555a1cfe in GPU_handler::slot_start_kernel(frac_desc*, int, int, int, bool)
    (this=0x555555acaaa0, fd=<optimized out>, generation=1467, max_nwords=<optimized out>, steps=2000, batch=true) at ../src/gpuhandler.cc:351
#1  0x00007ffff5839c2a in QObject::event(QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#2  0x00007ffff6225a66 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#3  0x00007ffff622f0f0 in QApplication::notify(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Widgets.so.5
#4  0x00007ffff580d80a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#5  0x00007ffff5810488 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#6  0x00007ffff5865e37 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#7  0x00007ffff47cf17d in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#8  0x00007ffff47cf400 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#9  0x00007ffff47cf4a3 in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007ffff5865435 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#11 0x00007ffff580c3ab in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#12 0x00007ffff5644785 in QThread::exec() () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007ffff56459d2 in  () at /lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007ffff5026609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#15 0x00007ffff5166163 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95