Related Links
Rendering Services

Overview

The rendering services enables external applications to render custom content into a Prepar3D 3D view. The rendering plugin system allows for custom DirectX® 11 rendering into textures or overlay onto a view using rendering plug-ins. The object rendering services provides a way to add custom objects such as lights to a 3d scene.

Classes

struct  PdkRenderFlags
 
struct  TextureDescriptionV440
 
class  IRenderingPluginSystemV400
 
class  IRenderingPluginSystemV430
 
class  IRenderDataV400
 
class  IRenderingPluginSystemV440
 
class  IRenderingPluginV400
 
class  IRenderDataV430
 
class  IObjectRendererV440
 
class  RenderingPlugin
 

Class Documentation

§ P3D::PdkRenderFlags

struct P3D::PdkRenderFlags

This class holds a set of flags that describe how the render data will be used during the Render() callback. These should be set using SetRenderFlags during the PreRender() callback.

Remarks
The IRenderDataV400 provided to the Render() call will only contain resources that were requested with these flags.

Public Member Functions

 PdkRenderFlags () noexcept
 

Public Attributes

bool RenderingIsEnabled: 1
 
bool WillWriteColor: 1
 
bool WillWriteDepthStencil: 1
 
bool WillReadColor: 1
 
bool WillReadDepthStencil: 1
 
bool WillModifyDeviceState: 1
 
bool Output8bpp: 1
 

Constructor & Destructor Documentation

§ PdkRenderFlags()

PdkRenderFlags ( )
inlinenoexcept

Member Data Documentation

§ Output8bpp

bool Output8bpp

§ RenderingIsEnabled

bool RenderingIsEnabled

If false, the Render() function will not be called

§ WillModifyDeviceState

bool WillModifyDeviceState

Set this to trun if any device/content states will be set by the render call.

§ WillReadColor

bool WillReadColor

If false, InputColor will not be provided

§ WillReadDepthStencil

bool WillReadDepthStencil

If false, InputDepthStencil will not be provided

§ WillWriteColor

bool WillWriteColor

If false, OutputColor will not be provided

§ WillWriteDepthStencil

bool WillWriteDepthStencil

If false, OutputDepthStencil will not be provided

§ P3D::TextureDescriptionV440

struct P3D::TextureDescriptionV440
Class Members
bool bFrameDependent
DXGI_FORMAT eFormat
IRenderingPluginV400 * pPlugin
const WCHAR * szName
unsigned int uHeight
unsigned int uWidth

§ P3D::IRenderingPluginSystemV400

class P3D::IRenderingPluginSystemV400

Inherits IUnknown.

Inherited by IRenderingPluginSystemV430.

Private Member Functions

virtual HRESULT CreateTexture (const WCHAR *name, unsigned int width, unsigned int height, IRenderingPluginV400 *plugin)=0
 
virtual HRESULT RemoveTexture (const WCHAR *name)=0
 
virtual HRESULT GetCreatedTextures (INameList &nameList)=0
 
virtual HRESULT CreateEffect (const WCHAR *name, IRenderingPluginV400 *plugin)=0
 
virtual HRESULT RemoveEffect (const WCHAR *name)=0
 
virtual HRESULT GetSystemEffects (INameList &names)=0
 

Member Function Documentation

§ CreateEffect()

virtual HRESULT CreateEffect ( const WCHAR *  name,
IRenderingPluginV400 plugin 
)
privatepure virtual

Create a new effect with given name and a callback function for each update

Parameters
nameName of Effect
pluginplugin that will be used to render the effect
Returns
HRESULT, ERR_NONE if function succeeds or ERR_FAIL if it fails

Implemented in IRenderingPluginSystemV440, and IRenderingPluginSystemV430.

§ CreateTexture()

virtual HRESULT CreateTexture ( const WCHAR *  name,
unsigned int  width,
unsigned int  height,
IRenderingPluginV400 plugin 
)
privatepure virtual

Create a new texture given name, size, and a callback function for each update

Parameters
nameName of texture. Models and gauges can map to this texture by name.
widthWidth of texture in pixels
heightHeight of texture in pixels
pluginplugin that will be used to render into the texture
Returns
HRESULT, S_OK if function succeeds or E_FAIL if it fails

Implemented in IRenderingPluginSystemV440, and IRenderingPluginSystemV430.

§ GetCreatedTextures()

virtual HRESULT GetCreatedTextures ( INameList nameList)
privatepure virtual

Get list of textures created externally

Parameters
[out]nameListlist of names of all plugins

Implemented in IRenderingPluginSystemV440, and IRenderingPluginSystemV430.

§ GetSystemEffects()

virtual HRESULT GetSystemEffects ( INameList names)
privatepure virtual

List of effects provided by the system

Parameters
[out]nameslist of names of effects provided by the system
Returns
HRESULT, ERR_NONE if function succeeds or ERR_FAIL if it fails

Implemented in IRenderingPluginSystemV440, and IRenderingPluginSystemV430.

§ RemoveEffect()

virtual HRESULT RemoveEffect ( const WCHAR *  name)
privatepure virtual

Remove an effect with given name that was created externally

Parameters
nameName of Effect
Returns
HRESULT, ERR_NONE if function succeeds or ERR_FAIL if it fails

Implemented in IRenderingPluginSystemV440, and IRenderingPluginSystemV430.

§ RemoveTexture()

virtual HRESULT RemoveTexture ( const WCHAR *  name)
privatepure virtual

Remove a texture given the texture name

Parameters
nameName of plugin
Returns
HRESULT, ERR_NONE if function succeeds or ERR_FAIL if it fails

Implemented in IRenderingPluginSystemV440, and IRenderingPluginSystemV430.

§ P3D::IRenderingPluginSystemV430

class P3D::IRenderingPluginSystemV430

Plugin service used to register custom rendering plugins. These plugins can be used to render into a texture, or to render on top of an existing view. If requested, a plugin can also read from the current view output allowing it to implement post process effects that are too complex to be implemented through the xml/hlsl based custom post process system.

Inherits IRenderingPluginSystemV400.

Inherited by IRenderingPluginSystemV440.

Private Member Functions

virtual HRESULT CreateTexture (const WCHAR *name, unsigned int width, unsigned int height, IRenderingPluginV400 *plugin)=0
 
virtual HRESULT RemoveTexture (const WCHAR *name)=0
 
virtual HRESULT GetCreatedTextures (INameList &nameList)=0
 
virtual HRESULT CreateEffect (const WCHAR *name, IRenderingPluginV400 *plugin)=0
 
virtual HRESULT RemoveEffect (const WCHAR *name)=0
 
virtual HRESULT GetSystemEffects (INameList &names)=0
 
virtual HRESULT GetDeviceWindow (UINT uAdapterID, HWND &hWindow)=0
 

Member Function Documentation

§ CreateEffect()

virtual HRESULT CreateEffect ( const WCHAR *  name,
IRenderingPluginV400 plugin 
)
privatepure virtual

Create a new effect with given name and a callback function for each update

Parameters
nameName of Effect
pluginplugin that will be used to render the effect
Returns
HRESULT, ERR_NONE if function succeeds or ERR_FAIL if it fails

Implements IRenderingPluginSystemV400.

Implemented in IRenderingPluginSystemV440.

§ CreateTexture()

virtual HRESULT CreateTexture ( const WCHAR *  name,
unsigned int  width,
unsigned int  height,
IRenderingPluginV400 plugin 
)
privatepure virtual

Create a new texture given name, size, and a callback function for each update

Parameters
nameName of texture. Models and gauges can map to this texture by name.
widthWidth of texture in pixels
heightHeight of texture in pixels
pluginplugin that will be used to render into the texture
Returns
HRESULT, S_OK if function succeeds or E_FAIL if it fails

Implements IRenderingPluginSystemV400.

Implemented in IRenderingPluginSystemV440.

§ GetCreatedTextures()

virtual HRESULT GetCreatedTextures ( INameList nameList)
privatepure virtual

Get list of textures created externally

Parameters
[out]nameListlist of names of all plugins

Implements IRenderingPluginSystemV400.

Implemented in IRenderingPluginSystemV440.

§ GetDeviceWindow()

virtual HRESULT GetDeviceWindow ( UINT  uAdapterID,
HWND &  hWindow 
)
privatepure virtual

Get a Win32 HWND by adapter ID. This provides a window associated with a specific GPU using the AdapterID provided by IRenderData.

Parameters
uAdapterIDAdapter ID for a GPU
[out]hWindowReference to an HWND window handle
Returns
HRESULT, ERR_NONE if function succeeds or ERR_FAIL if it fails

Implemented in IRenderingPluginSystemV440.

§ GetSystemEffects()

virtual HRESULT GetSystemEffects ( INameList names)
privatepure virtual

List of effects provided by the system

Parameters
[out]nameslist of names of effects provided by the system
Returns
HRESULT, ERR_NONE if function succeeds or ERR_FAIL if it fails

Implements IRenderingPluginSystemV400.

Implemented in IRenderingPluginSystemV440.

§ RemoveEffect()

virtual HRESULT RemoveEffect ( const WCHAR *  name)
privatepure virtual

Remove an effect with given name that was created externally

Parameters
nameName of Effect
Returns
HRESULT, ERR_NONE if function succeeds or ERR_FAIL if it fails

Implements IRenderingPluginSystemV400.

Implemented in IRenderingPluginSystemV440.

§ RemoveTexture()

virtual HRESULT RemoveTexture ( const WCHAR *  name)
privatepure virtual

Remove a texture given the texture name

Parameters
nameName of plugin
Returns
HRESULT, ERR_NONE if function succeeds or ERR_FAIL if it fails

Implements IRenderingPluginSystemV400.

Implemented in IRenderingPluginSystemV440.

§ P3D::IRenderDataV400

class P3D::IRenderDataV400

Inherits IUnknown.

Inherited by IRenderDataV430.

Private Member Functions

virtual FLOAT GetTextureWidth ()=0
 
virtual FLOAT GetTextureHeight ()=0
 
virtual UINT GetAdapterID ()=0
 
virtual ID3D11Device * GetDevice () override
 
virtual ID3D11RenderTargetView * GetOutputColor () override
 
virtual ID3D11DepthStencilView * GetOutputDepthStencil () override
 
virtual ID3D11ShaderResourceView * GetInputColor () override
 
virtual ID3D11ShaderResourceView * GetInputDepthStencil () override
 
virtual ID3D11ShaderResourceView * GetTexture (const char *name) override
 
virtual IWindowV400 * GetWindow () override
 
virtual ICameraSystemV400 * GetCamera () override
 
virtual PdkRenderFlags GetRenderFlags () override
 
virtual void SetRenderFlags (PdkRenderFlags flags) override
 
virtual PdkRenderPass GetRenderPass () override
 

Member Function Documentation

§ GetAdapterID()

virtual UINT GetAdapterID ( )
privatepure virtual

Get Adapter id

Returns
Current Adapter of RenderData

Implemented in IRenderDataV430.

§ GetCamera()

virtual ICameraSystemV400* GetCamera ( )
privatepure virtual

Get Camera

Returns
Camera used for rendering

Implemented in IRenderDataV430.

§ GetDevice()

virtual ID3D11Device* GetDevice ( )
privatepure virtual

Get Device

Returns
D3D11 device.

Implemented in IRenderDataV430.

§ GetInputColor()

virtual ID3D11ShaderResourceView* GetInputColor ( )
privatepure virtual

Get input color

Returns
input color shader resource view.
Remarks
Must set WillReadColor render flag to true in PreRender to use this

Implemented in IRenderDataV430.

§ GetInputDepthStencil()

virtual ID3D11ShaderResourceView* GetInputDepthStencil ( )
privatepure virtual

Get Input Depth Stencil

Returns
Input depth stencil as shader resource view.
Remarks
Must set WillReadDepthStencil render flag to true in PreRender to use this

Implemented in IRenderDataV430.

§ GetOutputColor()

virtual ID3D11RenderTargetView* GetOutputColor ( )
privatepure virtual

Get Output Color

Returns
Ouput color render target view.
Remarks
Must set WillWriteColor render flag to true in PreRender to use this

Implemented in IRenderDataV430.

§ GetOutputDepthStencil()

virtual ID3D11DepthStencilView* GetOutputDepthStencil ( )
privatepure virtual

Get Output Depth Stencil

Returns
Ouput depth stencil view.
Remarks
Must set WillWriteDepthStencil render flag to true in PreRender to use this

Implemented in IRenderDataV430.

§ GetRenderFlags()

virtual PdkRenderFlags GetRenderFlags ( )
privatepure virtual

Get PdkRenderFlags

Returns
PdkRenderFlags

Implemented in IRenderDataV430.

§ GetRenderPass()

virtual PdkRenderPass GetRenderPass ( )
privatepure virtual

Get Render Pass

Returns
Current render pass.

Implemented in IRenderDataV430.

§ GetTexture()

virtual ID3D11ShaderResourceView* GetTexture ( const char *  name)
privatepure virtual

Get texture by name

Parameters
namename of texture
Returns
shader resource view of texture

Implemented in IRenderDataV430.

§ GetTextureHeight()

virtual FLOAT GetTextureHeight ( )
privatepure virtual

Get Texture height

Returns
Texture height in pixels

Implemented in IRenderDataV430.

§ GetTextureWidth()

virtual FLOAT GetTextureWidth ( )
privatepure virtual

Get Texture width

Returns
Texture width in pixels

Implemented in IRenderDataV430.

§ GetWindow()

virtual IWindowV400* GetWindow ( )
privatepure virtual

Get Window

Returns
Window used for rendering

Implemented in IRenderDataV430.

§ SetRenderFlags()

virtual void SetRenderFlags ( PdkRenderFlags  flags)
privatepure virtual

Set PdkRenderFlags. This must be called from PreRender() for Render() to work properly.

Parameters
flagsrender flags associated with the current window and render pass

Implemented in IRenderDataV430.

§ P3D::IRenderingPluginSystemV440

class P3D::IRenderingPluginSystemV440

Plugin service used to register custom rendering plugins. These plugins can be used to render into a texture, or to render on top of an existing view. If requested, a plugin can also read from the current view output allowing it to implement post process effects that are too complex to be implemented through the xml/hlsl based custom post process system.

Inherits IRenderingPluginSystemV430.

Private Member Functions

virtual HRESULT CreateTexture (const WCHAR *name, unsigned int width, unsigned int height, IRenderingPluginV400 *plugin)=0
 
virtual HRESULT RemoveTexture (const WCHAR *name)=0
 
virtual HRESULT GetCreatedTextures (INameList &nameList)=0
 
virtual HRESULT CreateEffect (const WCHAR *name, IRenderingPluginV400 *plugin)=0
 
virtual HRESULT RemoveEffect (const WCHAR *name)=0
 
virtual HRESULT GetSystemEffects (INameList &names)=0
 
virtual HRESULT GetDeviceWindow (UINT uAdapterID, HWND &hWindow)=0
 
virtual HRESULT CreateTexture (const TextureDescriptionV440 &textureDesc)=0
 
virtual UINT GetAFRGroup ()=0
 
virtual bool IsMultiProjectionEnabled ()=0
 
virtual void SetMultiProjectionEnabled (bool bEnabled)=0
 

Member Function Documentation

§ CreateEffect()

virtual HRESULT CreateEffect ( const WCHAR *  name,
IRenderingPluginV400 plugin 
)
privatepure virtual

Create a new effect with given name and a callback function for each update

Parameters
nameName of Effect
pluginplugin that will be used to render the effect
Returns
HRESULT, ERR_NONE if function succeeds or ERR_FAIL if it fails

Implements IRenderingPluginSystemV430.

§ CreateTexture() [1/2]

virtual HRESULT CreateTexture ( const WCHAR *  name,
unsigned int  width,
unsigned int  height,
IRenderingPluginV400 plugin 
)
privatepure virtual

Create a new texture given name, size, and a callback function for each update

Parameters
nameName of texture. Models and gauges can map to this texture by name.
widthWidth of texture in pixels
heightHeight of texture in pixels
pluginplugin that will be used to render into the texture
Returns
HRESULT, S_OK if function succeeds or E_FAIL if it fails

Implements IRenderingPluginSystemV430.

§ CreateTexture() [2/2]

virtual HRESULT CreateTexture ( const TextureDescriptionV440 textureDesc)
privatepure virtual

Create a new texture given name, size, and a callback function for each update

Parameters
textureDescdescrition of the texture to be created
Returns
HRESULT, S_OK if function succeeds or E_FAIL if it fails

§ GetAFRGroup()

virtual UINT GetAFRGroup ( )
privatepure virtual

Get alternate frame rendering (AFR) group index. When using SLI, this value indicates which GPU is in use. some rendering plugins may need this information to keep resources synchronized

Returns
UINT, index of current alternate frame rendering group

§ GetCreatedTextures()

virtual HRESULT GetCreatedTextures ( INameList nameList)
privatepure virtual

Get list of textures created externally

Parameters
[out]nameListlist of names of all plugins

Implements IRenderingPluginSystemV430.

§ GetDeviceWindow()

virtual HRESULT GetDeviceWindow ( UINT  uAdapterID,
HWND &  hWindow 
)
privatepure virtual

Get a Win32 HWND by adapter ID. This provides a window associated with a specific GPU using the AdapterID provided by IRenderData.

Parameters
uAdapterIDAdapter ID for a GPU
[out]hWindowReference to an HWND window handle
Returns
HRESULT, ERR_NONE if function succeeds or ERR_FAIL if it fails

Implements IRenderingPluginSystemV430.

§ GetSystemEffects()

virtual HRESULT GetSystemEffects ( INameList names)
privatepure virtual

List of effects provided by the system

Parameters
[out]nameslist of names of effects provided by the system
Returns
HRESULT, ERR_NONE if function succeeds or ERR_FAIL if it fails

Implements IRenderingPluginSystemV430.

§ IsMultiProjectionEnabled()

virtual bool IsMultiProjectionEnabled ( )
privatepure virtual

Is multi-project enabled. This is used for SinglePass VR

Returns
bool, true if multi-projection is enabled

§ RemoveEffect()

virtual HRESULT RemoveEffect ( const WCHAR *  name)
privatepure virtual

Remove an effect with given name that was created externally

Parameters
nameName of Effect
Returns
HRESULT, ERR_NONE if function succeeds or ERR_FAIL if it fails

Implements IRenderingPluginSystemV430.

§ RemoveTexture()

virtual HRESULT RemoveTexture ( const WCHAR *  name)
privatepure virtual

Remove a texture given the texture name

Parameters
nameName of plugin
Returns
HRESULT, ERR_NONE if function succeeds or ERR_FAIL if it fails

Implements IRenderingPluginSystemV430.

§ SetMultiProjectionEnabled()

virtual void SetMultiProjectionEnabled ( bool  bEnabled)
privatepure virtual

Set multi-project enabled. Do this to enable Single-Pass for custom VR plugin creation

Returns
bool, true if multi-projection is enabled

§ P3D::IRenderingPluginV400

class P3D::IRenderingPluginV400

Rendering plugin interface used to implement texture and effect plugins. These plugins can be used to render into a texture, or to render on top of an existing view. If requested, a plugin can also read from the current view output allowing it to implement post process effects that are too complex to be implemented through the xml/hlsl based custom post process system.

Inherits IUnknown.

Inherited by RenderingPlugin, and WindowRenderingPlugin.

Private Member Functions

virtual void Render (IRenderDataV400 *pRenderData) override
 
virtual void PreRender (IRenderDataV400 *pRenderData) override
 

Member Function Documentation

§ PreRender()

virtual void PreRender ( IRenderDataV400 pRenderData)
privatepure virtual

Called before calling Render. This function should call pRenderData->SetRenderFlags() to let the plugin system know what resources in the render data will be read or written.

Implemented in WindowRenderingPlugin, and RenderingPlugin.

§ Render()

virtual void Render ( IRenderDataV400 pRenderData)
privatepure virtual

A callback to render content

Parameters
pRenderDataInterface to rendering device and resources used for rendering.
Remarks
Render will be called during each rendering pass unless the RenderingIsEnabled flag is set to false in PreRender.

Implemented in WindowRenderingPlugin, and RenderingPlugin.

§ P3D::IRenderDataV430

class P3D::IRenderDataV430

Inherits IRenderDataV400.

Private Member Functions

virtual FLOAT GetTextureWidth ()=0
 
virtual FLOAT GetTextureHeight ()=0
 
virtual UINT GetAdapterID ()=0
 
virtual ID3D11Device * GetDevice () override
 
virtual ID3D11RenderTargetView * GetOutputColor () override
 
virtual ID3D11DepthStencilView * GetOutputDepthStencil () override
 
virtual ID3D11ShaderResourceView * GetInputColor () override
 
virtual ID3D11ShaderResourceView * GetInputDepthStencil () override
 
virtual ID3D11ShaderResourceView * GetInputStencil () override
 
virtual ID3D11ShaderResourceView * GetTexture (const char *name) override
 
virtual IWindowV400 * GetWindow () override
 
virtual ICameraSystemV400 * GetCamera () override
 
virtual PdkRenderFlags GetRenderFlags () override
 
virtual void SetRenderFlags (PdkRenderFlags flags) override
 
virtual PdkRenderPass GetRenderPass () override
 

Member Function Documentation

§ GetAdapterID()

virtual UINT GetAdapterID ( )
privatepure virtual

Get Adapter id

Returns
Current Adapter of RenderData

Implements IRenderDataV400.

§ GetCamera()

virtual ICameraSystemV400* GetCamera ( )
privatepure virtual

Get Camera

Returns
Camera used for rendering

Implements IRenderDataV400.

§ GetDevice()

virtual ID3D11Device* GetDevice ( )
privatepure virtual

Get Device

Returns
D3D11 device.

Implements IRenderDataV400.

§ GetInputColor()

virtual ID3D11ShaderResourceView* GetInputColor ( )
privatepure virtual

Get input color

Returns
input color shader resource view.
Remarks
Must set WillReadColor render flag to true in PreRender to use this

Implements IRenderDataV400.

§ GetInputDepthStencil()

virtual ID3D11ShaderResourceView* GetInputDepthStencil ( )
privatepure virtual

Get Input Depth Stencil

Returns
Input depth stencil as shader resource view.
Remarks
Must set WillReadDepthStencil render flag to true in PreRender to use this

Implements IRenderDataV400.

§ GetInputStencil()

virtual ID3D11ShaderResourceView* GetInputStencil ( )
privatepure virtual

Get Input Stencil

Returns
Input stencil as shader resource view.
Remarks
Will be provided only for RenderPassPreVc.
Stencil available through green channel as uint.

§ GetOutputColor()

virtual ID3D11RenderTargetView* GetOutputColor ( )
privatepure virtual

Get Output Color

Returns
Ouput color render target view.
Remarks
Must set WillWriteColor render flag to true in PreRender to use this

Implements IRenderDataV400.

§ GetOutputDepthStencil()

virtual ID3D11DepthStencilView* GetOutputDepthStencil ( )
privatepure virtual

Get Output Depth Stencil

Returns
Ouput depth stencil view.
Remarks
Must set WillWriteDepthStencil render flag to true in PreRender to use this

Implements IRenderDataV400.

§ GetRenderFlags()

virtual PdkRenderFlags GetRenderFlags ( )
privatepure virtual

§ GetRenderPass()

virtual PdkRenderPass GetRenderPass ( )
privatepure virtual

Get Render Pass

Returns
Current render pass.

Implements IRenderDataV400.

§ GetTexture()

virtual ID3D11ShaderResourceView* GetTexture ( const char *  name)
privatepure virtual

Get texture by name

Parameters
namename of texture
Returns
shader resource view of texture

Implements IRenderDataV400.

§ GetTextureHeight()

virtual FLOAT GetTextureHeight ( )
privatepure virtual

Get Texture height

Returns
Texture height in pixels

Implements IRenderDataV400.

§ GetTextureWidth()

virtual FLOAT GetTextureWidth ( )
privatepure virtual

Get Texture width

Returns
Texture width in pixels

Implements IRenderDataV400.

§ GetWindow()

virtual IWindowV400* GetWindow ( )
privatepure virtual

Get Window

Returns
Window used for rendering

Implements IRenderDataV400.

§ SetRenderFlags()

virtual void SetRenderFlags ( PdkRenderFlags  flags)
privatepure virtual

Set PdkRenderFlags. This must be called from PreRender() for Render() to work properly.

Parameters
flagsrender flags associated with the current window and render pass

Implements IRenderDataV400.

§ IObjectRendererV440

class IObjectRendererV440

Service for rendering into a view

Inherits IObjectRendererV400.

Private Member Functions

virtual HRESULT DrawSphere (const ObjectWorldTransform &location, float radius, ARGBColor color, RenderFlags renderFlags=0) override
 
virtual HRESULT DrawCylinder (const ObjectWorldTransform &location, float radius, float height, ARGBColor color, RenderFlags renderFlags=0) override
 
virtual HRESULT DrawLine (const LLADegreesMeters &startLocation, const LLADegreesMeters &endLocation, float width, float height, ARGBColor color, RenderFlags renderFlags=0) override
 
virtual HRESULT DrawRectangle (const ObjectWorldTransform &location, float width, float height, float depth, ARGBColor color, RenderFlags renderFlags=0) override
 
virtual HRESULT DrawTriangle (const ObjectWorldTransform &location, float width, float height, float depth, ARGBColor color, RenderFlags renderFlags=0) override
 
virtual HRESULT DrawText2D (int x, int y, LPCWSTR szText, ARGBColor textColor, TextDescription &textDescription, RenderFlags renderFlags) override
 
virtual HRESULT DrawText3D (const ObjectWorldTransform &location, LPCWSTR szText, ARGBColor textColor, TextDescription &textDescription, RenderFlags renderFlags) override
 
virtual HRESULT AddLight (float x, float y, float z, unsigned int lightType, unsigned int color, float size, float range, bool bAttenuateByAmbient) override
 
virtual HRESULT BeginLightGroup (ObjectWorldTransform &groupOrigin) override
 
virtual HRESULT EndLightGroup (bool sortGroup) override
 
virtual void ApplyBodyRelativeOffset (const ObjectWorldTransform &llapbhAtOrigin, const ObjectLocalTransform &offsetXyzPbh, ObjectWorldTransform &llapbhAtOffset) override
 
virtual void CalculateBodyRelativeOffset (const ObjectWorldTransform &llapbhAtOrigin, const ObjectWorldTransform &llapbhAtOffset, ObjectLocalTransform &offsetXyzPbh) override
 

Member Function Documentation

§ AddLight()

virtual HRESULT AddLight ( float  x,
float  y,
float  z,
unsigned int  lightType,
unsigned int  color,
float  size,
float  range,
bool  bAttenuateByAmbient 
)
privatepure virtual

Add a light to the group

Parameters
xx offset in meters from light group origin
yy offset in meters from light group origin
zz offset in meters from light group origin
lightTypeLight type
colorLight color
sizeSize of light
rangeDistance at which light should be visible
bAttenuateByAmbientAttenuate light based on ambient light in the scene

§ ApplyBodyRelativeOffset()

virtual void ApplyBodyRelativeOffset ( const ObjectWorldTransform llapbhAtOrigin,
const ObjectLocalTransform offsetXyzPbh,
ObjectWorldTransform llapbhAtOffset 
)
privatepure virtual

Apply body relative local transformation to a world transform

Parameters
llapbhAtOriginWorld transformation of origin or base object
offsetXyzPbhLocal body relative transformation to apply as an offset
llapbhAtOffsetWorld transformation rusting from applying the body relative offset

§ BeginLightGroup()

virtual HRESULT BeginLightGroup ( ObjectWorldTransform groupOrigin)
privatepure virtual

Begin a light group with a world transform as its origin

Parameters
groupOriginAll lights in the group will be offset relative to this coordinate transformation

§ CalculateBodyRelativeOffset()

virtual void CalculateBodyRelativeOffset ( const ObjectWorldTransform llapbhAtOrigin,
const ObjectWorldTransform llapbhAtOffset,
ObjectLocalTransform offsetXyzPbh 
)
privatepure virtual

Calculate body relative offset between two world transforms

Parameters
llapbhAtOriginWorld transformation of the origin or base object
llapbhAtOffsetWorld transformation to use as a reference for calculating the offset
offsetXyzPbhBody-relative offset needed to base from the base transform to the reference transform

§ DrawCylinder()

virtual HRESULT DrawCylinder ( const ObjectWorldTransform location,
float  radius,
float  height,
ARGBColor  color,
RenderFlags  renderFlags = 0 
)
privatepure virtual

Draw a cylinder

Parameters
locationLocation the object will be drawn
radiusRadius of the object in meters
heightHeight of the object in meters
colorColor of the object
RenderFlagsRender flags to control drawing

§ DrawLine()

virtual HRESULT DrawLine ( const LLADegreesMeters startLocation,
const LLADegreesMeters endLocation,
float  width,
float  height,
ARGBColor  color,
RenderFlags  renderFlags = 0 
)
privatepure virtual

Draw a line represented by a rectangular prism

Parameters
startLocationStart location the object will be drawn
endLocationEnd location the object will be drawn
widthWidth of the object in meters
heightHeight of the object in meters
colorColor of the object
RenderFlagsRender flags to control drawing

§ DrawRectangle()

virtual HRESULT DrawRectangle ( const ObjectWorldTransform location,
float  width,
float  height,
float  depth,
ARGBColor  color,
RenderFlags  renderFlags = 0 
)
privatepure virtual

Draw a rectangular prism

Parameters
locationLocation the object will be drawn
widthWidth of the object in meters
heightHeight of the object in meters
depthDepth of the object in meters
colorColor of the object
RenderFlagsRender flags to control drawing

§ DrawSphere()

virtual HRESULT DrawSphere ( const ObjectWorldTransform location,
float  radius,
ARGBColor  color,
RenderFlags  renderFlags = 0 
)
privatepure virtual

Draw a sphere

Parameters
locationLocation the object will be drawn
radiusRadius of the object in meters
colorColor of the object
RenderFlagsRender flags to control drawing

§ DrawText2D()

virtual HRESULT DrawText2D ( int  x,
int  y,
LPCWSTR  szText,
ARGBColor  textColor,
TextDescription textDescription,
RenderFlags  renderFlags 
)
privatepure virtual

Draws text in screen space starting from the top-left with positive directions right and down.

Parameters
xText location in pixels in the x direction
yText location in pixels in the y direction
szTextUnicode text string to display
textColorText color
textDescriptionText description (i.e. font, alignment, additional flags)
renderFlagsRender flags to control drawing

§ DrawText3D()

virtual HRESULT DrawText3D ( const ObjectWorldTransform location,
LPCWSTR  szText,
ARGBColor  textColor,
TextDescription textDescription,
RenderFlags  renderFlags 
)
privatepure virtual

Draws text in 3D world space or screen space

Parameters
locationText location (lla and pbh). The text bounding box will be placed at this point.
szTextUnicode text string to display
textColorText color
textDescriptionText description (i.e. font, alignment, additional flags)
renderFlagsRender flags to control drawing

§ DrawTriangle()

virtual HRESULT DrawTriangle ( const ObjectWorldTransform location,
float  width,
float  height,
float  depth,
ARGBColor  color,
RenderFlags  renderFlags = 0 
)
privatepure virtual

Draw a trianglular prism

Parameters
locationLocation the object will be drawn
widthWidth of the object in meters
heightHeight of the object in meters
depthDepth of the object in meters
colorColor of the object
RenderFlagsRender flags to control drawing

§ EndLightGroup()

virtual HRESULT EndLightGroup ( bool  sortGroup)
privatepure virtual

End a light group.

Parameters
sortGroupIf true, this group of lights will be sorted with other transparent objects in the scene. Lights placed up on poles or attached to aircraft should be sorted. Lights placed on the ground generally do not need to be sorted. Unsorted groups are combined into a single draw call for better rendering performance.

§ P3D::RenderingPlugin

class P3D::RenderingPlugin

Base implementation of the IRenderingPluginV400 which defines default implementations of all IRenderingPluginV400 functions and a default IUnknown implementation.

Inherits IRenderingPluginV400.

Public Member Functions

 RenderingPlugin () noexcept
 
virtual ~RenderingPlugin ()
 
virtual void PreRender (IRenderDataV400 *pRenderData)
 
virtual void Render (IRenderDataV400 *pRenderData) override
 

Protected Attributes

PdkRenderFlags mRenderFlags
 

Constructor & Destructor Documentation

§ RenderingPlugin()

RenderingPlugin ( )
inlinenoexcept

§ ~RenderingPlugin()

virtual ~RenderingPlugin ( )
inlinevirtual

Member Function Documentation

§ PreRender()

virtual void PreRender ( IRenderDataV400 pRenderData)
inlinevirtual

Enables rendering if the current render pass is RenderPassDefault

Implements IRenderingPluginV400.

§ Render()

virtual void Render ( IRenderDataV400 pRenderData)
pure virtual

A callback to render content

Parameters
pRenderDataInterface to rendering device and resources used for rendering.
Remarks
Render will be called during each rendering pass unless the RenderingIsEnabled flag is set to false in PreRender.

Implements IRenderingPluginV400.

Member Data Documentation

§ mRenderFlags

PdkRenderFlags mRenderFlags
protected

Macros

#define RS_IPLUGIN_SYSTEM_LEGACY_H
 

Typedefs

typedef IRenderDataV430 IRenderData
 
typedef IRenderingPluginV400 IRenderingPlugin
 
typedef IRenderingPluginSystemV440 IRenderingPluginSystem
 

Enumerations

enum  PdkRenderPass { RenderPassPreVc = 0, RenderPassPreVcPanels, RenderPassDefault, RenderPassPreScene }
 

Variables

REFIID IID_IRenderingPluginSystemV400 = __uuidof(IRenderingPluginSystemV400)
 
REFIID IID_IRenderingPluginSystemV430 = __uuidof(IRenderingPluginSystemV430)
 
REFIID IID_IRenderDataV400 = __uuidof(IRenderDataV400)
 
REFIID IID_IRenderingPluginSystemV440 = __uuidof(IRenderingPluginSystemV440)
 
REFGUID SID_RenderingPluginSystem = __uuidof(IRenderingPluginSystemV400)
 
REFIID IID_IRenderingPluginV400 = __uuidof(IRenderingPluginV400)
 
REFIID IID_IRenderDataV430 = __uuidof(IRenderDataV430)
 
REFIID IID_IRenderingPlugin = IID_IRenderingPluginV400
 
REFIID IID_IRenderData = IID_IRenderDataV430
 
REFIID IID_IRenderingPluginSystem = IID_IRenderingPluginSystemV440
 
REFIID IID_IObjectRendererV440 = __uuidof(IObjectRendererV440)
 
REFIID SID_ObjectRenderer = IID_IObjectRendererV400
 

Macro Definition Documentation

§ RS_IPLUGIN_SYSTEM_LEGACY_H

#define RS_IPLUGIN_SYSTEM_LEGACY_H

Typedef Documentation

§ IRenderData

§ IRenderingPlugin

§ IRenderingPluginSystem

Enumeration Type Documentation

§ PdkRenderPass

Enumerator
RenderPassPreVc 
RenderPassPreVcPanels 
RenderPassDefault 
RenderPassPreScene 

Variable Documentation

§ IID_IObjectRendererV440

REFIID IID_IObjectRendererV440 = __uuidof(IObjectRendererV440)

§ IID_IRenderData

REFIID IID_IRenderData = IID_IRenderDataV430

§ IID_IRenderDataV400

REFIID IID_IRenderDataV400 = __uuidof(IRenderDataV400)

§ IID_IRenderDataV430

REFIID IID_IRenderDataV430 = __uuidof(IRenderDataV430)

§ IID_IRenderingPlugin

REFIID IID_IRenderingPlugin = IID_IRenderingPluginV400

§ IID_IRenderingPluginSystem

REFIID IID_IRenderingPluginSystem = IID_IRenderingPluginSystemV440

§ IID_IRenderingPluginSystemV400

REFIID IID_IRenderingPluginSystemV400 = __uuidof(IRenderingPluginSystemV400)

§ IID_IRenderingPluginSystemV430

REFIID IID_IRenderingPluginSystemV430 = __uuidof(IRenderingPluginSystemV430)

§ IID_IRenderingPluginSystemV440

REFIID IID_IRenderingPluginSystemV440 = __uuidof(IRenderingPluginSystemV440)

§ IID_IRenderingPluginV400

REFIID IID_IRenderingPluginV400 = __uuidof(IRenderingPluginV400)

§ SID_ObjectRenderer

REFIID SID_ObjectRenderer = IID_IObjectRendererV400

§ SID_RenderingPluginSystem

REFGUID SID_RenderingPluginSystem = __uuidof(IRenderingPluginSystemV400)