Vectron (Vector-Polygon) is an OctaneRender® Procedural über primitive, providing infinite, procedurally generated scenes, volumes, and geometry, without using Meshes or Volumes. Vectron objects have zero-memory footprint, offering increased efficiencies when compared to Meshes or Volumes generated on CPUs. This enables Vectron to provide procedurally-generated, triangle-free geometry scenes on the GPU without using VRAM. Vectron works with OctaneRender's built-in OSL (Open Shading Language) support and OSL texture shaders.



Support for Vectron in the c4doctane plugin is limited, and described in the following sections. For access to the full Vectron feature set, use Octane Standalone.


Creating a Vectron Object

Many presets are available in the Vectron object, which is available from Live Viewer > Objects > Vectron. Vectron objects are generated from OSL scripts. You can see and edit a given script in the edit field of the script group, or you can choose to load an external script (in that case, the code for the Vectron object will not be visible). Having access directly to the script allows for modifications as needed.


Select the Vectron object in the Cinema 4D Object Manager, and then choose the Code Group tab in the Attribute manager:



vectron object




Vectron Object


The actual drawing of the Vectron equation will only occur in Live Viewer or when rendering, as there are no polygons in a Vectron object to draw in the Cinema 4D viewport. Instead, a bounding box is drawn (the size of which you control from the Object parameters group in the Code tab), as well as a (typically small) sphere in the center of the bounds. Any portion of a Vectron object that is defined to be outside of the bounds will be clipped and not drawn.


Typically, most Vectron scripts generate very quickly, so the Live Viewer is perfect to work with Vectron scripts, as feedback is effectively instantaneous. There may be cases where a particular script does not immediately show a result in the Live Viewer. In these cases, try adjusting the values in the Script Parameters group. You may find that the sliders in the Script Parameters group are rather finicky, as the bounds are too large. In that case, limit the range of a slider by editing the value of float slidermax in the script to 10 and then adjust as needed.


A note about scripts loaded directly from Octane Standalone: 

Units of scripts written for Standalone are in meters. You may need to significantly adjust any scale values by 100 when pasting into the c4doctane version of Vectron. Functions such as booleans are not available in the plugin and will not appear in Vectron scripts loaded into the c4doctane plugin. Best to use the scripts from the presets menu if you can, as those scripts have been converted for use in the c4dOctane plugin. 


A new Vectron object has an OSL script with the following lines of code:



This script creates a simple sphere. A little extra coding, as in the image below, and you get the result that follows:



You can download the example of the Vectron node in the image above to see it in action here: VectronSphere.orbx 


You can also download a collection of Vectron examples here: Fun_With_Vectron (4).orbx


Boolean Operations with Vectron

Vectron can perform boolean operations on SDF primitive objects. To access the Vectron booleans, go to Live Viewer > Objects > Vectron > Operators, and choose the desired operation from the list in the menu. This will then add a VectronOp object to the Object manager. 



vectron operators




Vectron Boolean Operators menu


Next, load in two SDF primitives as operands and parent to the VectronOP node.



vectron op in c4d object manager




VectronOp and SDF Primitive Operands in Object Manager


To see the results of the VectronOp, you need to use the Live Viewer or render the scene with Octane, as this is a rendertime-only effect. Wireframe drawing is performed in the Cinema 4D 3D views, but these are approximations, at best.



NOTE

Vectron® boolean operations are limited to two operands only — the Cinema 4D Object Manager will allow for an unlimited amount of children attached to the VectronOp object, but Vectron will not process any more than two operands correctly. 



VectronOp

The VectronOp node or object contains the following options to manage the resulting boolean operation:

    • (Operation) Type —  This menu contains a list of the following boolean operations supported by Vectron:
      • Union — Joins the two operands together as one object
      • Subtraction — Subtracts the second operand from the first operand
      • Intersect — Leaves just the portion of both operands that are shared with each other
      • Offset — Will expand or shrink all faces of the first operand to the extents specified by the bounds (the second operand is ignored in this case.)
      • Inset — Creates an inset of the first operand as revealed by the second operand. Blending between the two operands is controlled by the Radius attribute. Many unusual shapes can be created with this operation.
      • Ink — Will create a shape where the two operands intersect, but leaves the first operand in place.
      • Clip — This operation will remove any portion of the operand behind a clipping plane.
    • Radius — The boolean operation will consider only the items within the Radius specified.
    • Bounds — The overall bounds of the boolean realm. Anything outside of these bounds will not be drawn or generated.
    • Transfer Materials — This toggle enables the transfer of materials between operands (transfering material from the second operand to the common portions resulting from the boolean operation.



Vectron Op




VectronOp



IMPORTANT

If the results are being rendered with portions of operands missing, increase the size of the bounds — objects or object portions extending beyond the bounds specified are clipped by the boolean operation. 



Vectron Operand

Any SDF object parented to the VectronOp becomes an operand. Up to two operands are supported (if more operands are present, the results may not be predictable.) Choose the shape of the operand from the Object Type menu. Depending upon the type of object chosen in the Object menu, different options will appear. The first group of options determine the volume and size of the operand (some objects have a Round base and/or Round option, which will spherize the operand by the amounts specified.) The Fill option determines if the operand is solid (1.0), or is hollow with a thickness. The boolean operations will have different results based upon the objects and their parameters.


The Operator section harkens back to the VectronOp, and the Radius parameter is the same as the VectronOp Radius parameter.



vectron operand




Vectron Operand


Vectron Examples


Some of the available Vectron boolean operations



Above is an example of an SDF sphere subtracted from a Menger cube. 


Samples from shadertoy.com being fed into the OSL vectron geometry node. This example was copied from the Octane Standalone script and pasted into the Vectron Object in Cinema 4D. 


Vectron Scripts

There are several preset scripts included with the Vectron object:

    • fractal1.txt
    • glsl_type.h
    • mandelbulb.txt
    • mandelbulb2.osl
    • mandelbub_clay_test
    • menger_sponge_boolean_extract.txt
    • metaball1.txt
    • primitives.txt
    • QuaternionJulia.osl
    • sdf_to_vectron_surface_displacement.txt
    • sphere.osl
    • sphereWithtexture.txt This script uses a noise texture input. Be sure to add a projection node and set the projection to UVW to XYZ
    • sponge.txt
    • temporal_mandelbuld.txt In order to see the result of this script, adjust the bounds values located in the Object Parameters group. Large values will be necessary.
    • Vectron Procedural Waves (slow).txt Generates a plane with a wave texture.
    • vectron_fur_fast.txt
    • vectron_fur_with_motion_blur.txt