Annwvyn::AnnOgreVRRenderer Class Referenceabstract

Abstract class for VR Renderers. Serve as interface between Annwvyn, and "OgreHMDRender" object. More...

#include <AnnOgreVRRenderer.hpp>

Inheritance diagram for Annwvyn::AnnOgreVRRenderer:
Collaboration diagram for Annwvyn::AnnOgreVRRenderer:

Public Types

enum  compositorIndex : size_t { leftEyeCompositor = 0, rightEyeCompositor = 1, monoCompositor = 2, nbCompositor = 3 }
 Indexes of the compositor workspace. More...
 
enum  ShadowFiltering { ShadowFiltering::low, ShadowFiltering::medium, ShadowFiltering::high }
 Liist of the levels of shadow filtering available. More...
 
enum  DebugMode { RAW_BUFFER, HMD_MIRROR, MONOSCOPIC }
 Type of Debug render you can do. More...
 
using combinedTextureSizeArray = std::array< std::array< unsigned int, 2 >, 2 >
 

Public Member Functions

void setShadowFiltering (ShadowFiltering level) const
 Set the shadow filtering level (quality) More...
 
 AnnOgreVRRenderer (const std::string &windowName)
 Construct VR Renderer. More...
 
virtual ~AnnOgreVRRenderer ()
 Destruct VR Renderer. More...
 
Ogre::SceneManager * getSceneManager () const
 Get the scene manager of the virtual world. More...
 
Ogre::Root * getRoot () const
 Get the Ogre::Root object. More...
 
Ogre::RenderWindow * getWindow () const
 Get the RenderWidow that should display a debug render the VR view. More...
 
Ogre::SceneNode * getCameraInformationNode () const
 Get the node that is the player's head anchor point. More...
 
Ogre::Timer * getTimer () const
 Get Ogre's internal timer. More...
 
double getUpdateTime () const
 Get frame update time from the VR renderer. More...
 
void getOgreConfig () const
 Configure the Ogre root engine. Will load all the ogre Plug-ins and components we need. More...
 
void initOgreRoot (const std::string &loggerName)
 
virtual void initPipeline () final
 Init the VR rendering pipeline. More...
 
virtual void initVrHmd ()=0
 Init the VR client library. More...
 
virtual void initScene ()=0
 Create the scene(s) manager(s) needed for the rendering. More...
 
virtual void initCameras ()
 Create the pair of cameras for the stereo render;. More...
 
virtual void initRttRendering ()=0
 Initialize the Render To Texture rendering. More...
 
virtual void initClientHmdRendering ()=0
 Init the VR client rendering. More...
 
virtual bool shouldQuit ()=0
 If true, you should cleanly quit the program from now. More...
 
virtual bool shouldRecenter ()=0
 If true you should use the current position as the new center of tracking. More...
 
virtual bool isVisibleInHmd ()=0
 If true, the user can see the VR render inside his HMD. More...
 
virtual void updateTracking () final
 Refresh and update the head tracking. May tell the VR client library to prepare for new frame. More...
 
virtual void getTrackingPoseAndVRTiming ()=0
 Get tracking from the VR system. More...
 
virtual void renderAndSubmitFrame ()=0
 Render frame internally inside Ogre, and submit it to the VR client. More...
 
virtual void recenter ()=0
 Put the current position as the center of tracking. More...
 
virtual void cycleDebugHud ()
 (Optional) Cycle through the client debug display if available. More...
 
void setNearClippingDistance (float distance)
 Set the distance from the viewpoint to the near clipping distance plane. More...
 
void setFarClippingDistance (float distance)
 Set the distance from the viewpoint to the far clipping distance plane. More...
 
virtual void updateEyeCameraFrustrum ()=0
 
virtual bool usesCustomAudioDevice ()
 (Optional) return true if audio has to come out from a specific audio device More...
 
virtual std::string getAudioDeviceIdentifierSubString ()
 (Optional) return the sub string to search on the audio device list to get the correct one More...
 
virtual void showDebug (DebugMode mode)=0
 She the asked debug view. More...
 
std::array< AnnHandControllerPtr, MAX_CONTROLLER_NUMBERgetHandControllerArray () const
 Get a naked array of hand controllers. More...
 
bool handControllersAvailable () const
 Return true if the hand controllers are available. More...
 
virtual void handleIPDChange ()=0
 Called when the IPD needs to be taken into account. Translate the cameras along local X to make them match the position of your eyes. More...
 
void applyCameraRigPose (AnnPose pose) const
 Apply the position/orientation of the pose object to the camera rig. More...
 
void syncGameplayBody ()
 extract from gameplay-movable information the points used to calculate the world poses More...
 
void calculateTimingFromOgre ()
 
unsigned int createCombinedRenderTexture (unsigned int w, unsigned int h)
 This method create a texture with the wanted Anti Aliasing level. It will set the rttTextureCombined and rttEyesCombined member of this class to the correct value, and return the GLID of the texture. More...
 
GLuintPair createSeparatedRenderTextures (const combinedTextureSizeArray &textureSizes)
 This create a couple of separated render texture. More...
 
std::tuple< Ogre::TexturePtr, unsigned int > createAdditionalRenderBuffer (unsigned int w, unsigned int h, std::string name="") const
 Create a render buffer with not anti aliasing. return a tuple with a TexturePtr and a GLID. use More...
 
void createWindow (unsigned int w=1280, unsigned int h=720, bool vsync=false)
 Create a window. Even if we do VR, the way OGRE is architectured, you need to create a window to initialize the RenderSystem. More...
 
std::string getName () const
 Get the name of this renderer. More...
 
void loadHLMSLibrary (std::string path="./hlms/")
 Load the HLMS library from the file-system. More...
 
void loadCompositor (const std::string &path="./compositor/", const std::string &type="FileSystem")
 Load the compositor resources that are needed to setup the pipeline. More...
 
void setSkyColor (Ogre::ColourValue skyColor, float multiplier, const char *renderingNodeName) const
 Set the color used on the "clear" pass of the compositor node given. More...
 
void setExposure (float exposure, float minAuto, float maxAuto, const char *postProcessMaterial="HDR/DownScale03_SumLumEnd") const
 Set the exposure, need the name of the post process material. More...
 
void setBloomThreshold (float minThreshold, float fullColorThreshold, const char *brightnessPassMaterial="HDR/BrightPass_Start")
 Se the bloom threshold. Need the name of the brightness pass material. More...
 
void createMainSmgr ()
 Create the main scene manager and set some shadow parameters. More...
 
bool shouldPauseFlag () const
 Return true if you should not react to user inputs, according to the rendering runtime... More...
 
bool shouldHideHands () const
 Return true if you need to hide hand models. More...
 
void _resetOgreTimer () const
 Advanced : reset ogre internal timer. More...
 
bool isCompositorLoaded () const
 Return true if the compositor resources are loaded into Ogre. More...
 
bool isHlmsLibLoaded () const
 Return true if the HLMS templates are loaded into Ogre. More...
 

Static Public Member Functions

static void setAntiAliasingLevel (uint8_t AA)
 
static void detachCameraFromParent (Ogre::Camera *camera)
 Detach camera from their parent node. It seems that Ogre automatically attach new cameras to the root... More...
 
static size_t getHanControllerArraySize ()
 Get the size of the controller array. More...
 
static void makeValidPath (std::string &hlmsFolder)
 Make sure a string will be usable as a path for the hlms library/compositor resource group. More...
 
static void loadOpenGLFunctions ()
 Load "modern" OpenGL functions for the current OpenGL context. More...
 
static void glEasyCopy (GLuint source, GLuint dest, GLuint width, GLuint height)
 Wrap annoying OpenGL call to something humanly acceptable. More...
 
static std::string getAudioDeviceNameFromGUID (GUID guid)
 Return (if found) the name o the audio device you can use in the audio engine from a Windows only "GUID" for a sound card. More...
 

Public Attributes

const size_t numberOfThreads
 number of hardware threads More...
 
AnnPose trackedHeadPose
 The current position of the head center defined by the client library projected in World Space. More...
 

Static Public Attributes

static constexpr const char *const PluginRenderSystemGL3Plus { "./RenderSystem_GL3Plus" }
 Name of the rendersystem plugin to load on Ogre. More...
 
static constexpr const char *const Ogre_glTF_Plugin { "./libOgre_glTF.so" }
 
static constexpr const char *const GLRenderSystem3Plus { "OpenGL 3+ Rendering Subsystem" }
 Name of the rendersystem to initialize. More...
 
static constexpr const char *const RESOURCE_GROUP_COMPOSITOR = "RG_ANN_COMPOSITOR"
 Resource group to load the shaders, material and compositor script for rendering. More...
 

Protected Member Functions

void doStereoRender ()
 
void handleWindowMessages ()
 Handle the window messages and resize event. More...
 
void changedAA () const
 Called if AA level has been updated. More...
 

Protected Attributes

std::array< Ogre::CompositorWorkspace *, nbCompositorcompositorWorkspaces
 Compositor workspaces. 0 = left, 1 = right, 2 = monoscopic, plugged to the render window. More...
 
std::string rendererName
 Name of the renderer object. More...
 
Ogre::SceneManager * smgr
 SceneManager of the VR world. More...
 
std::unique_ptr< Ogre::Root > root
 Ogre root object. More...
 
Ogre::RenderWindow * window
 Render window. VR isn't drawn to this window. A window is mandatory to init the RenderSystem. More...
 
double updateTime
 Update Time. More...
 
double then
 
double now
 
Ogre::Real nearClippingDistance
 Distance between eyeCamera and nearClippingDistance. More...
 
Ogre::Real farClippingDistance
 Distance between eyeCamera and farClippingDistance. More...
 
Ogre::Vector3 feetPosition
 Position of the head. More...
 
Ogre::Quaternion bodyOrientation
 Orientation of the head. More...
 
std::string name
 Name of the window. More...
 
Ogre::SceneNode * gameplayCharacterRoot
 Node that represent the head base. Move this in 3D to move the viewpoint. More...
 
std::array< Ogre::Camera *, 2 > eyeCameras
 Cameras that have to be put where the user's eye is. More...
 
Ogre::Camera * monoCam
 Monoscopic camera. More...
 
Ogre::SceneNode * cameraRig
 Camera rig, node where all the cameras are attached. More...
 
uID frameCounter
 Counter of frames. More...
 
Ogre::RenderTexture * rttEyesCombined
 Render target that serve as intermediate buffer for the eyeCameras. More...
 
std::array< Ogre::RenderTexture *, 2 > rttEyeSeparated
 Couple of render textures separated. More...
 
std::array< AnnHandControllerPtr, MAX_CONTROLLER_NUMBERhandControllers
 Array of hand controller. More...
 
std::array< std::vector< byte >, 2 > currentControllerButtonsPressed
 Buffered button states. More...
 
std::array< std::vector< byte >, 2 > lastControllerButtonsPressed
 
std::vector< uint8_t > pressed
 Dynamically sized containers for pressed/released events. More...
 
std::vector< uint8_t > released
 
bool pauseFlag
 Store if we suggest you to pause reacting to user inputs... More...
 
bool hideHands
 Store if we should hide the hands. More...
 
bool compositorLoaded
 Compositor resources loaded. More...
 
bool hlmsLoaded
 Compositor resources loaded. More...
 

Static Protected Attributes

static AnnOgreVRRendererself { nullptr }
 Singleton pointer. More...
 
static uint8_t AALevel { 4 }
 Level of anti aliasing to use. More...
 
static constexpr const char *const rttTextureName = { "RttTex" }
 Name given to the texture manager for the eyeBuffer. More...
 

Private Types

enum  side : uint8_t { left = 0x0, right = 0x1 }
 left, right enums More...
 

Private Attributes

const GLuint glMajor
 GL version to use. More...
 
const GLuint glMinor
 
GLFWwindow * glfwWindow
 GL FrameWork window. More...
 
int windowW
 Window size. More...
 
int windowH
 

Static Private Attributes

static constexpr const char *const SL { "GLSL" }
 Shading language to use. More...
 

Detailed Description

Abstract class for VR Renderers. Serve as interface between Annwvyn, and "OgreHMDRender" object.

Definition at line 42 of file AnnOgreVRRenderer.hpp.

Member Typedef Documentation

◆ combinedTextureSizeArray

Member Enumeration Documentation

◆ compositorIndex

Indexes of the compositor workspace.

Enumerator
leftEyeCompositor 
rightEyeCompositor 
monoCompositor 
nbCompositor 

Definition at line 73 of file AnnOgreVRRenderer.hpp.

◆ DebugMode

Type of Debug render you can do.

Enumerator
RAW_BUFFER 
HMD_MIRROR 
MONOSCOPIC 

Definition at line 95 of file AnnOgreVRRenderer.hpp.

◆ ShadowFiltering

Liist of the levels of shadow filtering available.

Enumerator
low 
medium 
high 

Definition at line 81 of file AnnOgreVRRenderer.hpp.

◆ side

enum Annwvyn::AnnOgreVRRenderer::side : uint8_t
private

left, right enums

Enumerator
left 
right 

Definition at line 390 of file AnnOgreVRRenderer.hpp.

Constructor & Destructor Documentation

◆ AnnOgreVRRenderer()

AnnOgreVRRenderer::AnnOgreVRRenderer ( const std::string windowName)

Construct VR Renderer.

Definition at line 56 of file AnnOgreVRRenderer.cpp.

◆ ~AnnOgreVRRenderer()

AnnOgreVRRenderer::~AnnOgreVRRenderer ( )
virtual

Destruct VR Renderer.

Definition at line 99 of file AnnOgreVRRenderer.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ _resetOgreTimer()

void AnnOgreVRRenderer::_resetOgreTimer ( ) const

Advanced : reset ogre internal timer.

Definition at line 576 of file AnnOgreVRRenderer.cpp.

Here is the call graph for this function:

◆ applyCameraRigPose()

void AnnOgreVRRenderer::applyCameraRigPose ( AnnPose  pose) const

Apply the position/orientation of the pose object to the camera rig.

Definition at line 258 of file AnnOgreVRRenderer.cpp.

Here is the caller graph for this function:

◆ calculateTimingFromOgre()

void AnnOgreVRRenderer::calculateTimingFromOgre ( )

For call at instant T, will set updateTime to the time between T and T-1 If you do this, you'll get the time from between this frame and the last one

Definition at line 271 of file AnnOgreVRRenderer.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ changedAA()

void AnnOgreVRRenderer::changedAA ( ) const
protected

Called if AA level has been updated.

Definition at line 191 of file AnnOgreVRRenderer.cpp.

Here is the call graph for this function:

◆ createAdditionalRenderBuffer()

std::tuple< Ogre::TexturePtr, unsigned int > AnnOgreVRRenderer::createAdditionalRenderBuffer ( unsigned int  w,
unsigned int  h,
std::string  name = "" 
) const

Create a render buffer with not anti aliasing. return a tuple with a TexturePtr and a GLID. use

std::get<>

Definition at line 353 of file AnnOgreVRRenderer.cpp.

Here is the call graph for this function:

◆ createCombinedRenderTexture()

GLuint AnnOgreVRRenderer::createCombinedRenderTexture ( unsigned int  w,
unsigned int  h 
)

This method create a texture with the wanted Anti Aliasing level. It will set the rttTextureCombined and rttEyesCombined member of this class to the correct value, and return the GLID of the texture.

Definition at line 320 of file AnnOgreVRRenderer.cpp.

◆ createMainSmgr()

void AnnOgreVRRenderer::createMainSmgr ( )

Create the main scene manager and set some shadow parameters.

Definition at line 535 of file AnnOgreVRRenderer.cpp.

Here is the caller graph for this function:

◆ createSeparatedRenderTextures()

GLuintPair AnnOgreVRRenderer::createSeparatedRenderTextures ( const combinedTextureSizeArray textureSizes)

This create a couple of separated render texture.

Definition at line 329 of file AnnOgreVRRenderer.cpp.

Here is the call graph for this function:

◆ createWindow()

void AnnOgreVRRenderer::createWindow ( unsigned int  w = 1280,
unsigned int  h = 720,
bool  vsync = false 
)

Create a window. Even if we do VR, the way OGRE is architectured, you need to create a window to initialize the RenderSystem.

Definition at line 372 of file AnnOgreVRRenderer.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cycleDebugHud()

virtual void Annwvyn::AnnOgreVRRenderer::cycleDebugHud ( )
inlinevirtual

(Optional) Cycle through the client debug display if available.

Definition at line 172 of file AnnOgreVRRenderer.hpp.

◆ detachCameraFromParent()

void AnnOgreVRRenderer::detachCameraFromParent ( Ogre::Camera *  camera)
static

Detach camera from their parent node. It seems that Ogre automatically attach new cameras to the root...

Definition at line 223 of file AnnOgreVRRenderer.cpp.

Here is the caller graph for this function:

◆ doStereoRender()

void AnnOgreVRRenderer::doStereoRender ( )
protected

Definition at line 659 of file AnnOgreVRRenderer.cpp.

◆ getAudioDeviceIdentifierSubString()

virtual std::string Annwvyn::AnnOgreVRRenderer::getAudioDeviceIdentifierSubString ( )
inlinevirtual

(Optional) return the sub string to search on the audio device list to get the correct one

Definition at line 191 of file AnnOgreVRRenderer.hpp.

◆ getAudioDeviceNameFromGUID()

std::string AnnOgreVRRenderer::getAudioDeviceNameFromGUID ( GUID  guid)
static

Return (if found) the name o the audio device you can use in the audio engine from a Windows only "GUID" for a sound card.

Definition at line 591 of file AnnOgreVRRenderer.cpp.

Here is the call graph for this function:

◆ getCameraInformationNode()

Ogre::SceneNode * AnnOgreVRRenderer::getCameraInformationNode ( ) const

Get the node that is the player's head anchor point.

Definition at line 140 of file AnnOgreVRRenderer.cpp.

◆ getHanControllerArraySize()

size_t AnnOgreVRRenderer::getHanControllerArraySize ( )
static

Get the size of the controller array.

Definition at line 186 of file AnnOgreVRRenderer.cpp.

◆ getHandControllerArray()

std::array< std::shared_ptr< AnnHandController >, MAX_CONTROLLER_NUMBER > AnnOgreVRRenderer::getHandControllerArray ( ) const

Get a naked array of hand controllers.

Definition at line 181 of file AnnOgreVRRenderer.cpp.

◆ getName()

std::string AnnOgreVRRenderer::getName ( ) const

Get the name of this renderer.

Definition at line 418 of file AnnOgreVRRenderer.cpp.

◆ getOgreConfig()

void AnnOgreVRRenderer::getOgreConfig ( ) const

Configure the Ogre root engine. Will load all the ogre Plug-ins and components we need.

Definition at line 164 of file AnnOgreVRRenderer.cpp.

Here is the caller graph for this function:

◆ getRoot()

Ogre::Root * AnnOgreVRRenderer::getRoot ( ) const

Get the Ogre::Root object.

Definition at line 130 of file AnnOgreVRRenderer.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSceneManager()

Ogre::SceneManager * AnnOgreVRRenderer::getSceneManager ( ) const

Get the scene manager of the virtual world.

Definition at line 125 of file AnnOgreVRRenderer.cpp.

◆ getTimer()

Ogre::Timer * AnnOgreVRRenderer::getTimer ( ) const

Get Ogre's internal timer.

Definition at line 145 of file AnnOgreVRRenderer.cpp.

Here is the caller graph for this function:

◆ getTrackingPoseAndVRTiming()

virtual void Annwvyn::AnnOgreVRRenderer::getTrackingPoseAndVRTiming ( )
pure virtual

Get tracking from the VR system.

Implemented in Annwvyn::AnnOgreNoVRRenderer.

Here is the caller graph for this function:

◆ getUpdateTime()

double AnnOgreVRRenderer::getUpdateTime ( ) const

Get frame update time from the VR renderer.

Definition at line 150 of file AnnOgreVRRenderer.cpp.

◆ getWindow()

Ogre::RenderWindow * AnnOgreVRRenderer::getWindow ( ) const

Get the RenderWidow that should display a debug render the VR view.

Definition at line 135 of file AnnOgreVRRenderer.cpp.

◆ glEasyCopy()

void AnnOgreVRRenderer::glEasyCopy ( GLuint  source,
GLuint  dest,
GLuint  width,
GLuint  height 
)
static

Wrap annoying OpenGL call to something humanly acceptable.

Definition at line 557 of file AnnOgreVRRenderer.cpp.

◆ handControllersAvailable()

bool AnnOgreVRRenderer::handControllersAvailable ( ) const

Return true if the hand controllers are available.

Definition at line 423 of file AnnOgreVRRenderer.cpp.

◆ handleIPDChange()

virtual void Annwvyn::AnnOgreVRRenderer::handleIPDChange ( )
pure virtual

Called when the IPD needs to be taken into account. Translate the cameras along local X to make them match the position of your eyes.

Implemented in Annwvyn::AnnOgreNoVRRenderer.

◆ handleWindowMessages()

void AnnOgreVRRenderer::handleWindowMessages ( )
protected

Handle the window messages and resize event.

Definition at line 671 of file AnnOgreVRRenderer.cpp.

Here is the caller graph for this function:

◆ initCameras()

void AnnOgreVRRenderer::initCameras ( )
virtual

Create the pair of cameras for the stereo render;.

Definition at line 229 of file AnnOgreVRRenderer.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initClientHmdRendering()

virtual void Annwvyn::AnnOgreVRRenderer::initClientHmdRendering ( )
pure virtual

Init the VR client rendering.

Implemented in Annwvyn::AnnOgreNoVRRenderer.

◆ initOgreRoot()

void AnnOgreVRRenderer::initOgreRoot ( const std::string loggerName)

Initialize the Ogre library (root object)

Parameters
loggerNamename of the log file

Definition at line 155 of file AnnOgreVRRenderer.cpp.

Here is the call graph for this function:

◆ initPipeline()

void AnnOgreVRRenderer::initPipeline ( )
finalvirtual

Init the VR rendering pipeline.

Definition at line 308 of file AnnOgreVRRenderer.cpp.

Here is the call graph for this function:

◆ initRttRendering()

virtual void Annwvyn::AnnOgreVRRenderer::initRttRendering ( )
pure virtual

Initialize the Render To Texture rendering.

Implemented in Annwvyn::AnnOgreNoVRRenderer.

Here is the caller graph for this function:

◆ initScene()

virtual void Annwvyn::AnnOgreVRRenderer::initScene ( )
pure virtual

Create the scene(s) manager(s) needed for the rendering.

Implemented in Annwvyn::AnnOgreNoVRRenderer.

Here is the caller graph for this function:

◆ initVrHmd()

virtual void Annwvyn::AnnOgreVRRenderer::initVrHmd ( )
pure virtual

Init the VR client library.

Implemented in Annwvyn::AnnOgreNoVRRenderer.

◆ isCompositorLoaded()

bool AnnOgreVRRenderer::isCompositorLoaded ( ) const

Return true if the compositor resources are loaded into Ogre.

Definition at line 581 of file AnnOgreVRRenderer.cpp.

◆ isHlmsLibLoaded()

bool AnnOgreVRRenderer::isHlmsLibLoaded ( ) const

Return true if the HLMS templates are loaded into Ogre.

Definition at line 586 of file AnnOgreVRRenderer.cpp.

◆ isVisibleInHmd()

virtual bool Annwvyn::AnnOgreVRRenderer::isVisibleInHmd ( )
pure virtual

If true, the user can see the VR render inside his HMD.

Implemented in Annwvyn::AnnOgreNoVRRenderer.

◆ loadCompositor()

void AnnOgreVRRenderer::loadCompositor ( const std::string path = "./compositor/",
const std::string type = "FileSystem" 
)

Load the compositor resources that are needed to setup the pipeline.

Definition at line 489 of file AnnOgreVRRenderer.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadHLMSLibrary()

void AnnOgreVRRenderer::loadHLMSLibrary ( std::string  path = "./hlms/")

Load the HLMS library from the file-system.

Definition at line 436 of file AnnOgreVRRenderer.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadOpenGLFunctions()

void AnnOgreVRRenderer::loadOpenGLFunctions ( )
static

Load "modern" OpenGL functions for the current OpenGL context.

Definition at line 278 of file AnnOgreVRRenderer.cpp.

Here is the caller graph for this function:

◆ makeValidPath()

void AnnOgreVRRenderer::makeValidPath ( std::string hlmsFolder)
static

Make sure a string will be usable as a path for the hlms library/compositor resource group.

Definition at line 428 of file AnnOgreVRRenderer.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ recenter()

virtual void Annwvyn::AnnOgreVRRenderer::recenter ( )
pure virtual

Put the current position as the center of tracking.

Implemented in Annwvyn::AnnOgreNoVRRenderer.

◆ renderAndSubmitFrame()

virtual void Annwvyn::AnnOgreVRRenderer::renderAndSubmitFrame ( )
pure virtual

Render frame internally inside Ogre, and submit it to the VR client.

Implemented in Annwvyn::AnnOgreNoVRRenderer.

◆ setAntiAliasingLevel()

void AnnOgreVRRenderer::setAntiAliasingLevel ( uint8_t  AA)
static

Set the anti-aliasing level to AA if AA is part of the available values

Parameters
AAthe AA level to use.

Definition at line 49 of file AnnOgreVRRenderer.cpp.

Here is the caller graph for this function:

◆ setBloomThreshold()

void AnnOgreVRRenderer::setBloomThreshold ( float  minThreshold,
float  fullColorThreshold,
const char *  brightnessPassMaterial = "HDR/BrightPass_Start" 
)

Se the bloom threshold. Need the name of the brightness pass material.

Definition at line 641 of file AnnOgreVRRenderer.cpp.

◆ setExposure()

void AnnOgreVRRenderer::setExposure ( float  exposure,
float  minAuto,
float  maxAuto,
const char *  postProcessMaterial = "HDR/DownScale03_SumLumEnd" 
) const

Set the exposure, need the name of the post process material.

Definition at line 518 of file AnnOgreVRRenderer.cpp.

◆ setFarClippingDistance()

void AnnOgreVRRenderer::setFarClippingDistance ( float  distance)

Set the distance from the viewpoint to the far clipping distance plane.

Definition at line 217 of file AnnOgreVRRenderer.cpp.

Here is the call graph for this function:

◆ setNearClippingDistance()

void AnnOgreVRRenderer::setNearClippingDistance ( float  distance)

Set the distance from the viewpoint to the near clipping distance plane.

Definition at line 211 of file AnnOgreVRRenderer.cpp.

Here is the call graph for this function:

◆ setShadowFiltering()

void AnnOgreVRRenderer::setShadowFiltering ( ShadowFiltering  level) const

Set the shadow filtering level (quality)

Definition at line 694 of file AnnOgreVRRenderer.cpp.

◆ setSkyColor()

void AnnOgreVRRenderer::setSkyColor ( Ogre::ColourValue  skyColor,
float  multiplier,
const char *  renderingNodeName 
) const

Set the color used on the "clear" pass of the compositor node given.

Definition at line 501 of file AnnOgreVRRenderer.cpp.

◆ shouldHideHands()

bool AnnOgreVRRenderer::shouldHideHands ( ) const

Return true if you need to hide hand models.

Definition at line 551 of file AnnOgreVRRenderer.cpp.

◆ shouldPauseFlag()

bool AnnOgreVRRenderer::shouldPauseFlag ( ) const

Return true if you should not react to user inputs, according to the rendering runtime...

Definition at line 546 of file AnnOgreVRRenderer.cpp.

◆ shouldQuit()

virtual bool Annwvyn::AnnOgreVRRenderer::shouldQuit ( )
pure virtual

If true, you should cleanly quit the program from now.

Implemented in Annwvyn::AnnOgreNoVRRenderer.

◆ shouldRecenter()

virtual bool Annwvyn::AnnOgreVRRenderer::shouldRecenter ( )
pure virtual

If true you should use the current position as the new center of tracking.

Implemented in Annwvyn::AnnOgreNoVRRenderer.

◆ showDebug()

virtual void Annwvyn::AnnOgreVRRenderer::showDebug ( DebugMode  mode)
pure virtual

She the asked debug view.

Implemented in Annwvyn::AnnOgreNoVRRenderer.

◆ syncGameplayBody()

void AnnOgreVRRenderer::syncGameplayBody ( )

extract from gameplay-movable information the points used to calculate the world poses

Definition at line 264 of file AnnOgreVRRenderer.cpp.

Here is the caller graph for this function:

◆ updateEyeCameraFrustrum()

virtual void Annwvyn::AnnOgreVRRenderer::updateEyeCameraFrustrum ( )
pure virtual

The projection matrix is generally given by the underlying VR api, generally, using the near/far clipping distances set in this class

Note
this method is called by the set{Near/Far}ClippingDistance() automatically.

Implemented in Annwvyn::AnnOgreNoVRRenderer.

Here is the caller graph for this function:

◆ updateTracking()

void AnnOgreVRRenderer::updateTracking ( )
finalvirtual

Refresh and update the head tracking. May tell the VR client library to prepare for new frame.

Definition at line 301 of file AnnOgreVRRenderer.cpp.

Here is the call graph for this function:

◆ usesCustomAudioDevice()

virtual bool Annwvyn::AnnOgreVRRenderer::usesCustomAudioDevice ( )
inlinevirtual

(Optional) return true if audio has to come out from a specific audio device

Definition at line 188 of file AnnOgreVRRenderer.hpp.

Member Data Documentation

◆ AALevel

uint8_t AnnOgreVRRenderer::AALevel { 4 }
staticprotected

Level of anti aliasing to use.

Definition at line 362 of file AnnOgreVRRenderer.hpp.

◆ bodyOrientation

Ogre::Quaternion Annwvyn::AnnOgreVRRenderer::bodyOrientation
protected

Orientation of the head.

Definition at line 335 of file AnnOgreVRRenderer.hpp.

◆ cameraRig

Ogre::SceneNode* Annwvyn::AnnOgreVRRenderer::cameraRig
protected

Camera rig, node where all the cameras are attached.

Definition at line 350 of file AnnOgreVRRenderer.hpp.

◆ compositorLoaded

bool Annwvyn::AnnOgreVRRenderer::compositorLoaded
protected

Compositor resources loaded.

Definition at line 383 of file AnnOgreVRRenderer.hpp.

◆ compositorWorkspaces

std::array<Ogre::CompositorWorkspace*, nbCompositor> Annwvyn::AnnOgreVRRenderer::compositorWorkspaces
protected

Compositor workspaces. 0 = left, 1 = right, 2 = monoscopic, plugged to the render window.

Definition at line 302 of file AnnOgreVRRenderer.hpp.

◆ currentControllerButtonsPressed

std::array<std::vector<byte>, 2> Annwvyn::AnnOgreVRRenderer::currentControllerButtonsPressed
protected

Buffered button states.

Definition at line 368 of file AnnOgreVRRenderer.hpp.

◆ eyeCameras

std::array<Ogre::Camera*, 2> Annwvyn::AnnOgreVRRenderer::eyeCameras
protected

Cameras that have to be put where the user's eye is.

Definition at line 344 of file AnnOgreVRRenderer.hpp.

◆ farClippingDistance

Ogre::Real Annwvyn::AnnOgreVRRenderer::farClippingDistance
protected

Distance between eyeCamera and farClippingDistance.

Definition at line 329 of file AnnOgreVRRenderer.hpp.

◆ feetPosition

Ogre::Vector3 Annwvyn::AnnOgreVRRenderer::feetPosition
protected

Position of the head.

Definition at line 332 of file AnnOgreVRRenderer.hpp.

◆ frameCounter

uID Annwvyn::AnnOgreVRRenderer::frameCounter
protected

Counter of frames.

Definition at line 353 of file AnnOgreVRRenderer.hpp.

◆ gameplayCharacterRoot

Ogre::SceneNode* Annwvyn::AnnOgreVRRenderer::gameplayCharacterRoot
protected

Node that represent the head base. Move this in 3D to move the viewpoint.

Definition at line 341 of file AnnOgreVRRenderer.hpp.

◆ glfwWindow

GLFWwindow* Annwvyn::AnnOgreVRRenderer::glfwWindow
private

GL FrameWork window.

Definition at line 286 of file AnnOgreVRRenderer.hpp.

◆ glMajor

const GLuint Annwvyn::AnnOgreVRRenderer::glMajor
private

GL version to use.

Definition at line 283 of file AnnOgreVRRenderer.hpp.

◆ glMinor

const GLuint Annwvyn::AnnOgreVRRenderer::glMinor
private

Definition at line 283 of file AnnOgreVRRenderer.hpp.

◆ GLRenderSystem3Plus

constexpr const char* const Annwvyn::AnnOgreVRRenderer::GLRenderSystem3Plus { "OpenGL 3+ Rendering Subsystem" }
static

Name of the rendersystem to initialize.

Definition at line 65 of file AnnOgreVRRenderer.hpp.

◆ handControllers

std::array<AnnHandControllerPtr, MAX_CONTROLLER_NUMBER> Annwvyn::AnnOgreVRRenderer::handControllers
protected

Array of hand controller.

Definition at line 365 of file AnnOgreVRRenderer.hpp.

◆ hideHands

bool Annwvyn::AnnOgreVRRenderer::hideHands
protected

Store if we should hide the hands.

Definition at line 380 of file AnnOgreVRRenderer.hpp.

◆ hlmsLoaded

bool Annwvyn::AnnOgreVRRenderer::hlmsLoaded
protected

Compositor resources loaded.

Definition at line 386 of file AnnOgreVRRenderer.hpp.

◆ lastControllerButtonsPressed

std::array<std::vector<byte>, 2> Annwvyn::AnnOgreVRRenderer::lastControllerButtonsPressed
protected

Definition at line 368 of file AnnOgreVRRenderer.hpp.

◆ monoCam

Ogre::Camera* Annwvyn::AnnOgreVRRenderer::monoCam
protected

Monoscopic camera.

Definition at line 347 of file AnnOgreVRRenderer.hpp.

◆ name

std::string Annwvyn::AnnOgreVRRenderer::name
protected

Name of the window.

Definition at line 338 of file AnnOgreVRRenderer.hpp.

◆ nearClippingDistance

Ogre::Real Annwvyn::AnnOgreVRRenderer::nearClippingDistance
protected

Distance between eyeCamera and nearClippingDistance.

Definition at line 326 of file AnnOgreVRRenderer.hpp.

◆ now

double Annwvyn::AnnOgreVRRenderer::now
protected

Definition at line 323 of file AnnOgreVRRenderer.hpp.

◆ numberOfThreads

const size_t Annwvyn::AnnOgreVRRenderer::numberOfThreads

number of hardware threads

Definition at line 70 of file AnnOgreVRRenderer.hpp.

◆ Ogre_glTF_Plugin

constexpr const char* const Annwvyn::AnnOgreVRRenderer::Ogre_glTF_Plugin { "./libOgre_glTF.so" }
static

Definition at line 53 of file AnnOgreVRRenderer.hpp.

◆ pauseFlag

bool Annwvyn::AnnOgreVRRenderer::pauseFlag
protected

Store if we suggest you to pause reacting to user inputs...

Definition at line 377 of file AnnOgreVRRenderer.hpp.

◆ PluginRenderSystemGL3Plus

constexpr const char* const Annwvyn::AnnOgreVRRenderer::PluginRenderSystemGL3Plus { "./RenderSystem_GL3Plus" }
static

Name of the rendersystem plugin to load on Ogre.

Definition at line 49 of file AnnOgreVRRenderer.hpp.

◆ pressed

std::vector<uint8_t> Annwvyn::AnnOgreVRRenderer::pressed
protected

Dynamically sized containers for pressed/released events.

Definition at line 371 of file AnnOgreVRRenderer.hpp.

◆ released

std::vector<uint8_t> Annwvyn::AnnOgreVRRenderer::released
protected

Definition at line 371 of file AnnOgreVRRenderer.hpp.

◆ rendererName

std::string Annwvyn::AnnOgreVRRenderer::rendererName
protected

Name of the renderer object.

Definition at line 305 of file AnnOgreVRRenderer.hpp.

◆ RESOURCE_GROUP_COMPOSITOR

constexpr const char* const Annwvyn::AnnOgreVRRenderer::RESOURCE_GROUP_COMPOSITOR = "RG_ANN_COMPOSITOR"
static

Resource group to load the shaders, material and compositor script for rendering.

Definition at line 67 of file AnnOgreVRRenderer.hpp.

◆ root

std::unique_ptr<Ogre::Root> Annwvyn::AnnOgreVRRenderer::root
protected

Ogre root object.

Definition at line 317 of file AnnOgreVRRenderer.hpp.

◆ rttEyesCombined

Ogre::RenderTexture* Annwvyn::AnnOgreVRRenderer::rttEyesCombined
protected

Render target that serve as intermediate buffer for the eyeCameras.

Definition at line 356 of file AnnOgreVRRenderer.hpp.

◆ rttEyeSeparated

std::array<Ogre::RenderTexture*, 2> Annwvyn::AnnOgreVRRenderer::rttEyeSeparated
protected

Couple of render textures separated.

Definition at line 359 of file AnnOgreVRRenderer.hpp.

◆ rttTextureName

constexpr const char* const Annwvyn::AnnOgreVRRenderer::rttTextureName = { "RttTex" }
staticprotected

Name given to the texture manager for the eyeBuffer.

Definition at line 374 of file AnnOgreVRRenderer.hpp.

◆ self

AnnOgreVRRenderer * AnnOgreVRRenderer::self { nullptr }
staticprotected

Singleton pointer.

Definition at line 311 of file AnnOgreVRRenderer.hpp.

◆ SL

constexpr const char* const Annwvyn::AnnOgreVRRenderer::SL { "GLSL" }
staticprivate

Shading language to use.

Definition at line 289 of file AnnOgreVRRenderer.hpp.

◆ smgr

Ogre::SceneManager* Annwvyn::AnnOgreVRRenderer::smgr
protected

SceneManager of the VR world.

Definition at line 314 of file AnnOgreVRRenderer.hpp.

◆ then

double Annwvyn::AnnOgreVRRenderer::then
protected

Definition at line 323 of file AnnOgreVRRenderer.hpp.

◆ trackedHeadPose

AnnPose Annwvyn::AnnOgreVRRenderer::trackedHeadPose

The current position of the head center defined by the client library projected in World Space.

Definition at line 194 of file AnnOgreVRRenderer.hpp.

◆ updateTime

double Annwvyn::AnnOgreVRRenderer::updateTime
protected

Update Time.

Definition at line 323 of file AnnOgreVRRenderer.hpp.

◆ window

Ogre::RenderWindow* Annwvyn::AnnOgreVRRenderer::window
protected

Render window. VR isn't drawn to this window. A window is mandatory to init the RenderSystem.

Definition at line 320 of file AnnOgreVRRenderer.hpp.

◆ windowH

int Annwvyn::AnnOgreVRRenderer::windowH
private

Definition at line 292 of file AnnOgreVRRenderer.hpp.

◆ windowW

int Annwvyn::AnnOgreVRRenderer::windowW
private

Window size.

Definition at line 292 of file AnnOgreVRRenderer.hpp.


The documentation for this class was generated from the following files: