载入中...
搜索中...
未找到
ContactShadow.cpp
浏览该文件的文档.
29 sh = gfx->newShaderFromWgsl({}, std::string(shaders::kContactShadowCommon) + shaders::kContactShadow);
31 std::vector<uint32_t> frag(contact_shadow_frag_spv, contact_shadow_frag_spv + contact_shadow_frag_spv_count);
110void ContactShadow::setCamera(float eyeX, float eyeY, float eyeZ, float targetX, float targetY, float targetZ,
117 glm::lookAtRH(glm::vec3(eyeX, eyeY, eyeZ), glm::vec3(targetX, targetY, targetZ), glm::vec3(upX, upY, upZ));
134void ContactShadow::setThickness(float thickness) { thickness_ = thickness > 1e-4f ? thickness : 1e-4f; }
136void ContactShadow::setIntensity(float intensity) { intensity_ = intensity < 0.f ? 0.f : intensity; }
165 const float dw = gfx->getCanvas() ? float(gfx->getCanvas()->getWidth()) : float(gfx->getWidth());
166 const float dh = gfx->getCanvas() ? float(gfx->getCanvas()->getHeight()) : float(gfx->getHeight());
168 gfx->drawTexturedRectShaderDepth(hwDepth, worldNormal, shader_, 0.f, 0.f, dw, dh, Color(1.f, 1.f, 1.f, 1.f));
170 gfx->drawTexturedRectShaderUV(hwDepth, shader_, 0.f, 0.f, dw, dh, 0.f, 0.f, 1.f, 1.f, Color(1.f, 1.f, 1.f, 1.f),
void setInvViewProj(const glm::mat4 &invViewProj)
Sets the inv view proj.
Definition ContactShadow.cpp:105
void setQuality(const std::string &quality)
"low" | "medium" | "high" (unknown → medium).
Definition ContactShadow.cpp:100
void applyFromGBuffer(Graphics *gfx, Texture *hwDepth, Texture *worldNormal)
Darken the current target using contact shadows from GBuffer depth.
Definition ContactShadow.cpp:159
void setIntensity(float intensity)
Sets the darkening intensity in [0, +inf).
Definition ContactShadow.cpp:136
void setThickness(float thickness)
Sets the contact thickness in view-space meters.
Definition ContactShadow.cpp:134
void setLightDirection(float x, float y, float z)
World-space direction toward the light (normalized on write). Matches Light3D directional convention ...
Definition ContactShadow.cpp:126
ContactShadow(Graphics *gfx)
Owns post shaders created from the borrowed Graphics factory.
Definition ContactShadow.cpp:68
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*.
Definition ContactShadow.cpp:110
void setStartBias(float bias)
Sets the start bias along normal/light in world units.
Definition ContactShadow.cpp:138
Definition Graphics.h:134
virtual void drawTexturedRectShaderUV(Texture *texture, Shader *shader, float x, float y, float w, float h, float u0, float v0, float u1, float v1, const Color &color, bool rotatedUV=false, BlendMode blend=BlendMode::Alpha)=0
UV draw with an explicit Shader (nullptr = default textured pipeline).
virtual void drawTexturedRectShaderDepth(Texture *color, Texture *depth, Shader *shader, float x, float y, float w, float h, const Color &tint)=0
Fullscreen/post draw sampling color at binding 0 and depth at binding 1 (hardware D32,...
void sendFloat(const std::string &name, float x)
Definition Shader.cpp:107
void sendMatrix(const std::string &name, const glm::mat4 &m)
Definition Shader.cpp:124
GPU texture created via Graphics::newTexture. Owns GPU resources through an opaque backend handle.
Definition Texture.h:15
constexpr const char * kContactShadowCommon
Definition ContactShadowWgsl.h:6
constexpr const char * kContactShadow
Definition ContactShadowWgsl.h:32
卡牌游戏 UI 工具模块:工厂 + 脚本绑定入口。 功能参考 ycarowr/UiCard:扇形手牌布局、抽牌/洗牌、悬浮放大、拖拽到落牌区、 敌方手牌(背面/偷看)、费用不足置灰,以及可实时调节的布局...
Definition Animation.h:25
glm::mat4 perspectiveVulkanRH_ZO(float fovyRad, float aspect, float zNear, float zFar)
Right-handed, zero-to-one depth perspective for Vulkan swapchains.
Definition ClipSpace.h:22
eve::Color Color
RGBA color used by every graphics draw call. Lives inside eve::graphics so including a graphics heade...
Definition Color.h:13
@ Alpha