ai_render.h
Go to the documentation of this file.
1 // Copyright 2020 Autodesk, Inc. All rights reserved.
2 //
3 // Use of this software is subject to the terms of the Autodesk license
4 // agreement provided at the time of installation or download, or which
5 // otherwise accompanies this software in either electronic or hard copy form.
6 
12 #pragma once
13 #include "ai_api.h"
14 #include "ai_array.h"
15 #include "ai_string.h"
16 #include <stddef.h> // NULL
17 #include <stdint.h> // uint32_t etc
18 
30 {
33 };
34 
39 {
50 };
51 
63 {
66 };
67 
78 {
83 };
84 
89 {
96 };
97 
102 {
110 };
111 
123 {
125  uint32_t pass_index;
126  uint32_t total_passes;
134 };
135 
200 typedef AtRenderStatus (*AtRenderUpdateCallback)(void *private_data, AtRenderUpdateType update_type, const AtRenderUpdateInfo *update_info);
201 
202 
203 AI_API void AiBegin(AtSessionMode mode = AI_SESSION_BATCH);
204 AI_API void AiEnd();
206 
207 AI_API void AiRenderAddInteractiveOutput(uint32_t output_index);
208 AI_API bool AiRenderIsInteractiveOutput(uint32_t output_index);
209 AI_API bool AiRenderRemoveInteractiveOutput(uint32_t output_index);
211 
212 AI_API AI_DEPRECATED void AiRenderSetInteractiveOutput(uint32_t output_index);
213 AI_API AI_DEPRECATED uint32_t AiRenderGetInteractiveOutput();
214 
215 AI_API bool AiRenderSetHintBool(AtString hint, bool value);
216 AI_API bool AiRenderSetHintInt(AtString hint, int32_t value);
217 AI_API bool AiRenderSetHintFlt(AtString hint, float value);
218 AI_API bool AiRenderSetHintStr(AtString hint, AtString value);
219 AI_API bool AiRenderSetHintArray(AtString hint, AtArray *value);
220 AI_API bool AiRenderGetHintBool(AtString hint, bool& value);
221 AI_API bool AiRenderGetHintInt(AtString hint, int32_t& value);
222 AI_API bool AiRenderGetHintFlt(AtString hint, float& value);
223 AI_API bool AiRenderGetHintStr(AtString hint, AtString& value);
224 AI_API bool AiRenderGetHintArray(AtString hint, const AtArray*& value);
225 
226 AI_API AtRenderErrorCode AiRenderBegin(AtRenderMode mode = AI_RENDER_MODE_CAMERA, AtRenderUpdateCallback update_callback = NULL, void* callback_private_data = NULL);
229 AI_API void AiRenderInterrupt(AtBlockingCall blocking = AI_NON_BLOCKING);
230 AI_API void AiRenderResume();
231 AI_API void AiRenderRestart();
232 AI_API void AiRenderAbort(AtBlockingCall blocking = AI_NON_BLOCKING);
233 
234 AI_API AI_DEPRECATED AtRenderErrorCode AiRender(AtRenderMode mode = AI_RENDER_MODE_CAMERA);
235 AI_API AI_DEPRECATED bool AiRendering();
236 
237 /*\}*/
AtDisplayOutput outputs_to_display
Whether the outputs to be shown are none, partial, interactive, or all outputs.
Definition: ai_render.h:124
Currently actively rendering passes.
Definition: ai_render.h:93
AI_API bool AiRenderGetHintBool(AtString hint, bool &value)
Get a render hint.
Definition: ai_render.cpp:233
AtRenderStatus(* AtRenderUpdateCallback)(void *private_data, AtRenderUpdateType update_type, const AtRenderUpdateInfo *update_info)
Render update callback.
Definition: ai_render.h:200
generic error
Definition: ai_render.h:49
Render from a camera.
Definition: ai_render.h:31
AI_API void AiRenderAbort(AtBlockingCall blocking=AI_NON_BLOCKING)
Tell the renderer to abort itself as quickly as possible.
Definition: ai_render.cpp:942
AI_API AI_DEPRECATED bool AiRendering()
Returns the rendering status of the renderer.
Definition: ai_render.cpp:965
AI_API void AiRenderRestart()
Restart a render after it was paused.
Definition: ai_render.cpp:870
Callback invoked for an imager update.
Definition: ai_render.h:109
asynchronous, non-blocking call; returns ASAP, task completes in the background
Definition: ai_api.h:143
all outputs are getting updated, any output can be displayed
Definition: ai_render.h:82
Before AiRenderBegin(), or after AiRenderEnd()
Definition: ai_render.h:90
AtSessionMode
Session mode.
Definition: ai_render.h:62
no error
Definition: ai_render.h:40
AI_API bool AiRenderGetHintArray(AtString hint, const AtArray *&value)
Get a render hint.
Definition: ai_render.cpp:471
AI_API bool AiRenderRemoveInteractiveOutput(uint32_t output_index)
Remove the output so it is not displayed during fast interactive rendering.
Definition: ai_render.cpp:121
AI_API bool AiRenderGetHintStr(AtString hint, AtString &value)
Get a render hint.
Definition: ai_render.cpp:439
render aborted
Definition: ai_render.h:41
AI_API bool AiRenderGetHintFlt(AtString hint, float &value)
Get a render hint.
Definition: ai_render.cpp:330
render interrupted by user
Definition: ai_render.h:46
Render failed, AiRenderEnd() will return the actual error code (AtRenderErrorCode) ...
Definition: ai_render.h:95
AtRenderMode
Render modes.
Definition: ai_render.h:29
invalid render region
Definition: ai_render.h:45
Callback invoked just before render pass is to begin, can change the scene.
Definition: ai_render.h:104
Cannot create GPU context.
Definition: ai_render.h:48
AI_API AtRenderStatus AiRenderGetStatus()
Get the current status of rendering.
Definition: ai_render.cpp:832
AI_API bool AiRenderGetHintInt(AtString hint, int32_t &value)
Get a render hint.
Definition: ai_render.cpp:285
int32_t current_GI_transmission_samples
The actual GI_transmission_samples for the current pass (options.GI_transmission_samples remains the ...
Definition: ai_render.h:131
AtBlockingCall
Whether a function call is blocking (synchronous) or not (asynchronous)
Definition: ai_api.h:140
AtRenderStatus
Status of the current render.
Definition: ai_render.h:88
Callback invoked during render pass after some pixel data is ready; not currently invoked...
Definition: ai_render.h:105
Render done, but AiRenderEnd() not called yet.
Definition: ai_render.h:94
Arnold String allows for fast string comparisons.
Definition: ai_string.h:46
AI_API bool AiRenderSetHintFlt(AtString hint, float value)
Set a render hint.
Definition: ai_render.cpp:630
int32_t current_AA_samples
The actual AA_samples for the current pass (options.AA_samples remains the original value) ...
Definition: ai_render.h:127
AtRenderErrorCode
Render error codes.
Definition: ai_render.h:38
Callback invoked after render is interrupted and paused, can change the scene.
Definition: ai_render.h:103
AI_API void AiEnd()
Marks the end of a block which uses the Arnold rendering interface API.
Definition: ai_render.cpp:60
Update callback is restarting the render.
Definition: ai_render.h:92
AI_API AI_DEPRECATED void AiRenderSetInteractiveOutput(uint32_t output_index)
Set the output displayed during fast interactive rendering.
Definition: ai_render.cpp:186
AI_API void AiRenderResume()
Resume a render after it was paused.
Definition: ai_render.cpp:851
AtDisplayOutput
Outputs ready for display.
Definition: ai_render.h:77
AI_API AI_DEPRECATED uint32_t AiRenderGetInteractiveOutput()
Get the output displayed during fast interactive rendering.
Definition: ai_render.cpp:210
AI_API bool AiRenderSetHintStr(AtString hint, AtString value)
Set a render hint.
Definition: ai_render.cpp:665
DLL export prefix for API functions (necessary for multi-platform development)
int32_t current_AA_samples_max
The actual AA_samples_max for the current pass (options.AA_samples_max remains the original value) ...
Definition: ai_render.h:128
usage not validated
Definition: ai_render.h:44
uint32_t pass_index
The pass number we're on out of the total number of passes, useful for indicating progress to the use...
Definition: ai_render.h:125
interactive mode, can read/write nodes after rendering
Definition: ai_render.h:65
Process arbitrary ray-tracing requests, acting as a "ray server".
Definition: ai_render.h:32
no rendering outputs
Definition: ai_render.h:47
batch mode, extra (possibly destructive) optimizations allowed
Definition: ai_render.h:64
AI_API bool AiRenderIsInteractiveOutput(uint32_t output_index)
Get whether the output is displayed during fast interactive rendering.
Definition: ai_render.cpp:161
Generic array data type and methods.
AI_API void AiRenderAddInteractiveOutput(uint32_t output_index)
Add the output to be displayed during fast interactive rendering.
Definition: ai_render.cpp:102
AI_API AtRenderErrorCode AiRenderEnd()
Finalize and clean up after beginning a render.
Definition: ai_render.cpp:816
AI_API AtSessionMode AiGetSessionMode()
Returns the current render session's mode.
Definition: ai_render.cpp:81
interactive output updated fully, display on screen
Definition: ai_render.h:80
int32_t current_GI_volume_samples
The actual GI_volume_samples for the current pass (options.GI_volume_samples remains the original val...
Definition: ai_render.h:133
AI_API bool AiRenderSetHintArray(AtString hint, AtArray *value)
Set a render hint.
Definition: ai_render.cpp:715
Callback invoked when an error or abort occurs, and the render has failed.
Definition: ai_render.h:108
int32_t current_GI_sss_samples
The actual GI_sss_samples for the current pass (options.GI_sss_samples remains the original value) ...
Definition: ai_render.h:132
int32_t current_GI_specular_samples
The actual GI_specular_samples for the current pass (options.GI_specular_samples remains the original...
Definition: ai_render.h:130
AI_API void AiRenderRemoveAllInteractiveOutputs()
Remove the output so it is not displayed during fast interactive rendering.
Definition: ai_render.cpp:142
Update callback paused the render or AiRenderInterrupt() called.
Definition: ai_render.h:91
interactive output updated but not the whole image; put on screen anyway
Definition: ai_render.h:81
AI_API AtRenderErrorCode AiRenderBegin(AtRenderMode mode=AI_RENDER_MODE_CAMERA, AtRenderUpdateCallback update_callback=NULL, void *callback_private_data=NULL)
Start a render asynchronously.
Definition: ai_render.cpp:794
AI_API void AiBegin(AtSessionMode mode=AI_SESSION_BATCH)
Marks the beginning of a block which uses the Arnold rendering interface API.
Definition: ai_render.cpp:42
Callback invoked after a non-final render pass is done, can change the scene.
Definition: ai_render.h:106
AI_API void AiRenderInterrupt(AtBlockingCall blocking=AI_NON_BLOCKING)
Tell the renderer to interrupt itself quickly and go to a paused state.
Definition: ai_render.cpp:898
Additional useful information about the render, received in the render callback.
Definition: ai_render.h:122
int32_t current_GI_diffuse_samples
The actual GI_diffuse_samples for the current pass (options.GI_diffuse_samples remains the original v...
Definition: ai_render.h:129
uint32_t total_passes
The total passes we expect to render, assuming no interruptions or errors.
Definition: ai_render.h:126
AI_API bool AiRenderSetHintInt(AtString hint, int32_t value)
Set a render hint.
Definition: ai_render.cpp:566
AI_API AI_DEPRECATED AtRenderErrorCode AiRender(AtRenderMode mode=AI_RENDER_MODE_CAMERA)
Initializes frame-dependant data and launches bucket workers (if requested)
Definition: ai_render.cpp:992
Callback invoked after the final render pass is done, can change the scene.
Definition: ai_render.h:107
no updates ready; check render status or error code
Definition: ai_render.h:79
bad camera data
Definition: ai_render.h:43
AI_API bool AiRenderSetHintBool(AtString hint, bool value)
Set a render hint.
Definition: ai_render.cpp:505
camera not defined
Definition: ai_render.h:42
AtString class for fast comparisons.
AtRenderUpdateType
Reason for invoking the render update callback.
Definition: ai_render.h:101

© 2020 Autodesk, Inc. · All rights reserved · www.arnoldrenderer.com