15 #ifndef __DM_VPortAgent__
16 #define __DM_VPortAgent__
58 class DM_FloorInterface;
61 class DM_RenderHighQuality;
62 class DM_SceneManager;
65 class DM_ViewportHooks;
66 class DM_VPortComposite;
69 class DM_RenderVulkan;
82 int getUniqueId()
const;
87 bool non_templated_only,
89 const DM_Viewport &viewport)
const;
94 void cleanupViewport();
108 bool isActiveRender()
const;
111 bool isLopsView()
const;
128 OP_Node *currentCamera()
const;
131 void drawBackground(
bool draw);
137 void handleDisplayOptionEvent(
UI_Event *e);
140 void handleViewParameterEvent(
UI_Event *e);
166 bool resolve_aa =
true)
const;
168 bool resolve_aa =
true)
const;
174 int dst_layer)
const;
178 int dst_layer)
const;
186 bool getBeautyPassHDR()
const;
187 void setBeautyPassConsolidate(
bool con);
218 bool wholy_contained,
230 bool enable_occlusion,
231 bool handle_pick_radius);
265 unsigned int xray_pickmask,
273 bool hide_selected,
bool enable_occlusion,
275 bool do_xray,
bool do_guides,
280 unsigned pickmask,
int gravity,
288 bool hide_selected,
bool enable_occlusion,
289 bool do_xray,
bool do_guides,
300 int pnt_rad,
int edge_rad,
int face_rad,
310 void invalidatePickBuffers();
326 bool hover_decorations);
341 bool do_geometry_setup);
351 bool treat_uv_viewport_as_3d =
false,
361 bool floor = myDrawFloorTransientFlag;
362 myDrawFloorTransientFlag =
false;
367 {
return myFloorInterface.get(); }
371 DM_ViewportHooks &
hooks()
const {
return *myViewportHooks; }
374 {
return myNeedsOverlayRender; }
379 void handleLocateEvent(
UI_Event *e);
387 int getNumOpaqueObjects()
const;
390 int getNumTransparentObjects()
const;
393 int getNumUnlitObjects()
const;
396 int getNumXRayObjects()
const;
408 void markGeoSetup(
bool setup,
409 DM_Viewport *setup_port = NULL);
418 void cleanupLights();
421 {
return myMaterialLights; }
429 int64 getFramebufferUsageKB(
bool hdr,
bool hql,
bool trans,
434 void getZBufferTransform(
float zt[2],
RE_Light *light=NULL,
435 bool reverse_depth =
false);
439 void handleNewGeometryEvent(
UI_Event *e);
449 const char *msg)
const;
465 int64 getSceneVersion(
fpreal t,
bool shadow,
bool &timedep);
477 void updateTimeDependentLook(
fpreal t);
479 bool isToolbarLinked()
const;
494 static bool shouldHideAsViewCamObject(
const DM_Viewport &vport,
496 static bool shouldHideAsViewCamObject(
const DM_Viewport &vport,
501 {
return myDrawFloorTransientFlag; }
510 {
return mySceneManager; }
522 void renderToVulkanImages();
530 #ifdef VULKAN_PRESENTATION
548 DM_RenderVulkan *vkRender() {
return myVKRender.get(); }
552 friend class dm_SetupTask;
558 DM_SceneManager &modeler()
559 {
return mySceneManager; }
561 const GUI_SceneLook *getLook()
const {
return mySceneLook.get(); }
562 GUI_SceneLook *getLook() {
return mySceneLook.get(); }
564 bool shouldDisplayObject(
const DM_Viewport &vport,
568 bool shouldVisualizeObject(
const DM_Viewport &vport,
584 const char* msg,
int line );
591 void renderCameraMessage(
RE_Render *ren,
int x,
int y,
600 bool hdr,
bool needs_aa);
601 void destroyBeautyPassBuffer();
610 bool snapshot_name =
false);
622 bool allow_smooth =
true);
626 void setGammaPass(
bool b) { myGammaPass = b?1:0; }
641 void destroySelectionBuffer();
646 bool isBeautyPassAA(
bool allow_aa =
true);
656 bool uniforms_for_3d);
657 void setupStereo3dForRightCamera(
RE_Render *
r,
658 bool uniforms_for_3d);
670 void destroyTransparentBuffers();
677 bool use_color_buffer_for_depth);
679 void destroyCompositeBuffers();
688 void renderCameraMaskOverlay(
RE_Render *,
int,
int);
690 void renderTransparentGeometry(
694 bool renderHQTransparencyPass(
698 bool for_xray =
false);
699 bool setupHQTransparentBuffers(
702 void destroyHQTransparentBuffers();
707 void destroyUnlitAlphaBuffer();
713 bool enable_occlusion,
714 unsigned int pickmask,
742 bool geo_ignore_depth,
744 bool floor_prioritize,
753 int filterPickData(
int32 *pick_base_data,
754 int32 *pick_component_data,
762 unsigned int pickmask,
776 unsigned int pickmask,
777 unsigned int xray_pickmask,
808 bool wholy_contained,
822 bool enable_occlusion,
823 unsigned int pickmask,
829 unsigned int snapmask,
830 unsigned int xray_snapmask,
834 bool enable_occlusion,
839 unsigned int pickmask,
845 unsigned int pickmask,
846 unsigned int xray_pickmask,
865 bool skip_obj_sel_looks,
866 bool skip_guide_looks,
867 bool skip_nonsnappable_looks,
868 bool skip_current_look);
872 bool skip_obj_sel_looks =
false,
873 bool skip_guide_looks =
false,
874 bool skip_nonsnappable_looks =
false,
875 bool skip_current_look =
false);
885 unsigned int snapmask,
889 bool enable_occlusion,
891 bool do_xray,
bool do_guides,
906 bool &needs_lighting);
914 int cubemap_unit)
const;
917 bool skip_postprocessing =
false);
919 void normalQualityRender(
933 void destroyOverlappingUVBuffer();
938 void destroyCoincidentBuffer();
942 exint start_subtracting_at,
948 void updateVisibleBoundariesAndViews(
int vis_display_sets);
962 int myBeautyPassSamples;
963 bool myBeautyPassHDR;
968 bool myTransparentHDR;
988 #ifdef USE_VULKAN // WIP: make private, and make heleper func
1005 DM_RenderHighQuality *myHQRender;
1006 DM_PostEffects *myPostEffects;
1016 bool myIsBeautyPass;
1019 bool myUseUnlitMask;
1020 bool myHighQualityMode;
1021 bool myNeedsXRayResolve;
1024 bool myHasCascadingShadowLight;
1025 bool myNeedsOverlayRender;
1030 bool myHasTransparencyPass =
false;
1031 bool myHasAlphaBuffers =
false;
1034 mutable unsigned int myDepthResolveShaderFailed : 1,
1035 myZCompositeShaderFailed : 1;
1039 bool myHasSelectionsShown;
1040 bool myDrawFloorTransientFlag;
1041 int myDecorLocateMask;
1042 int myDecorVisibleMask;
1062 bool mySavedAntiAliasOption;
1064 DM_SceneManager &mySceneManager;
1065 DM_Viewport *myDisplay;
1082 DM_SnapBuffer *mySnapBuffer;
1083 bool mySnapHasValidData;
1112 int myDecorLocateRawPos[2];
1113 int myDecorLocatePos[2];
1119 bool myHQTransparentHDR;
1127 bool myRampUnitPushed;
1140 bool myUseHQLighting;
1141 bool myHasPerLookPickPriority;
1143 DM_ViewportHooks *myViewportHooks;
1146 int myCurrentObjectID;
GLsizei GLenum const void * indices
void requestDraw()
Request a deferred redraw.
IMATH_HOSTDEVICE constexpr int floor(T x) IMATH_NOEXCEPT
const DM_Viewport * getDisplay() const
GA_API const UT_StringHolder rot
GLdouble GLdouble GLdouble z
A collection of vertex arrays defining a geometry object. This class acts as a wrapper around multipl...
PUGI__FN void sort(I begin, I end, const Pred &pred)
const UT_Array< RE_Light * > & getAllLights() const
**But if you need a result
const DM_FloorInterface * getFloorInterface() const
unsigned long long uint64
Temporary container for either a RV_Render and an RE_Render.
DM_ViewportHooks & hooks() const
Interface to viewport hooks (render and mouse)
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
DM_ViewportType getViewType() const
The projection type of this viewport.
void setLightingPass(GR_LightingPass p)
GLint GLsizei GLsizei height
GLint GLint GLsizei GLint GLenum GLenum type
ImageBuf OIIO_API sub(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
GA_API const UT_StringHolder trans
RV_API void cleanupShaders()
const DM_SceneManager & modeler() const
GLboolean GLboolean GLboolean b
Handle to the main interface of Vulkan.
bool needsToDrawFloor() const
GLint GLint GLsizei GLsizei GLsizei depth
RV_API bool initShaders(RV_Instance *inst)
DM_FloorInterface * getFloorInterface()
Contains transitional objects to provide some backward compatibility for code that references old GEO...
GLfloat GLfloat GLfloat GLfloat h
DM_VPortComposite * getComposite()
GUI_RotoView
Viewport type for Rotoscope settings.
bool needsOverlayRender() const
bool checkAndClearTransientFloorFlag()
Check if the floor still needs to be rendered and then clear it.
GLubyte GLubyte GLubyte GLubyte w
#define DM_VIEWPORT_PERSPECTIVE
GR_LightingPass getLightingPass() const
QOpenGLContext * RE_OGLContext
DM_Viewport * getDisplay()
UT_UniquePtr< TIL_Raster > RasterPtr
GA_API const UT_StringHolder area
Simple interface to building a shader from a .prog file.