Skip to content

Commit

Permalink
add native reflection probe
Browse files Browse the repository at this point in the history
  • Loading branch information
star-e committed Aug 28, 2024
1 parent e173277 commit ef5ea7f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions native/cocos/renderer/pipeline/custom/NativeRenderGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,8 @@ CullingFlags makeCullingFlags(const LightInfo &light) {
void NativeRenderQueueBuilder::addSceneOfCamera(
scene::Camera *camera, LightInfo light, SceneFlags sceneFlags) {
const auto *pLight = light.light.get();
SceneData scene(camera->getScene(), camera, sceneFlags, light, makeCullingFlags(light), light.light);
SceneData scene(camera->getScene(), camera, sceneFlags, light,
makeCullingFlags(light), light.light, geometry::AABB{});
auto sceneID = addVertex2(
SceneTag{},
std::forward_as_tuple("Camera"),
Expand Down Expand Up @@ -809,6 +810,12 @@ void NativeSceneBuilder::useLightFrustum(
}
}

void NativeSceneBuilder::setCullingWorldBounds(const geometry::AABB& aabb) {
auto &sceneData = get(SceneTag{}, nodeID, *renderGraph);
sceneData.cullingFlags |= CullingFlags::WORLD_BOUNDS;
sceneData.worldBounds = aabb;
}

SceneBuilder *NativeRenderQueueBuilder::addScene(
const scene::Camera *camera, SceneFlags sceneFlags,
scene::Light *light, scene::RenderScene *scene) {
Expand All @@ -826,7 +833,8 @@ SceneBuilder *NativeRenderQueueBuilder::addScene(
// Objects are projected to camera by default and are culled further if light is available.
light ? CullingFlags::CAMERA_FRUSTUM | CullingFlags::LIGHT_BOUNDS
: CullingFlags::CAMERA_FRUSTUM,
light),
light,
geometry::AABB{}),
*renderGraph, nodeID);
CC_ENSURES(sceneID != RenderGraph::null_vertex());

Expand Down

0 comments on commit ef5ea7f

Please sign in to comment.