C# Class RhinoCyclesCore.RenderEngine

Afficher le fichier Open project: mcneel/RhinoCycles Class Usage Examples

Méthodes publiques

Свойство Type Description
DisplayLock object
RenderedSamples int
Session Session
TimeString string

Protected Properties

Свойство Type Description
PluginId Guid
PreviewEventArgs CreatePreviewEventArgs
m_display_update_callback CSycles.DisplayUpdateCallback
m_doc_serialnumber uint
m_flush bool
m_test_cancel_callback CSycles.TestCancelCallback
m_update_callback CSycles.UpdateCallback
m_update_render_tile_callback CSycles.RenderTileCallback
m_view ViewInfo
m_write_render_tile_callback CSycles.RenderTileCallback

Méthodes publiques

Méthode Description
CheckFlushQueue ( ) : void

Check if we should change render engine status. If the changequeue has notified us of any changes Flush will be true. If we're rendering then move to State.Halted and cancel our current render progress.

ColorClamp ( int ch ) : int

Clamp color so we get valid values for system bitmap

Continue ( ) : void
CreateFloat4 ( Color color ) : float4
CreateFloat4 ( byte x, byte y, byte z, byte w ) : float4
CreateFloat4 ( double x, double y, double z ) : float4
CreateWorld ( ) : void

Tell our changequeue instance to initialise world.

DegToRad ( float ang ) : float
DisplayBuffer ( uint sessionId, uint tx, uint ty, uint tw, uint th ) : void

Update the RenderWindow or RenderBitmap with the updated tile from Cycles render progress.

FlushIt ( ) : void

Flush

IsPreview ( ) : bool

True if rendering for preview

LoggerCallback ( string msg ) : void

Callback for debug logging facility. Will be called only for Debug builds of ccycles.dll

Pause ( ) : void
RenderEngine ( Guid pluginId, CreatePreviewEventArgs previewEventArgs, bool interactive ) : System
RenderEngine ( Guid pluginId, uint docRuntimeSerialnumber, ViewInfo view, ViewportInfo vp, bool interactive ) : System
RenderEngine ( Guid pluginId, uint docRuntimeSerialNumber, bool interactive ) : System
SaveRenderedBuffer ( int sample ) : void
SetFloatTextureAsByteTexture ( bool floatAsByte ) : void

OpenCL doesn't properly support HDRi textures in the environment, so read them as byte textures instead.

SetProgress ( RenderWindow rw, string msg, float progress ) : void

Set progress to RenderWindow, if it is not null.

SetProjectionMode ( Shader shader, CyclesTextureImage texture, ImageTextureNode image_node, TextureCoordinateNode texture_coordinates ) : void

Set image texture node and link up with correct TextureCoordinateNode output based on texture ProjectionMode. This may add new nodes to the shader!

StopRendering ( ) : void

Called when user presses the stop render button.

TestCancel ( uint sid ) : void
TriggerChangesReady ( ) : void
TriggerSamplesChanged ( int samples ) : void
TriggerStatusTextUpdated ( StatusTextEventArgs e ) : void

Tell engine to fire StatusTextEvent with given arguments

UpdateCallback ( uint sid ) : void

Handle status updates

UpdateRenderTileCallback ( uint sessionId, uint x, uint y, uint w, uint h, uint depth, int startSample, int numSamples, int sample, int resolution ) : void

Handle update render tile callback

WriteRenderTileCallback ( uint sessionId, uint x, uint y, uint w, uint h, uint depth, int startSample, int numSamples, int sample, int resolution ) : void

Handle write render tile callback

Méthodes protégées

Méthode Description
CreateScene ( Client client, Device render_device, RenderEngine cycles_engine ) : Scene

create a ccl.Scene

Database_FilmUpdateTagged ( object sender, EventArgs e ) : void
Database_LightShaderChanged ( object sender, LightShaderUpdatedEventArgs e ) : void
Database_LinearWorkflowChanged ( object sender, LinearWorkflowChangedEventArgs e ) : void
Database_MaterialShaderChanged ( object sender, MaterialShaderUpdatedEventArgs e ) : void
SetCallbacks ( ) : void

Register the callbacks to the render engine session

UploadData ( ) : bool

Main entry point for uploading data to Cycles.

Private Methods

Méthode Description
CreateCyclesShaderFromRhinoV6BasicMat ( CyclesShader shader ) : ccl.Shader
CreateCyclesShaderFromXml ( CyclesShader shader ) : ccl.Shader
CreateMaterialShader ( CyclesShader shader ) : ccl.Shader
CreateSimpleEmissionShader ( CyclesLight light ) : ccl.Shader
HasSceneChanges ( ) : bool

Return true if any change has been received through the changequeue

ReCreateSimpleEmissionShader ( CyclesLight light, ccl.Shader emission_shader ) : ccl.Shader
RecreateBackgroundShader ( CyclesBackground background, RhinoShader &currentShader ) : void
RecreateCyclesShaderFromRhinoV6BasicMat ( CyclesShader shader, ccl.Shader existing ) : ccl.Shader
RecreateCyclesShaderFromXml ( CyclesShader shader, ccl.Shader existing ) : ccl.Shader
RecreateMaterialShader ( CyclesShader shader, ccl.Shader existing ) : ccl.Shader
RegisterEventHandler ( ) : void
SetTextureImage ( EnvironmentTextureNode envnode, CyclesTextureImage texture ) : void
SetTextureImage ( ImageTextureNode imnode, CyclesTextureImage texture ) : void
StopTheRenderer ( ) : void

Method Details

CheckFlushQueue() public méthode

Check if we should change render engine status. If the changequeue has notified us of any changes Flush will be true. If we're rendering then move to State.Halted and cancel our current render progress.
public CheckFlushQueue ( ) : void
Résultat void

ColorClamp() public static méthode

Clamp color so we get valid values for system bitmap
public static ColorClamp ( int ch ) : int
ch int
Résultat int

Continue() public méthode

public Continue ( ) : void
Résultat void

CreateFloat4() public static méthode

public static CreateFloat4 ( Color color ) : float4
color System.Drawing.Color
Résultat float4

CreateFloat4() public static méthode

public static CreateFloat4 ( byte x, byte y, byte z, byte w ) : float4
x byte
y byte
z byte
w byte
Résultat float4

CreateFloat4() public static méthode

public static CreateFloat4 ( double x, double y, double z ) : float4
x double
y double
z double
Résultat float4

CreateScene() protected static méthode

create a ccl.Scene
protected static CreateScene ( Client client, Device render_device, RenderEngine cycles_engine ) : Scene
client Client Client to create scene for
render_device Device Render device to use
cycles_engine RenderEngine Engine instance to create for
Résultat Scene

CreateWorld() public méthode

Tell our changequeue instance to initialise world.
public CreateWorld ( ) : void
Résultat void

Database_FilmUpdateTagged() protected méthode

protected Database_FilmUpdateTagged ( object sender, EventArgs e ) : void
sender object
e EventArgs
Résultat void

Database_LightShaderChanged() protected méthode

protected Database_LightShaderChanged ( object sender, LightShaderUpdatedEventArgs e ) : void
sender object
e LightShaderUpdatedEventArgs
Résultat void

Database_LinearWorkflowChanged() protected méthode

protected Database_LinearWorkflowChanged ( object sender, LinearWorkflowChangedEventArgs e ) : void
sender object
e LinearWorkflowChangedEventArgs
Résultat void

Database_MaterialShaderChanged() protected méthode

protected Database_MaterialShaderChanged ( object sender, MaterialShaderUpdatedEventArgs e ) : void
sender object
e MaterialShaderUpdatedEventArgs
Résultat void

DegToRad() public static méthode

public static DegToRad ( float ang ) : float
ang float
Résultat float

DisplayBuffer() public méthode

Update the RenderWindow or RenderBitmap with the updated tile from Cycles render progress.
public DisplayBuffer ( uint sessionId, uint tx, uint ty, uint tw, uint th ) : void
sessionId uint
tx uint
ty uint
tw uint
th uint
Résultat void

FlushIt() public méthode

Flush
public FlushIt ( ) : void
Résultat void

IsPreview() public méthode

True if rendering for preview
public IsPreview ( ) : bool
Résultat bool

LoggerCallback() public static méthode

Callback for debug logging facility. Will be called only for Debug builds of ccycles.dll
public static LoggerCallback ( string msg ) : void
msg string
Résultat void

Pause() public méthode

public Pause ( ) : void
Résultat void

RenderEngine() public méthode

public RenderEngine ( Guid pluginId, CreatePreviewEventArgs previewEventArgs, bool interactive ) : System
pluginId Guid
previewEventArgs CreatePreviewEventArgs
interactive bool
Résultat System

RenderEngine() public méthode

public RenderEngine ( Guid pluginId, uint docRuntimeSerialnumber, ViewInfo view, ViewportInfo vp, bool interactive ) : System
pluginId Guid
docRuntimeSerialnumber uint
view ViewInfo
vp ViewportInfo
interactive bool
Résultat System

RenderEngine() public méthode

public RenderEngine ( Guid pluginId, uint docRuntimeSerialNumber, bool interactive ) : System
pluginId Guid
docRuntimeSerialNumber uint
interactive bool
Résultat System

SaveRenderedBuffer() public méthode

public SaveRenderedBuffer ( int sample ) : void
sample int
Résultat void

SetCallbacks() protected méthode

Register the callbacks to the render engine session
protected SetCallbacks ( ) : void
Résultat void

SetFloatTextureAsByteTexture() public méthode

OpenCL doesn't properly support HDRi textures in the environment, so read them as byte textures instead.
public SetFloatTextureAsByteTexture ( bool floatAsByte ) : void
floatAsByte bool
Résultat void

SetProgress() public méthode

Set progress to RenderWindow, if it is not null.
public SetProgress ( RenderWindow rw, string msg, float progress ) : void
rw RenderWindow
msg string
progress float
Résultat void

SetProjectionMode() public static méthode

Set image texture node and link up with correct TextureCoordinateNode output based on texture ProjectionMode. This may add new nodes to the shader!
public static SetProjectionMode ( Shader shader, CyclesTextureImage texture, ImageTextureNode image_node, TextureCoordinateNode texture_coordinates ) : void
shader Shader
texture CyclesTextureImage
image_node ImageTextureNode
texture_coordinates TextureCoordinateNode
Résultat void

StopRendering() public méthode

Called when user presses the stop render button.
public StopRendering ( ) : void
Résultat void

TestCancel() public méthode

public TestCancel ( uint sid ) : void
sid uint
Résultat void

TriggerChangesReady() public méthode

public TriggerChangesReady ( ) : void
Résultat void

TriggerSamplesChanged() public méthode

public TriggerSamplesChanged ( int samples ) : void
samples int
Résultat void

TriggerStatusTextUpdated() public méthode

Tell engine to fire StatusTextEvent with given arguments
public TriggerStatusTextUpdated ( StatusTextEventArgs e ) : void
e StatusTextEventArgs
Résultat void

UpdateCallback() public méthode

Handle status updates
public UpdateCallback ( uint sid ) : void
sid uint
Résultat void

UpdateRenderTileCallback() public méthode

Handle update render tile callback
public UpdateRenderTileCallback ( uint sessionId, uint x, uint y, uint w, uint h, uint depth, int startSample, int numSamples, int sample, int resolution ) : void
sessionId uint
x uint
y uint
w uint
h uint
depth uint
startSample int
numSamples int
sample int
resolution int
Résultat void

UploadData() protected méthode

Main entry point for uploading data to Cycles.
protected UploadData ( ) : bool
Résultat bool

WriteRenderTileCallback() public méthode

Handle write render tile callback
public WriteRenderTileCallback ( uint sessionId, uint x, uint y, uint w, uint h, uint depth, int startSample, int numSamples, int sample, int resolution ) : void
sessionId uint
x uint
y uint
w uint
h uint
depth uint
startSample int
numSamples int
sample int
resolution int
Résultat void

Property Details

DisplayLock public_oe property

Lock object to protect buffer access.
public object DisplayLock
Résultat object

PluginId protected_oe property

protected Guid PluginId
Résultat Guid

PreviewEventArgs protected_oe property

protected CreatePreviewEventArgs PreviewEventArgs
Résultat CreatePreviewEventArgs

RenderedSamples public_oe property

public int RenderedSamples
Résultat int

Session public_oe property

Reference to the session of this render engine instance.
public Session Session
Résultat Session

TimeString public_oe property

public string TimeString
Résultat string

m_display_update_callback protected_oe property

protected CSycles.DisplayUpdateCallback m_display_update_callback
Résultat CSycles.DisplayUpdateCallback

m_doc_serialnumber protected_oe property

protected uint m_doc_serialnumber
Résultat uint

m_flush protected_oe property

protected bool m_flush
Résultat bool

m_test_cancel_callback protected_oe property

protected CSycles.TestCancelCallback m_test_cancel_callback
Résultat CSycles.TestCancelCallback

m_update_callback protected_oe property

protected CSycles.UpdateCallback m_update_callback
Résultat CSycles.UpdateCallback

m_update_render_tile_callback protected_oe property

protected CSycles.RenderTileCallback m_update_render_tile_callback
Résultat CSycles.RenderTileCallback

m_view protected_oe property

protected ViewInfo m_view
Résultat ViewInfo

m_write_render_tile_callback protected_oe property

protected CSycles.RenderTileCallback m_write_render_tile_callback
Résultat CSycles.RenderTileCallback