Navigation: Scripting Reference Manual > Functions & Subroutines > MPCRaytrace

 

MPCRaytrace

 

Contact Us: fredsupport@photonengr.com

 

Description

This function performs a Trace CPU Rays, Trace GPU Rays, or Trace Render, depending on the argument supplied.  The precision of the resulting MPC raytrace is determined by the document's single/double MPC state, which can be accessed and modified using the MPCGetSimpleTraceMode() and MPCSetSimpleTraceMode() commands.

 

Syntax

err = MPCRaytrace( mode )

 

 

Parameters

err ( Huge_ )

Returned error error code, where a 0 indicates no error.

 

mode As String

Input argument specifying the GPU raytrace action to be performed.  Options are:

 

“CPU”

Deletes any existing rays in the CPU ray buffer, generates new rays from all traceable sources, performs a GPU raytrace.

“Exist”

If rays exist in the CPU ray buffer, a GPU raytrace is performed with the existing rays.  If no rays exist in the CPU ray buffer, the rays from all traceable sources are generated and then raytraced on the GPU.

“GPU”

Rays from supported source definitions are generated and raytraced entirely on the GPU.

“Render”

Performs a raytrace render of the current 3D view.

 

Example

The following performs an MPC raytrace using the "GPU" option, which uses the GPUs to generate the starting rayset.

 

Sub Main

 

    Dim mpcErr As Huge_

    Dim mode As String

 

    mode   = "GPU" 'Generate rays on the GPUs

    mpcErr = MPCRaytrace( mode )

 

    Print "Returned error code: " & mpcErr

 

End Sub

 

 

See Also

MPCAdvancedRaytrace

MPCInitAdvancedRaytrace

T_MPCADVANCEDRAYTRACE

MPCGetRaySumMode

MPCGetSimpleTraceMode

MPCSetRaySumMode

MPCSetSimpleTraceMode

 

 

 

 

 

Copyright © Photon Engineering, LLC