• June 18, 2021, 06:37:36 AM

Login with username, password and session length

Author Topic:  Mandelbulber v2 2.12 - OpenCL  (Read 2186 times)

0 Members and 1 Guest are viewing this topic.

Offline buddhi

  • Fractal Feline
  • **
  • Posts: 160
    • Mandelbulber GitHub repository
Mandelbulber v2 2.12 - OpenCL
« on: November 16, 2017, 08:13:41 PM »
Mandelbulber v2 2.12

Free download (executables for win64, osx and sorce code for linux): http://sourceforge.net/projects/mandelbulber/
official FB group: https://www.facebook.com/groups/mandelbulber/

This is first official release of Mandelbulber program with OpenCL rendering engines which uses graphics card computation capabilities. Most of rendering features available in CPU rendering engine are implemented in OpenCL code.
Thanks to zebastian's magic php scripts there was possible to auto-generate OpenCL code for all existing fractal formulas. Appearance of images rendered using GPU and CPU in most of cases is the same (with some limitations listed below)
However there is still list of features which still only work on CPU (will be implemented in next versions):

- only material #1 is used
- texture mapping (including background)
- primitive objects
- HDR blur
- stereoscopic images
- NetRender
- boolean operators
- support for multiple GPUs
- voxel / mesh export
- anti-aliasing
- limited calculation accuracy to single precision (CPU uses double precision)

To enable OpenCL in Mandelbulber you need to open Preferences dialog and enable it on OpenCL tab. In this window you can select graphics card which you want to use for computation.

Some numbers:
- lines of OpenCL code in rendering engines: 6255
- lines of OpenCL code in fractal formulas: 14802
- 961 commits on GitHub since release 2.11
- 2 new members in Mandelbulber Team

Big Thanks to many users of Mandelbulber which help me testing alpha releases.

New in 2.12:

- OpenCL: Added listing of available OpenCL platforms and devices
- OpenCL: Added querying of OpenCL platforms and devices properties
- OpenCL: Added selection of OpenCL platform and device in Preferences dialog
- OpenCL: Added populateOpenCL.php to autogenerate some OpenCL header files
- OpenCL: populateUiInformation.php autogenerate OpenCL fractal formula code based on C++ code
- OpenCL: Converted all fractal formulas to OpenCL code. Formulas are stored in formula/opencl folder
- OpenCL: Fractal formulas chosen are loaded as separate files
- OpenCL: Applied hybrid sequence to ComputeFractal()
- OpenCL: Added distance estimation functions (logarithmic, linear, pseudoKleinian)
- OpenCL: Added deltaDE distance estimation algorithm
- OpenCL: Added macros to call all fractal formulas in iteration loop according to hybrid sequence
- OpenCL: Added Julia mode
- OpenCL: Implemented detailLevel, iterThreshMode, interiorMode, smoothness
- OpenCL: Added rendering engines:
  * fast - very simple and fast shader. No effects.
  * limited - most of effects, except reflections and refractions
  * full - with branched ray marching - all effects
- OpenCL: Implemented usage of material #1
- OpenCL: Added shader for angle of incidence of lights
- OpenCL: Added soft shadows for main light source
- OpenCL: Added specular reflections
- OpenCL: Added all coloring functions
- OpenCL: Added background shader (excluding textured background)
- OpenCL: Added "Fast Ambient Occlusion" shader
- OpenCL: Added ambient occlusion with "multiple rays with light map"
- OpenCL: Added "slow" calculation of normal vectors
- OpenCL: Added Screen Space Ambient Occulsion (SSAO)
- OpenCL: Added shaders for auxiliary light sources and random lights
- OpenCL: Added "glow" effect
- OpenCL: Added "visible lights" effect
- OpenCL: Added "volumetric lights" effect
- OpenCL: Added "iteration fog" effect
- OpenCL: Added all perspective types to opencl code (three point, equirectangular, fish-eye, fulldome)
- OpenCL: Added Monte Carlo DOF effect with statistical noise control
- OpenCL: Added custom DE step multiplier for volumetric effects
- OpenCL: Added DOF post effect based on Z-Buffer
- OpenCL: Added sweet spot rotation (e.g. needed for full dome)
- OpenCL: Added processing of alpha channel
- OpenCL: Added Box and Spherical folding to OpenCL code (compatibility with Mandelbulber 1.21)
- OpenCL: Rendered tile selection based on center distance ascending. This makes the rendering reveal the image from the center outwards as smoothly as possible
- OpenCL: Kernels are recompiled only when dynamic code is changed
- OpenCL: Added handling of most of OpenCL errors
- OpenCL: Added low limit for distance threshold (1.0e-6) to avoid significant numeric errors
- OpenCL: Added mutex mechanism to protect against concurent rendering using OpenCL by many rendering threads (image, previews, thumbnails)
- OpenCL: Added marker for current pending tile
- OpenCL: CLI mode prepared for rendering with OpenCL
- OpenCL: designed a way to load OpenCL header files on different OpenCL platforms (nVidia, AMD, Intel...)
- OpenCL: Added checking of GPU memory resources and compare with mem limit setting in preferences dialog. If there is not enough memory, effects are rendered using CPU.
- OpenCL: Added BAT script to disable TDR in graphics driver (timeout protection)
- OpenCL: CL_DEVICE_TYPE_ACCELERATOR supported for k1om (x100 Xeon PHI Co-processor)

- Added new fractal formulas:
  * Jos-Kleinian
  * mandelbulbQuat
  * mandelbulbJuliabulb
  * aboxMod12
  * quaternionCubic4d
  * boxFoldBulbPow2V2
  * boxFoldBulbPow2V3
  * aboxMod13
  * boxFoldQuat
  * transfScaleVaryMulti
  * transfBoxFold4dTglad
  * transfSphericalFoldCuboid
  * transfSphericalFoldXYZBias

- Updated fractal formulas
    a record of updates and changes to formulas can be seen in fractal_list.hpp
    a brief summary:
  * with some formulas the vary_scale function has been added, modified or changed,
  * aboxMod2 had major corrections,
  * aux.color has been implemented in more transforms

- Fractals: All fractal formulas converted to 4 dimensional vectors. Backward compatibility has been maintained
- Fractals: Standardized interface for all fractal formula functions
- Fractals: Used function pointers to call functions for fractal formulas. This reduced the complexity of ComputeFractal(). Assignment of fractal functions are made in fractal_list.cpp
- Shaders: Corrected calculation of shaders when "minimum view distance" is reached.
- Shaders: Added soft shadows for auxiliary lights
- Shaders: Added parameter to define color of "fake light sources" (lights based on orbit traps)
- Shaders: Corrected algorithm for orbit trap lights (surface shader)
- Shaders: RayRecursion algorithm partially converted from recursive to iterative - compatible with OpenCL
- Shaders: Optimized multi-ray ambient occlusion in Monte Carlo mode.
- Shaders: Added "DOF_max_radius" parameter to limit maximum blur radius.
- Animation: updated code to use OpenCL rendering
- Animation: increased animation frame range. The old limit was 99999, which is less than an hour of 30 fps frames. The new limit is 9999999, which is just more than 24 hours of an 100 fps video.
- Animation: fixed images deletion of keyframes / flight
- AnimBySound: sound files can be loaded directly from Internet (if specified path starts from http://)
- UI: Added auto-refresh period parameter in preferences dialog
- UI: png, tiff and exr save with progress bar on each channel
- UI: fix png16 and png16alpha save with double .png extension
- UI: formula ui changed most of iteration max from 250 to 999
- UI: standardized color picker for all OS
- UI: Fixed bug: pasting Julia values crashed mandelbulber
- UI: Changed sequence of startup. Now toolbar icons are refreshed after all other initializations of the program.
- UI: Added new color themes for main window
- Queue: Fixed problem with ignored settings of maximum number of threads and thread priority when queue was rendered
- Gamepad: corrected gamepad selection when many devices are connected
- NetRender: display server name in client on connection
- Voxel export: corrected limits (bounding box) for Mesh Export (there was swapped x and y)
- Voxel export: Corrected Mesh Export. Voxel size in each axis has to be unified to calculate correct faces and normal vectors. Now there is only "resolution" parameter which specifies resolution in the longest axis (depends on limits)
- CLI: Added example output path to benchmark. Now the benchmark can optionally put the renders of the example renders into a folder, when this folder has been specified with the -o/--output cli option.
- CLI: Added options for OpenCL configuration
- CLI: Benchmark renders all 300+ examples
- CLI: Benchmark enabled with for OpenCL with 24 hour test timeout.
- CLI: Benchmark generates detailed log output for each rendered example.
- Settings: enumerative fields are saved as names
- Compilation: UI files for fractal formulas moved to formula folder
- Compilation: *.pro files moved to qmake folder
- Compilation: Added mandelbulber-opencl.pro file
- Compilation: MSVC solution updated for OpenCL
- Compilation: MSVC solution includes OpenCL ICD Loader binaries for system compatibility
- Compilation: MSVC solution is fully functional and compatible with Visual Studio 2017
- Compilation: MSVC build is now default for Windows version
- Compilation: Included MSVC redistributable in Build Package
- Compilation: new windows installer (Install Jammer was no longer supported)
- Compilation: Implemented CLEW for mingw builds
- Compilation: added SHARED_DIR_IS_APP_DIR for AppImage. Allows shared data at the same location as the application, when defined at compile time, this can be used for AppImage packaging
- Compilation: updated prepare_for_*.sh scripts
- Compilation: documentation files moved to /usr/share/doc/mandelbulber
- Compilation: CMAKE build refactored and updated.
- Performance: fixed many issues showed by CoverityScan
- Documentation: Added chapter about OpenCL

As always every feedback is appreciated!

Source code repository (GIT, SVN) https://github.com/buddhi1980/mandelbulber2

Linkback: https://fractalforums.org/index.php?topic=533.0

Offline mclarekin

  • 3c
  • ***
  • Posts: 867
Re: Mandelbulber v2 2.12 - OpenCL
« Reply #1 on: November 20, 2017, 04:42:05 AM »
Attached image demonstrates the difference between c++ double precision and the openCL single precision. On the left we have single precision and double on the right. The top row is with the camera distance to surface around 1e-03, on a larger image you can see the difference between the two if you look real close, but it is not enough to worry about if you were animating. The bottom row has the camera distance to surface set around 1e-04 and the difference is obvious.

Because of this difference, you will find that some of the Examples that come with the program will only render correctly in c++ double precision (these examples are generally zoomed in more than 1e-04). 

Conversely, some of the newer example that are using MC DOF or volumetric light should be only rendered in OpenCL as the render time in c++ is huge.

Double precision openCL is planned for Mandelbulber in the future when it is more likely that users will have GPUs that can handle double precision.

Offline 3DickUlus

  • Administrator
  • *******
  • Posts: 2276
    • Digilantism
Re: Mandelbulber v2 2.12 - OpenCL
« Reply #2 on: November 22, 2017, 05:50:05 AM »
 :o amazing work buddhi  :thumbs: very well done  :yes:

Offline buddhi

  • Fractal Feline
  • **
  • Posts: 160
    • Mandelbulber GitHub repository
Re: Mandelbulber v2 2.12 - OpenCL
« Reply #3 on: December 05, 2017, 11:06:37 AM »
Mandelbulber 2.12-1 is released. It has following bugfixes:

- OpenCL: fixed bug in shader for auxiliary light sources. There was wrong color of specular reflections
- Documentation: Added missing chapter about OpenCL

Offline knighty

  • Fractal Feline
  • **
  • Posts: 199
Re: Mandelbulber v2 2.12 - OpenCL
« Reply #4 on: December 05, 2017, 09:52:27 PM »

Mandelbulber 2.2.16 OpenCL

Started by piotrv on Mandelbulber

2 Replies
Last post December 25, 2018, 01:09:32 PM
by Caleidoscope
Mandelbulber and multicore CPU in OpenCL

Started by jeyjey on Mandelbulber

1 Replies
Last post October 28, 2018, 11:55:12 AM
by buddhi
OpenCL Error Mandelbulber V2

Started by paradoxic on Mandelbulber

7 Replies
Last post July 07, 2020, 10:40:03 AM
by piotrv
Mandelbulber 2.24 - Random OpenCL Error

Started by Voulxe on Mandelbulber

2 Replies
Last post January 09, 2021, 09:35:24 AM
by Voulxe
Mandelbulber v2 2.12 - alpha6 - bugfix 1 - OpenCL

Started by buddhi on Downloads

1 Replies
Last post November 02, 2017, 09:41:21 PM
by WAUthethird