Blink Ray Marcher v1.0


 
This location is for Registered Users Only.
Perhaps you need to login or register.
Contributor: Owen Bulka
This project contains three gizmos that allow you to ray march a wide variety of shapes, including fractals, utilizing the GPU.
Requirements:
13.0, 12.1, 12.0 or later
Linux
12 May 2022
23

BlinkScript Ray Marcher for Nuke

mandelbox

mandelbulb trap test reduced

snowman

Setup

Simply download, and unzip the folder, then add the src/python directory to your NUKE_PATH (export NUKE_PATH='$NUKE_PATH:[path/to/unzipped]/src/python'). The gizmos will appear in the nodes menu under the 'SDF' group, and all callbacks and the FN_BLINK_INCLUDE_PATHS will be set up automatically. The most up to date version can always be downloaded from the linked github page.

Requirements

This project has been tested in Nuke 12.0v8, 12.1v5, and 13.0v2. I recommend using 12.0 if you do not have much GPU memory, because it still uses OpenCL for blinkscript, rather than cuda. The cuda version will continue to increase memory consumption until crashing, so the entire framerange needs to fit in memory. You will want to have a GPU, the above examples were rendered using an NVIDIA GeForce GTX 980 Ti.

Gizmos

sdf_primitive

This gizmo lets you choose the shape, dimensions, location, and surface properties of an object. It takes other sdf_primitives as inputs, and all nodes in the 'children' input will be positioned relative to it. The children will also interact with the shape according to your selection, allowing you to intersect, subtract, and blend the objects. You can also use any shape as a bounding volume of its children in order to improve performance.

The surface properties include:

  • reflection
  • transmission
  • diffuse colour
  • roughness
  • emission (placeholder for planned 'path marched' global illumination)

You can select the refractive index of the object as well as the medium the camera, and therefore the ray, starts in.

There are also controls for:

  • elongating about the x, y, and z axes
  • mirroring the object across the x, y, and z axes
  • repeating the object on a grid both finitely and infinitely with no extra memory cost
  • hollowing out the objects, which can be used in combination with intersections

The current available shapes are:

  • sphere
  • ellipsoid
  • cut sphere
  • hollow sphere
  • death star
  • solid angle
  • rectangular prism
  • rectangular prism frame
  • rhombus
  • triangular prism
  • cylinder
  • infinite cylinder
  • plane
  • capsule
  • cone
  • infinite cone
  • capped cone
  • rounded cone
  • torus
  • capped torus
  • link
  • hexagonal prism
  • octahedron
  • mandelbulb
  • mandelbox

sdf_light

This gizmo allows you to light the scene with a few different light types, namely:

  • point
  • directional
  • ambient
  • ambient occlusion

You can choose the colour, intensity, and falloff of the light. You can also soften the shadows with a slider.

ray_march

This gizmo renders the scene using a ray marching algorithm, with support for hdri image based lighting. You can input a standard nuke camera and the perspective projection, axes, and world space coordinates, will match that of Nuke's native scanline renderer, and general 3D system.

The AOV options are:

  • scene
  • normal
  • position
  • depth

References
https://iquilezles.org/articles/distfunctions/
http://blog.hvidtfeldts.net/index.php/2011/09/distance-estimated-3d-fractals-v-the-mandelbulb-different-de-approximations/

MIT License Copyright (c) 2022 Owen Bulka Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please login in order to download these files.

You have no rights to post comments

We have 3665 guests and 78 members online