Click or drag to resize
AB4D logo

DXScene Methods

The DXScene type exposes the following members.

Methods
 NameDescription
Public methodAddRenderingQueueAfter Adds the newRenderQueue after the already registered afterRenderQueue. If rendering queue is MaterialSortedRenderingQueue or CameraDistanceSortedRenderingQueue, then also its IsSortingEnabled property is set according to the current DXScene settings.
Public methodAddRenderingQueueBefore Adds the newRenderQueue before the already registered afterRenderQueue
Public methodCalculateCameraPlanes(ICamera, Boolean, Single, Single) CalculateCameraPlanes sets the zNear and zFar parameters to camera near plane distance and camera far plane distance. The values are calculated with using the bounding box of the current scene and specified camera. When adjustValues Boolean parameter is true, the zNear and zFar values are slightly adjusted to increase the distance between zNear and zFar (recommended). CalculateCameraPlanes returns false if the calculated values are not correct (are 0, NaN or Infinity). This can happen when camera's matrices are not set.
Public methodStatic memberCalculateCameraPlanes(Matrix, Boolean, Boolean, Vector3, Boolean, Single, Single) CalculateCameraPlanes sets the zNear and zFar parameters to camera near plane distance and camera far plane distance. When adjustValues Boolean parameter is true, the zNear and zFar values are slightly adjusted to increase the distance between zNear and zFar (recommended). CalculateCameraPlanes returns false if the calculated values are not correct (are 0, NaN or Infinity). This can happen when camera's matrices are not set.
Public methodCreateAndUseStagingBuffer CreateAndUseStagingBuffer creates a Staging buffer (used to copy the rendered back buffer to main memory) and set it to RenderingContext.
Public methodCode exampleCreateCustomRenderingContext(Int32, Int32, Int32, BackBufferReadyEventHandler, DisposeList) Creates a CustomRenderingContext with all needed DirectX buffers and views that can be used to call RenderScene with custom RenderingContext. The created RenderingContext can be used in RenderScene(RenderingContext, Boolean) or RenderScene(RenderingContext, Boolean, Boolean, DXScene) methods.
Public methodCreateCustomRenderingContext(Texture2D, Texture2DDescription, RenderTargetView, DepthStencilView, Int32) Creates a CustomRenderingContext from the specified back buffer, its render target view and depthStencilView. The created CustomRenderingContext can be used in RenderScene(RenderingContext, Boolean) or RenderScene(RenderingContext, Boolean, Boolean, DXScene) methods.
Public methodCode exampleCreateCustomRenderingContext(Int32, Int32, Int32, Format, Format, BackBufferReadyEventHandler, DisposeList) Creates a CustomRenderingContext with all needed DirectX buffers and views that can be used to call RenderScene with custom RenderingContext. The created RenderingContext can be used in RenderScene(RenderingContext, Boolean) or RenderScene(RenderingContext, Boolean, Boolean, DXScene) methods.
Public methodCode exampleCreateCustomRenderingContext(Int32, Int32, Int32, Format, Format, BackBufferReadyEventHandler, VirtualRealityProviderBase, DisposeList) Creates a CustomRenderingContext with all needed DirectX buffers and views that can be used to call RenderScene with custom RenderingContext. The created RenderingContext can be used in RenderScene(RenderingContext, Boolean) or RenderScene(RenderingContext, Boolean, Boolean, DXScene) methods.
Public methodCode exampleCreateCustomRenderingContext(Int32, Int32, Int32, Int32, Format, Format, BackBufferReadyEventHandler, VirtualRealityProviderBase, DisposeList) Creates a CustomRenderingContext with all needed DirectX buffers and views that can be used to call RenderScene with custom RenderingContext. The created RenderingContext can be used in RenderScene(RenderingContext, Boolean) or RenderScene(RenderingContext, Boolean, Boolean, DXScene) methods.
Public methodCreateDefaultRenderingSteps CreateDefaultRenderingSteps clears the current rendering step (RenderingSteps) and adds the default rendering steps to the RenderingSteps list.
Public methodCreateSpriteBatch(String) Creates a SpriteBatch that will be used in this DXScene. The SpriteBatch will be added to the DefaultRenderSpritesRenderingStep rendering step. If this is the first sprite batch then the DefaultRenderSpritesRenderingStep is added to RenderingSteps.
Public methodCreateSpriteBatch(RenderSpritesRenderingStep, String) Creates a SpriteBatch that will be added to the specified RenderSpritesRenderingStep. When renderSpritesRenderingStep is not specified, then the created SpriteBatch is added to a the DefaultRenderSpritesRenderingStep rendering step (if this is the first sprite batch then the DefaultRenderSpritesRenderingStep is added to RenderingSteps).
Public methodDisposeBackBuffers Disposes the back buffers and views that are defined in this DXScene
Public methodDumpRenderingQueues Writes string that contains details about all objects inside rendering queues to the console (when the application is debugged in Visual Studio the string is written to Output window).
Public methodDumpRenderingSteps Writes string that contains details about all RenderingSteps in this DXScene to the console (when the application is debugged in Visual Studio the string is written to Output window).
Public methodDumpSceneNodes Writes string that contains details about all DXScene's SceneNodes and their hierarchy to the console (when the application is debugged in Visual Studio the string is written to Output window).
Public methodFindNode FindNode searches SceneNode hierarchy starting from RootNode and tries to find the SceneNode with the nodeName. Null is returned if SceneNode is not found.
Public methodGetAllHitObjects GetAllHitObjects method executes a hit testing on the SceneNodes in this DXScene (or when specified on rootSceneNode and its children) and returns a list of DXRayHitTestResult objects sorted from the closest to the farthest object. When no object is hit, an empty list is returned.
Public methodGetClosestHitObject GetClosestHitObject method executes a hit testing on the SceneNodes in this DXScene (or when specified on rootSceneNode and its children) and returns a DXRayHitTestResult object with the closest triangle hit by the specified ray. When no triangle is hit, null is returned.
Public methodGetHitSceneNodeBounds GetHitSceneNodeBounds returns a List of SceneNode objects where the ray intersects the BoundingBox of the SceneNode.
Public methodGetRayFromCamera Returns SharpDX.Ray that goes into a direction that is calculated from the specified x and y position in screen coordinates. For perspective camera the ray starts at the current camera position. The ray can be used for hit testing from the mouse position defined by x and y (relative to this DXScene object).
Public methodGetRayFromNearPlane Returns SharpDX.Ray that starts at the camera's near plane and goes into a direction that is calculated from the specified x and y position in screen coordinates. The ray can be used for hit testing from the mouse position defined by x and y (relative to this DXScene object).
Public methodGetRenderingQueuesDumpString(Boolean) Returns string that contains details about all objects inside rendering queues.
Public methodGetRenderingQueuesDumpString(Boolean, Boolean, Boolean) Returns string that contains details about all objects inside rendering queues.
Public methodGetRenderingStepsDumpString Returns string that contains details about all RenderingSteps in this DXScene.
Public methodGetSceneNodesDumpString(Boolean, Boolean, Boolean, Boolean) Returns string that contains details about all DXScene's SceneNodes and their hierarchy.
Public methodGetSceneNodesDumpString(Boolean, Boolean, Boolean, Boolean, Boolean, Boolean) Returns string that contains details about all DXScene's SceneNodes and their hierarchy.
Public methodGetShadowRenderingProviders Returns an array of shadow rendering providers that were initialized by calling InitializeShadowRendering(ShadowRenderingProviderBase) method. When no shadow rendering providers is initialized, then null is returned.
Public methodHandleDeviceRemoved HandleDeviceRemoved is called when a DirectX device is removed or reset. The method gets device removed reason from DirectX API and then calls the DeviceRemoved event handler. If the event handler handles the event, then the method returns. Otherwise the method throws an DXEngineException with description from specified message and device removed reason.
Public methodHasDirtyFlag Returns true if this DXScene has the flags from the method argument set. Note that if this value is checked before the Update phase is completed, then the value may not have the final value (but it has the camera and light changed flags already set).
Public methodHitTestSceneNode Returns DXRayHitTestResult if the specified ray hits the specified sceneNode. Otherwise null is returned. Child SceneNodes are not tested.
Public methodInitializeBackBuffer InitializeWithBackBuffer
Public methodInitializeDevice InitializeDevice is a virtual method that calls InitializeDevice on DXDevice if it was not yet initialized.
Public methodInitializeShadowRendering InitializeShadowRendering initializes shadow rendering by using the specified shadowRenderingProvider. This method can be called multiple times to register multiple shadow rendering providers. To get all initialized shadow rendering providers, call GetShadowRenderingProviders method. To remove shadow rendering provider, call RemoveShadowRenderingProvider(ShadowRenderingProviderBase) method.
Public methodInitializeSwapChain InitializeWithSwapChain
Public methodInitializeVirtualRealityRendering InitializeVirtualRealityRendering initializes virtual reality rendering with using the specified virtualRealityProvider. To dispose virtual reality rendering pass null as virtualRealityProvider parameter.
Public methodIsOnMainRenderThread Returns true when the code is currently executing on main render thread (the thread that was used to create this DXScene).
Public methodLogUserMessage LogUserLabel can be used to add custom user message to DXEngine log file. This method work only with debug DXEngine build and with enabled logging. It added the "USER MESSAGE: " prefix to log entry.
Public methodNotifyChange(DXSceneChangeNotifications) NotifyChange method adds the specified ChangeNotifications to all the changes flags
Public methodNotifyChange(DXSceneChangeNotifications, Object) NotifyChange method adds the specified ChangeNotifications to all the changes flags
Public methodRemoveRenderingQueue Adds the newRenderQueue before the already registered afterRenderQueue
Public methodRemoveShadowRenderingProvider Removes the shadow rendering provider that was initialized by calling InitializeShadowRendering(ShadowRenderingProviderBase) method. This will also disable (set IsEnabled to false) on the shadowRenderingProvider.
Public methodRemoveSpriteBatch(SpriteBatch) Removes the specified SpriteBatch from the list of sprite batches that are rendered by this DXScene. If this is the last SpriteBatch in the DefaultRenderSpritesRenderingStep, then it will be removed from the RenderingSteps.
Public methodRemoveSpriteBatch(SpriteBatch, RenderSpritesRenderingStep) Removes the specified SpriteBatch from the list of sprite batches that are rendered by the specified RenderSpritesRenderingStep.
Public methodRenderScene(Boolean) Renders the scene. If forceRenderAll is true, then the RenderingQueues are always regenerated and the scene is always rendered (use RenderScene(Boolean, Boolean) to control regeneration of rendering queues).
Public methodRenderScene(Boolean, Boolean) RenderScene rendered the scene. If forceRender is false then the scene is rendered only if there are any changes in the scene nodes. If forceUpdate is true then the RenderingQueues are always regenerated (otherwise RenderingQueues are regenerated only when this is required because of the changes).
Public methodRenderScene(RenderingContext, Boolean) Renders the scene with using custom RenderingContext. This allows rendering to custom buffers and render targets.
Public methodRenderScene(DXScene, Boolean, Boolean) Renders the scene to the back buffers and with using cameras defined in childDXScene.
Public methodCode exampleRenderToBitmap(Int32, Int32, Int32, BackBufferReadyEventHandler) RenderToBitmap renders the 3D scene to bitmap with specified width, height and multisampling count (used if possible). When the scene is rendered the renderedTextureReadyCallback delegate is called - here it is possible to read the memory with the rendered buffer.
Public methodCode exampleRenderToBitmap(Int32, Int32, Int32, Int32, BackBufferReadyEventHandler) RenderToBitmap renders the 3D scene to bitmap with specified width, height and multisampling count (used if possible). When the scene is rendered the renderedTextureReadyCallback delegate is called - here it is possible to read the memory with the rendered buffer.
Public methodResize(Int32, Int32) Resize method resizes the buffers needed to render the DXScene (DpiScale values are preserved; to change or set DpiScale, call overloaded method that takes DpiScale parameters)
Public methodResize(Int32, Int32, Single, Single) Resize method resizes the buffers needed to render the DXScene
Public methodResize(Int32, Int32, Int32, Single, Single) Resize method resizes the buffers needed to render the DXScene
Public methodSetupWaitingInBackgroundUntilRendered SetupWaitingInBackgroundUntilRendered method can be used to enable waiting in background until rendering is complete (this can be used for DirectXImage PresentationType where the DXEngine needs to notify WPF when the 3D scene is rendered; this is enabled by default - the DXViewportView.IsWaitingInBackgroundUntilRendered is set to true). In this case the rendering steps in DXEngine are completed before graphic card finishes rendering. When the rendering is complete the renderingCompleteAction is called from another thread. There the user can update the shared texture. When the renderingCompleteAction parameter is null, then waiting in background is disabled.
Public methodStatic memberTransformRay Transforms the specified ray with the specified matrix. The transformation is done with transforming the ray's position and its direction (direction is transformed without translation).
Public methodUpdate Update calls Update method on all child nodes.
Top
See Also