16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 00:09:19 +02:00

refractive material support contd.

This commit is contained in:
Wls50
2025-11-24 18:29:55 +01:00
committed by Hirek
parent ff50fdf110
commit 76d5d3831d
9 changed files with 35 additions and 14 deletions

View File

@@ -1584,13 +1584,17 @@ void NvRenderer::BindConstants(const RenderPass &pass,
bool NvRenderer::BindMaterial(material_handle handle, DrawType draw_type,
const RenderPass &pass,
nvrhi::GraphicsState &gfx_state,
float &alpha_threshold) {
float &alpha_threshold, bool *out_is_refractive) {
if (pass.m_type == RenderPassType::RendererWarmUp) return true;
if (!handle || handle > m_material_cache.size()) {
return false;
}
MaterialCache &cache = m_material_cache[handle - 1];
if(out_is_refractive) {
*out_is_refractive = cache.m_template->m_enable_refraction;
}
if (!cache.ShouldRenderInPass(pass)) return false;
auto pipeline_index = Constants::GetPipelineIndex(pass.m_type, draw_type);