Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

RDHitGroup

实验性: This class may be changed or removed in future versions.

继承: RefCounted < Object

命中组(由 RenderingDevice 使用)。

描述

定义一个用于 RenderingDevice.raytracing_pipeline_create() 的 命中组(Hit Group)。

当光线与几何体相交时,命中组会组合执行相应的着色器。它可能包含一个 最近命中(closest-hit) 着色器、任意命中(any-hit) 着色器和 相交(intersection) 着色器。

在使用 RenderingDevice.hit_sbt_range_update() 填充命中着色器绑定表(Hit Shader Binding Tables)时,通过索引引用命中组。

属性

RDPipelineShader

any_hit_shader

RDPipelineShader

closest_hit_shader

RDPipelineShader

intersection_shader


属性说明

RDPipelineShader any_hit_shader 🔗

该命中组的“任意命中”(Any-hit)着色器。针对每一个潜在的相交点执行。可以为 null


RDPipelineShader closest_hit_shader 🔗

该命中组的“最近命中”(Closest-hit)着色器。仅针对距离光线起点最近的那个交点执行。可以为 null


RDPipelineShader intersection_shader 🔗

该命中组的“相交”(Intersection)着色器。针对非三角形几何体为必需项。若用于三角形几何体,则必须设为 null