namespace
gfxGFX library.
Namespaces
- namespace CubeMapShaderBaseTexUnitSpace
- namespace pbrTextureUnitSpace
- namespace replay
Classes
- class CubeMap
- class CubeMapCamera
- class CubeMapShaderBase
- class DebugLineRender
- Singleton utility class for on-the-fly rendering of lines (e.g. every frame). This is intended for debugging or simple UX for prototype apps. The API prioritizes ease-of-use over maximum runtime performance.
- class DepthMapDrawableBase
- class DepthShader
- Depth-only shader.
- class DoubleSphereCameraShader
- class Drawable
- Drawable for use with DrawableGroup.
- class DrawableGroup
- Group of drawables, and shared group parameters.
- class EquirectangularShader
- class GaussianFilterShader
- A shader to visualize the depth buffer information.
- class GenericDrawable
- struct LightInfo
- Contains a single light's information.
- struct MaterialData
- class MeshVisualizerDrawable
- class PbrDrawable
- class PbrEquiRectangularToCubeMapShader
- a shader to convert a HDRi image (the environment map in equirectangular form) to a cubemap
- class PbrImageBasedLighting
- struct PbrMaterialData
- class PbrPrecomputedMapShader
- A shader to output the irradiance map, applied in the IBL diffuse part, or the prefiltered environment map, applied in the IBL specular part, based on the user setting.
- class PbrShader
- struct PhongMaterialData
- class PTexMeshDrawable
- class PTexMeshShader
- class RenderCamera
- class Renderer
- class RenderTarget
- class TextureVisualizerShader
- A shader to visualize the depth buffer information.
- class VarianceShadowMapDrawable
- class VarianceShadowMapShader
- class WindowlessContext
Enums
- enum class DrawableType: uint8_t { None = 0, Generic = 1, Pbr = 2, PTexMesh = 3, MeshVisualizer = 4, VarianceShadowMap = 6 }
- enum class LightPositionModel { Camera = 0, Global = 1, Object = 2 }
- enum class LightType { Point = 0, Directional = 1, Spot = 2 }
- enum class MaterialDataType { None = 0, Phong = 1, Pbr = 2 }
Typedefs
-
using LightSetup = std::
vector<LightInfo> - A set of LightInfos.
-
using ShaderManager = Magnum::
ResourceManager<Magnum:: GL:: AbstractShaderProgram, gfx:: LightSetup, gfx:: MaterialData> -
using ShadowMapManager = Magnum::
ResourceManager<CubeMap> -
using ShadowMapKeys = std::
vector<Magnum:: ResourceKey>
Functions
- void initGfxBindings(pybind11::module& m)
-
auto espLoggingSubsystem() -> logging::
Subsystem -
auto calculateDepthUnprojection(const Magnum::
Matrix4& projectionMatrix) -> Magnum:: Vector2 - Calculate depth unprojection coefficients for unprojectDepth()
-
void unprojectDepth(const Magnum::
Vector2& unprojection, Corrade:: Containers:: ArrayView<Magnum:: Float> depth) - Unproject depth values.
- auto operator==(const LightInfo& a, const LightInfo& b) -> bool
- auto operator!=(const LightInfo& a, const LightInfo& b) -> bool
-
auto getLightPositionRelativeToCamera(const LightInfo& light,
const Magnum::
Matrix4& transformationMatrix, const Magnum:: Matrix4& cameraMatrix) -> Magnum:: Vector4 - Get position relative to a camera for a LightInfo and a rendered object. light.position and the return value are Vector4, with w == 1 for positions and w == 0 for directions.
-
auto getLightPositionRelativeToWorld(const LightInfo& light,
const Magnum::
Matrix4& transformationMatrix, const Magnum:: Matrix4& cameraMatrix) -> Magnum:: Vector4 - Get light position in world space for a LightInfo and a rendered object. light.position and the return value are Vector4, with w == 1 for positions and w == 0 for directions.
-
auto getLightsAtBoxCorners(const Magnum::
Range3D& box, const Magnum:: Color3& lightColor = Magnum:: Color3{10.0f}) -> LightSetup - Get a LightSetup with lights at the corners of a box.
- auto getDefaultLights() -> LightSetup
- Get a LightSetup with some directional lights approximating daylight.
-
auto getAmbientLightColor(const LightSetup& lightSetup) -> Magnum::
Color3 - Get get a single, combined ambient light color for use with the Phong lighting model.
- auto createUniversalMaterial(const Mn::Trade::MaterialData& origMaterialData) -> Mn::Trade::MaterialData
- This function will take an existing Mn::Trade::MaterialData and add the missing attributes for the types it does not support, so that it will have attributes for all habitat-supported types. This should only be called if the user has specified a desired shader type that the material does not natively support.
-
void setLightSetupForSubTree(scene::
SceneNode& root, const Magnum:: ResourceKey& lightSetup) - Set the light setup for a subtree.
Enum documentation
enum class esp:: gfx:: DrawableType: uint8_t
#include <esp/gfx/Drawable.h>
enum class esp:: gfx:: LightPositionModel
#include <esp/gfx/LightSetup.h>
Enumerators | |
---|---|
Camera |
Light position is relative to the camera. |
Global |
Light position is relative to scene. |
Object |
Light position is relative to the object being rendered. |
enum class esp:: gfx:: LightType
#include <esp/gfx/LightSetup.h>
Enumerators | |
---|---|
Point |
The type of light described by a light info. |
Directional |
|
Spot |
|
enum class esp:: gfx:: MaterialDataType
#include <esp/gfx/MaterialData.h>
Enumerators | |
---|---|
None |
default, does not represent any material |
Phong |
phong material data |
Pbr |
Physically based rendering (PBR) material data. |
Typedef documentation
using esp:: gfx:: LightSetup = std:: vector<LightInfo>
#include <esp/gfx/LightSetup.h>
A set of LightInfos.
using esp:: gfx:: ShaderManager = Magnum:: ResourceManager<Magnum:: GL:: AbstractShaderProgram, gfx:: LightSetup, gfx:: MaterialData>
#include <esp/gfx/ShaderManager.h>
using esp:: gfx:: ShadowMapManager = Magnum:: ResourceManager<CubeMap>
#include <esp/gfx/ShadowMapManager.h>
using esp:: gfx:: ShadowMapKeys = std:: vector<Magnum:: ResourceKey>
#include <esp/gfx/ShadowMapManager.h>
Function documentation
void esp:: gfx:: initGfxBindings(pybind11::module& m)
#include <esp/bindings/Bindings.h>
logging:: Subsystem esp:: gfx:: espLoggingSubsystem()
#include <esp/core/Logging.h>
Magnum:: Vector2 esp:: gfx:: calculateDepthUnprojection(const Magnum:: Matrix4& projectionMatrix)
#include <esp/gfx/DepthUnprojection.h>
Calculate depth unprojection coefficients for unprojectDepth()
Given a projection transformation of vector using a matrix where and are arbitrary, the transformation can be reduced to a 2x2 matrix multiplication:
In the OpenGL depth buffer, the depth values are in range and the final depth value is after a perspective divide. The output has Z going forward, not backward, so we're looking for the value of :
Finally, to reduce the amount of operations in unprojectDepth(), we integrate the constants into and , returning and :
void esp:: gfx:: unprojectDepth(const Magnum:: Vector2& unprojection,
Corrade:: Containers:: ArrayView<Magnum:: Float> depth)
#include <esp/gfx/DepthUnprojection.h>
Unproject depth values.
Parameters | |
---|---|
unprojection in | Unprojection coefficients from calculateDepthUnprojection() |
depth in/out | Depth values in range |
See calculateDepthUnprojection() for the full algorithm explanation. Additionally to applying that calculation, if the input depth is at the far plane (of value 1.0f
), it's set to 0.0f
on output as consumers expect zeros for things that are too far.
bool esp:: gfx:: operator==(const LightInfo& a,
const LightInfo& b)
#include <esp/gfx/LightSetup.h>
bool esp:: gfx:: operator!=(const LightInfo& a,
const LightInfo& b)
#include <esp/gfx/LightSetup.h>
Magnum:: Vector4 esp:: gfx:: getLightPositionRelativeToCamera(const LightInfo& light,
const Magnum:: Matrix4& transformationMatrix,
const Magnum:: Matrix4& cameraMatrix)
#include <esp/gfx/LightSetup.h>
Get position relative to a camera for a LightInfo and a rendered object. light.position and the return value are Vector4, with w == 1 for positions and w == 0 for directions.
Parameters | |
---|---|
light | |
transformationMatrix | Describes object position relative to camera |
cameraMatrix | Describes world position relative to camera |
Returns | Magnum::Vector4 Light position relative to camera |
Magnum:: Vector4 esp:: gfx:: getLightPositionRelativeToWorld(const LightInfo& light,
const Magnum:: Matrix4& transformationMatrix,
const Magnum:: Matrix4& cameraMatrix)
#include <esp/gfx/LightSetup.h>
Get light position in world space for a LightInfo and a rendered object. light.position and the return value are Vector4, with w == 1 for positions and w == 0 for directions.
Parameters | |
---|---|
light | |
transformationMatrix | Describes object position relative to camera |
cameraMatrix | Describes world position relative |
Returns | Magnum::Vector4 Light position in world space |
LightSetup esp:: gfx:: getLightsAtBoxCorners(const Magnum:: Range3D& box,
const Magnum:: Color3& lightColor = Magnum:: Color3{10.0f})
#include <esp/gfx/LightSetup.h>
Get a LightSetup with lights at the corners of a box.
LightSetup esp:: gfx:: getDefaultLights()
#include <esp/gfx/LightSetup.h>
Get a LightSetup with some directional lights approximating daylight.
Magnum:: Color3 esp:: gfx:: getAmbientLightColor(const LightSetup& lightSetup)
#include <esp/gfx/LightSetup.h>
Get get a single, combined ambient light color for use with the Phong lighting model.
Mn::Trade::MaterialData esp:: gfx:: createUniversalMaterial(const Mn::Trade::MaterialData& origMaterialData)
#include <esp/gfx/MaterialUtil.h>
This function will take an existing Mn::Trade::MaterialData and add the missing attributes for the types it does not support, so that it will have attributes for all habitat-supported types. This should only be called if the user has specified a desired shader type that the material does not natively support.
Parameters | |
---|---|
origMaterialData | The original material from the importer |
Returns | The new material with attribute support for all supported shader types. |
void esp:: gfx:: setLightSetupForSubTree(scene:: SceneNode& root,
const Magnum:: ResourceKey& lightSetup)
#include <esp/gfx/ShaderManager.h>
Set the light setup for a subtree.
Parameters | |
---|---|
root | Subtree root |
lightSetup | LightSetup key in the ShaderManager |
All drawables in the subtree starting at root will have the new lightSetup