载入中...
搜索中...
未找到
eve::graphics::ContactShadow类 参考

Screen-space contact shadows for the primary directional light. 更多...

#include <ContactShadow.h>

Public 成员函数

 ContactShadow (Graphics *gfx)
 Owns post shaders created from the borrowed Graphics factory.
 
 ~ContactShadow ()
 Releases owned shaders.
 
 ContactShadow (const ContactShadow &)=delete
 
ContactShadow & operator= (const ContactShadow &)=delete
 
void setQuality (const std::string &quality)
 "low" | "medium" | "high" (unknown → medium).
 
std::string getQuality () const
 Returns the quality.
 
void setCamera (float eyeX, float eyeY, float eyeZ, float targetX, float targetY, float targetZ, float upX, float upY, float upZ, float fovYDeg, float aspect, float nearZ, float farZ)
 Camera for depth reconstruction (RH + ZO). Builds inv(viewProj) and near/far used by apply*.
 
void setInvViewProj (const glm::mat4 &invViewProj)
 Sets the inv view proj.
 
void setLightDirection (float x, float y, float z)
 World-space direction toward the light (normalized on write). Matches Light3D directional convention (points to the light).
 
void setLength (float length)
 Sets the ray length in world units.
 
void setThickness (float thickness)
 Sets the contact thickness in view-space meters.
 
void setIntensity (float intensity)
 Sets the darkening intensity in [0, +inf).
 
void setStartBias (float bias)
 Sets the start bias along normal/light in world units.
 
float getLength () const
 Returns the ray length.
 
float getThickness () const
 Returns the thickness.
 
float getIntensity () const
 Returns the intensity.
 
float getStartBias () const
 Returns the start bias.
 
int getStepCount () const
 Returns the step count for the active quality.
 
void applyFromGBuffer (Graphics *gfx, Texture *hwDepth, Texture *worldNormal)
 Darken the current target using contact shadows from GBuffer depth.
 
Shader * getShader () const
 Returns the owned contact-shadow shader. @lifetime Returned shader is borrowed and owned by Graphics.
 

详细描述

Screen-space contact shadows for the primary directional light.

Ray-marches a short distance along the light direction through the GBuffer hardware depth attachment and darkens the already-lit scene with a black alpha overlay (same blending contract as AmbientOcclusion overlays).

@thread Render thread only.

在文件 ContactShadow.h 第 23 行定义.

构造及析构函数说明

◆ ContactShadow() [1/2]

eve::graphics::ContactShadow::ContactShadow ( Graphics *  gfx)
explicit

Owns post shaders created from the borrowed Graphics factory.

在文件 ContactShadow.cpp 第 68 行定义.

◆ ~ContactShadow()

eve::graphics::ContactShadow::~ContactShadow ( )
default

Releases owned shaders.

◆ ContactShadow() [2/2]

eve::graphics::ContactShadow::ContactShadow ( const ContactShadow &  )
delete

成员函数说明

◆ applyFromGBuffer()

void eve::graphics::ContactShadow::applyFromGBuffer ( Graphics *  gfx,
Texture *  hwDepth,
Texture *  worldNormal 
)

◆ getIntensity()

float eve::graphics::ContactShadow::getIntensity ( ) const
inline

Returns the intensity.

在文件 ContactShadow.h 第 68 行定义.

◆ getLength()

float eve::graphics::ContactShadow::getLength ( ) const
inline

Returns the ray length.

在文件 ContactShadow.h 第 64 行定义.

◆ getQuality()

std::string eve::graphics::ContactShadow::getQuality ( ) const
inline

Returns the quality.

在文件 ContactShadow.h 第 36 行定义.

◆ getShader()

Shader * eve::graphics::ContactShadow::getShader ( ) const
inline

Returns the owned contact-shadow shader. @lifetime Returned shader is borrowed and owned by Graphics.

在文件 ContactShadow.h 第 83 行定义.

◆ getStartBias()

float eve::graphics::ContactShadow::getStartBias ( ) const
inline

Returns the start bias.

在文件 ContactShadow.h 第 70 行定义.

◆ getStepCount()

int eve::graphics::ContactShadow::getStepCount ( ) const
inline

Returns the step count for the active quality.

在文件 ContactShadow.h 第 72 行定义.

◆ getThickness()

float eve::graphics::ContactShadow::getThickness ( ) const
inline

Returns the thickness.

在文件 ContactShadow.h 第 66 行定义.

◆ operator=()

ContactShadow & eve::graphics::ContactShadow::operator= ( const ContactShadow &  )
delete

◆ setCamera()

void eve::graphics::ContactShadow::setCamera ( float  eyeX,
float  eyeY,
float  eyeZ,
float  targetX,
float  targetY,
float  targetZ,
float  upX,
float  upY,
float  upZ,
float  fovYDeg,
float  aspect,
float  nearZ,
float  farZ 
)

Camera for depth reconstruction (RH + ZO). Builds inv(viewProj) and near/far used by apply*.

在文件 ContactShadow.cpp 第 110 行定义.

引用了 fovRad, eve::graphics::perspectiveVulkanRH_ZO(), proj, eve::graphics::Shader::sendFloat(), setInvViewProj(), targetX , 以及 view.

◆ setIntensity()

void eve::graphics::ContactShadow::setIntensity ( float  intensity)

Sets the darkening intensity in [0, +inf).

在文件 ContactShadow.cpp 第 136 行定义.

◆ setInvViewProj()

void eve::graphics::ContactShadow::setInvViewProj ( const glm::mat4 &  invViewProj)

Sets the inv view proj.

在文件 ContactShadow.cpp 第 105 行定义.

引用了 invViewProj , 以及 eve::graphics::Shader::sendMatrix().

被这些函数引用 eve::graphics::RenderSystem3D::render() , 以及 setCamera().

◆ setLength()

void eve::graphics::ContactShadow::setLength ( float  length)

Sets the ray length in world units.

在文件 ContactShadow.cpp 第 132 行定义.

引用了 length.

◆ setLightDirection()

void eve::graphics::ContactShadow::setLightDirection ( float  x,
float  y,
float  z 
)

World-space direction toward the light (normalized on write). Matches Light3D directional convention (points to the light).

在文件 ContactShadow.cpp 第 126 行定义.

引用了 d, x, y , 以及 z.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ setQuality()

void eve::graphics::ContactShadow::setQuality ( const std::string &  quality)

"low" | "medium" | "high" (unknown → medium).

在文件 ContactShadow.cpp 第 100 行定义.

被这些函数引用 eve::graphics::RenderSystem3D::render().

◆ setStartBias()

void eve::graphics::ContactShadow::setStartBias ( float  bias)

Sets the start bias along normal/light in world units.

在文件 ContactShadow.cpp 第 138 行定义.

引用了 bias.

◆ setThickness()

void eve::graphics::ContactShadow::setThickness ( float  thickness)

Sets the contact thickness in view-space meters.

在文件 ContactShadow.cpp 第 134 行定义.

引用了 thickness.


该类的文档由以下文件生成: