fix the native engine preview sphere to show black (#13745)

* surface shader error

* ci error

* preview

* fix crash
This commit is contained in:
徐兵
2022-12-09 10:01:20 +08:00
committed by GitHub
parent d74e6998e3
commit 8aeb4fc098
4 changed files with 17 additions and 2 deletions
@@ -43,7 +43,12 @@
#include "scene/Define.h"
namespace cc {
namespace pipeline {
const static uint32_t REFLECTION_PROBE_DEFAULT_MASK = ~static_cast<uint32_t>(LayerList::UI_2D) & ~static_cast<uint32_t>(LayerList::PROFILER) & ~static_cast<uint32_t>(LayerList::UI_3D);
const static uint32_t REFLECTION_PROBE_DEFAULT_MASK = ~static_cast<uint32_t>(LayerList::UI_2D)
& ~static_cast<uint32_t>(LayerList::PROFILER)
& ~static_cast<uint32_t>(LayerList::UI_3D)
& ~static_cast<uint32_t>(LayerList::GIZMOS)
& ~static_cast<uint32_t>(LayerList::SCENE_GIZMO)
& ~static_cast<uint32_t>(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)
@@ -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);
}
}
+8
View File
@@ -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> _node;
IntrusivePtr<Node> _cameraNode;
IntrusivePtr<Node> _previewSphere;
IntrusivePtr<Node> _previewPlane;
/**
* @en The AABB bounding box and probe only render the objects inside the bounding box.
+2
View File
@@ -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);