Thursday, December 12, 2013

OpenCL up to Speed, and 4K Voxelisation Has Been Attained

As you can see there are still plenty of graphical errors, but I have finally cracked that magical 1024 voxel dimension limits I have had for all this time. 2k isn't that impressive these days, so I jumped straight to 4k, which is needed to see pretty much all of the little patterns on the inside and outside edges of the Stargate. Amusingly, that 16 fold increase in detail didn't noticeably impact performance at all, at least on the rendering side of things (brick creation on the other hand...). Also the OpenCL renderer has been brought up to speed, and currently works at least as well as the OpenGL renderer. Sadly the same can not be for OpenCL's performance, which is really quite poor, at least on my GTX680 it appears to be roughly a quarter of the frame rate of the GLSL version. The Stargate model comes from here. Source code for the current progress as always is available from GitHub.


  1. I'm confused.
    I cloned your git repo, but after cloning, my file tree looks completely different from what is listed in github?
    Is this a branch thing or something?
    I got '' and it does not have a src subdir.
    It builds octview amnd polyview, but running it without cmd line arg will crash it.

    1. Hi Bram, all work since I first released pictures of the dragon (a long time ago) has been on the branch "gui".

      It's good that you brought this up, as it stands it is currently slightly exceeding the functionality of the original, so it really is time I merged it all back into master. Next update.

  2. (gdb) run data/xyzrgb-dragon.oct
    Starting program: /home/bram/src/voxel/./octview data/xyzrgb-dragon.oct
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/".
    zlib ok: inflated 48386 bricks.
    Loaded 7229 blocks, 48387 bricks
    Error = "GL_NO_ERROR"
    Free vram: 0
    Error = "GL_NO_ERROR"
    Error = "GL_INVALID_VALUE"
    Error = "GL_NO_ERROR"
    Free vram: 0

    Program received signal SIGSEGV, Segmentation fault.
    0x0000000000000000 in ?? ()
    (gdb) where
    #0 0x0000000000000000 in ?? ()
    #1 0x0000000000402ca7 in voxel_init (filename=0x7fffffffe362 "data/xyzrgb-dragon.oct") at voxel.c:293
    #2 0x0000000000401b78 in main_init (argc=2, argv=0x7fffffffdfe8) at octview.c:52
    #3 0x000000000042c53c in main (argc=2, argv=0x7fffffffdfe8) at x11.c:435

    1. I was about to delete this comment as not being relevant to todays version, until I noticed the line...

      Free vram: 0

      This is printed by a function that queries both the Nvidia and AMD extensions for free video RAM.

      Apparently it doesn't work :-/
      Good to know now rather than later.