diff --git a/native/cocos/renderer/pipeline/ReflectionProbeBatchedQueue.cpp b/native/cocos/renderer/pipeline/ReflectionProbeBatchedQueue.cpp index c72e9a95cc..6d30749188 100644 --- a/native/cocos/renderer/pipeline/ReflectionProbeBatchedQueue.cpp +++ b/native/cocos/renderer/pipeline/ReflectionProbeBatchedQueue.cpp @@ -43,7 +43,12 @@ #include "scene/Define.h" namespace cc { namespace pipeline { -const static uint32_t REFLECTION_PROBE_DEFAULT_MASK = ~static_cast(LayerList::UI_2D) & ~static_cast(LayerList::PROFILER) & ~static_cast(LayerList::UI_3D); +const static uint32_t REFLECTION_PROBE_DEFAULT_MASK = ~static_cast(LayerList::UI_2D) + & ~static_cast(LayerList::PROFILER) + & ~static_cast(LayerList::UI_3D) + & ~static_cast(LayerList::GIZMOS) + & ~static_cast(LayerList::SCENE_GIZMO) + & ~static_cast(LayerList::EDITOR); const ccstd::string CC_USE_RGBE_OUTPUT = "CC_USE_RGBE_OUTPUT"; const cc::scene::IMacroPatch MACRO_PATCH_RGBE_OUTPUT{ CC_USE_RGBE_OUTPUT, true}; ReflectionProbeBatchedQueue::ReflectionProbeBatchedQueue(RenderPipeline *pipeline) diff --git a/native/cocos/renderer/pipeline/reflection-probe/ReflectionProbeFlow.cpp b/native/cocos/renderer/pipeline/reflection-probe/ReflectionProbeFlow.cpp index 2d0dea2219..65b692d6f0 100644 --- a/native/cocos/renderer/pipeline/reflection-probe/ReflectionProbeFlow.cpp +++ b/native/cocos/renderer/pipeline/reflection-probe/ReflectionProbeFlow.cpp @@ -64,7 +64,7 @@ void ReflectionProbeFlow::render(scene::Camera *camera) { const auto *sceneData = _pipeline->getPipelineSceneData(); const auto probes = scene::ReflectionProbeManager::getInstance()->getAllProbes(); for (auto * probe : probes) { - if (probe->needRender()) { + if (probe->needRender() && probe->getProbeType() == scene::ReflectionProbe::ProbeType::PLANAR) { renderStage(camera, probe); } } diff --git a/native/cocos/scene/ReflectionProbe.h b/native/cocos/scene/ReflectionProbe.h index fad90bd9bb..ed63567eb9 100644 --- a/native/cocos/scene/ReflectionProbe.h +++ b/native/cocos/scene/ReflectionProbe.h @@ -103,6 +103,12 @@ public: inline void setCameraNode(Node* val) { _cameraNode = val; } inline Node* getCameraNode()const { return _cameraNode; } + inline void setPreviewSphere(Node* val) { _previewSphere = val; } + inline const Node* getPreviewSphere() const { return _previewSphere; } + + inline void setPreviewPlane(Node* val) { _previewPlane = val; } + inline const Node* getPreviewPlane() const { return _previewPlane; } + inline RenderTexture* getRealtimePlanarTexture() const { return _realtimePlanarTexture; } void updateBoundingBox(); void syncCameraParams(const Camera* camera); @@ -150,6 +156,8 @@ private: IntrusivePtr _node; IntrusivePtr _cameraNode; + IntrusivePtr _previewSphere; + IntrusivePtr _previewPlane; /** * @en The AABB bounding box and probe only render the objects inside the bounding box. diff --git a/native/tools/swig-config/scene.i b/native/tools/swig-config/scene.i index 05a1d4bba9..12fe53405b 100644 --- a/native/tools/swig-config/scene.i +++ b/native/tools/swig-config/scene.i @@ -532,6 +532,8 @@ using namespace cc; %attribute(cc::scene::ReflectionProbe, uint32_t, visibility, getVisibility, setVisibility); %attribute(cc::scene::ReflectionProbe, cc::Vec3&, size, getBoudingSize, setBoudingSize); %attribute(cc::scene::ReflectionProbe, cc::geometry::AABB *, boundingBox, getBoundingBox); +%attribute(cc::scene::ReflectionProbe, cc::Node*, previewSphere, getPreviewSphere, setPreviewSphere); +%attribute(cc::scene::ReflectionProbe, cc::Node*, previewPlane, getPreviewPlane, setPreviewPlane);