18 #ifndef __HUSD_Imaging_h__
19 #define __HUSD_Imaging_h__
47 class husd_DefaultRenderSettingContext;
61 void setScene(HUSD_Scene *scene_ref);
70 DRAW_WIRE_SHADED_SMOOTH
73 void showPurposeRender(
bool enable);
74 void showPurposeProxy(
bool enable);
75 void showPurposeGuide(
bool enable);
77 void setDrawMode(DrawMode
mode);
78 void setDrawComplexity(
float complexity);
79 void setBackfaceCull(
bool cull);
83 bool setFrame(
fpreal frame);
84 bool setDefaultLights(
bool doheadlight,
bool dodomelight);
85 void setHeadlightIntensity(
fpreal intensity);
86 void setLighting(
bool enable);
87 void setMaterials(
bool enable);
96 BufferSet hasAOVBuffers()
const;
102 void setPostRenderCallback(ImagingCallback cb);
103 bool getUsingCoreProfile();
109 bool launchBackgroundRender(
const UT_Matrix4D &view_matrix,
116 void waitForUpdateToComplete();
118 bool checkRender(
bool do_render);
133 int myOrthoFlag { 1 };
136 void updateComposite(
bool free_buffers_if_missing,
137 const SlapcompViewInfo *
v =
nullptr);
147 const TIL_Raster *background_raster =
nullptr,
148 int bleft = 0,
int bbottom = 0,
149 int bright = 0,
int btop = 0,
164 const SlapcompViewInfo *
v =
nullptr);
168 bool camera_synced =
true)
170 if(path != myCameraPath)
173 mySettingsChanged =
true;
176 if(camera_synced != myCameraSynced)
178 myCameraSynced = camera_synced;
179 mySettingsChanged =
true;
184 { myCompositor = comp; }
189 {
return !isUpdateRunning() && myConverged; }
190 void terminateRender(
bool hard_halt =
true);
196 {
return myRendererName; }
197 void getRendererCommands(
200 void invokeRendererCommand(
204 RUNNING_UPDATE_NOT_STARTED = 0,
209 bool isUpdateRunning()
const;
210 bool isUpdateComplete()
const;
217 bool canPause()
const;
218 bool isPausedByUser()
const;
219 bool isStoppedByUser()
const;
220 bool rendererCreated()
const;
226 {
return myAllowUpdates; }
228 { myAllowUpdates = allow_updates; }
230 static void initializeAvailableRenderers();
233 void setRenderSettings(
const UT_StringRef &settings_path,
244 void setRenderFocus(
int x,
int y)
const;
245 void clearRenderFocus()
const;
252 void setRenderRegionActive(
bool active);
253 void setDataWindowActive(
bool active);
259 void getPrimPathsFromRenderKeys(
263 void updateDeferredPrims();
267 { mySlapcompProgram =
program; }
270 void enableSlapcomp(
bool do_slap);
273 {
return mySlapcompEnabled; }
278 {
return mySlapcompStateChanged; }
282 {
return mySlapcompEnabled && mySlapcompHasErrors; }
285 void reportSlapcompError(
const char*
error);
287 void reportSlapcompWarning(
const char*
error);
293 mySlapcompErrorCB = cb;
294 mySlapcompErrorCBData =
data;
301 mySlapcompWarningCB = cb;
302 mySlapcompWarningCBData =
data;
308 void handleCopTextureChange(
bool time_changed);
310 void setCopTextureChangeCallback(ImagingCallback cb);
313 class husd_ImagingPrivate;
314 class husd_IMXRenderBuffer;
321 void registerSlapcompAOVs(
bool dostash,
const SlapcompViewInfo *view_info);
325 void runSlapcompIfNeeded(
const SlapcompViewInfo* view_info);
330 husd_IMXRenderBuffer*
b)
337 bool buildSlapcompProgramAndUpdatePlanes(
bool force);
339 void resetImagingEngine();
341 bool updateRestartCameraSettings(
bool cam_effects)
const;
342 bool anyRestartRenderSettingsChanged()
const;
347 const PXR_NS::VtValue &
value,
348 bool from_usd_prim =
false);
350 RunningStatus updateRenderData(
const UT_Matrix4D &view_matrix,
354 void gatherCopResolverDependencies();
355 void finishRender(
bool do_render);
363 unsigned myWantsHeadlight : 1,
365 myWantsDomelight : 1,
370 mySettingsChanged : 1,
372 myValidRenderSettingsPrim : 1,
379 ImagingCallback myPostRenderCallback;
380 ImagingCallback myCopTextureChangeCallback;
389 BufferSet myLastCompositedBufferSet;
391 fpreal myHeadlightIntensity;
396 bool myHandlingCopTextureChange;
410 void (*mySlapcompErrorCB)(
void*,
const char*);
412 void* mySlapcompErrorCBData;
414 void (*mySlapcompWarningCB)(
void*,
417 void* mySlapcompWarningCBData;
419 bool mySlapcompEnabled;
423 bool mySlapcompStateChanged;
426 bool mySlapcompHasErrors;
429 SlapcompViewInfo myLastSlapcompViewInfo;
void setSlapcompErrorCallback(void(*cb)(void *, const char *), void *data)
Sets a callback that gets called when reporting errors.
const UT_StringHolder & currentAov() const
void setAOVCompositor(HUSD_Compositor *comp)
XUSD_RenderSettings contains the HdRenderSettings for the render.
GLsizei const GLchar *const * path
GA_API const UT_StringHolder rot
void setSlapcompWarningCallback(void(*cb)(void *, const char *), void *data)
Sets a callback that gets called when reporting warnings.
IFDmantra you can see code vm_image_mplay_direction endcode When SOHO starts a render
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
const UT_StringHolder & rendererName() const
const UT_StringHolder & outputPlane() const
Simple interface around HdRenderBuffer.
bool isSlapcompEnabled() const
Returns true if slapcomp is enabled.
bool slapcompStateChanged() const
HUSD_API const char * resolution()
GLuint const GLchar * name
std::function< T > UT_Function
GLboolean GLboolean GLboolean b
void setSlapcompProgram(COP_ApexProgram *program)
Set the slapcomp program that should be used when slapcomp is enabled.
that also have some descendant prim *whose name begins with which in turn has a child named baz where *the predicate active
void setCameraPath(const UT_StringRef &path, bool camera_synced=true)
GLfloat GLfloat GLfloat GLfloat h
A map of string to various well defined value types.
const UT_StringArray & rendererPlanes() const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
SIM_API const UT_StringHolder force
void setAllowUpdates(bool allow_updates)
#define PXR_NAMESPACE_CLOSE_SCOPE
bool hasSlapcompErrors() const
Returns true if the last run of slapcomp had errors.
GLubyte GLubyte GLubyte GLubyte w
UT_Function< void(HUSD_Imaging *imaging)> ImagingCallback
GLbitfield GLuint program
bool allowUpdates() const