namespace
gfxGFX library.
Classes
- class DepthShader
- Depth-only shader.
- class Drawable
- Drawable for use with DrawableGroup.
- class DrawableGroup
- Group of drawables, and shared group parameters.
- class GenericDrawable
- struct LightInfo
- Contains a single light's information.
- struct MaterialData
- class MeshVisualizerDrawable
- struct PhongMaterialData
- class PTexMeshDrawable
- class PTexMeshShader
- class RenderCamera
- class Renderer
- class RenderTarget
- class WindowlessContext
Enums
- enum class LightPositionModel { CAMERA = 0, GLOBAL = 1, OBJECT = 2 }
Typedefs
Functions
- void initGfxBindings(pybind11::module& m)
-
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:: Vector3 - Get position relative to a camera for a LightInfo and a rendered object.
-
auto getLightsAtBoxCorners(const Magnum::
Range3D& box, const Magnum:: Color4& lightColor = Magnum:: Color4{0.4f}) -> LightSetup - Get a LightSetup with lights at the corners of a box.
-
void setLightSetupForSubTree(scene::
SceneNode& root, const Magnum:: ResourceKey& lightSetup) - Set the light setup for a subtree.
Enum documentation
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. |
Typedef documentation
using esp:: gfx:: LightSetup = std:: vector<LightInfo>
#include <esp/gfx/LightSetup.h>
using esp:: gfx:: ShaderManager = Magnum:: ResourceManager<Magnum:: GL:: AbstractShaderProgram, gfx:: LightSetup, gfx:: MaterialData>
#include <esp/gfx/ShaderManager.h>
Function documentation
void esp:: gfx:: initGfxBindings(pybind11::module& m)
#include <esp/bindings/bindings.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:: Vector3 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.
Parameters | |
---|---|
light | |
transformationMatrix | Describes object position relative to camera |
cameraMatrix | Describes world position relative to camera |
Returns | Magnum::Vector3 Light position relative to camera |
LightSetup esp:: gfx:: getLightsAtBoxCorners(const Magnum:: Range3D& box,
const Magnum:: Color4& lightColor = Magnum:: Color4{0.4f})
#include <esp/gfx/LightSetup.h>
Get a LightSetup with lights at the corners of a box.
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