Comments (3)
Update: The exact engine version is 3.8.2. I test the official cocos-example-projects/occlusion-query project with builtin engine (version 3.8.2), build a windows debug application, setOcclusionQueryEnabled() triggers the same error.
In occlusion-query.ts, I add director.root.pipeline.pipelineSceneData.getOctree();, this function is triggered. The modified function onToggle() in occlusion-query.ts is as follows:
onToggle (toggle: Toggle) {
if (NATIVE) {
director.root.pipeline.pipelineSceneData.getOctree();
director.root.pipeline.setOcclusionQueryEnabled(toggle.isChecked);
}
log('Occlusion query enabled: ' + toggle.isChecked);
}
Why method of PipelineSceneData could be called, while method of RenderPipeline could not? The difference of the two classes I see is PipelineSceneData directly derives from RefCounted, while RenderPipeline does not.
BTW, RenderPipeline::getOcclusionQueryEnabled() seems deleted, so I deleted line 15 of occlusion-query.ts:
this.toggleOcclusionQuery.isChecked = director.root.pipeline.getOcclusionQueryEnabled();
from cocos-engine.
Found the problem. Since v3.6.0, the engine has re-implemented Native render pipeline. When calling director.root.pipeline in TypeScript, Native version will return an instance of RenderPipelineBridge (defined in Root.cpp), which derives from PipelineRuntime cpp class, while TypeScript version will return an instance of RenderPipeline (not a cpp class, defined in render-pipeline.ts).
The official cocos-example-projects are based on engine version 3.4.0, I guess native version of director.root.pipeline returns an instance of RenderPipeline (cpp class, defined in RenderPipeline.h)
from cocos-engine.
Found the problem. Since v3.6.0, the engine has re-implemented Native render pipeline. When calling director.root.pipeline in TypeScript, Native version will return an instance of RenderPipelineBridge (defined in Root.cpp), which derives from PipelineRuntime cpp class, while TypeScript version will return an instance of RenderPipeline (not a cpp class, defined in render-pipeline.ts).
The official cocos-example-projects are based on engine version 3.4.0, I guess native version of director.root.pipeline returns an instance of RenderPipeline (cpp class, defined in RenderPipeline.h)
Sorry for the inconvenience.
To support custom render pipeline in 3.6.0, we have refactored the native engine.
The custom pipeline and legacy pipeline share the common PipelineRuntime
interface.
Native RenderPipeline
cannot be access from typescript anymore, as we are moving forward to the custom pipeline.
Currently, occlusion query is not well supported in custom pipeline. The reason is that we have not yet worked out a cross-platform solution.
We might support occlusion query in the future release, and are also considering other methods such as PVS (potential visible set).
from cocos-engine.
Related Issues (20)
- s HOT 2
- when a picture be set to sprite-frame, then use texture and sprite-frame resources will occur errors
- Splash Setting occur 403 forbidden, while update it from others
- Setting import-map.json to Import Map,after clear the path of it, it still occur error in the packing HOT 2
- [EDITOR相关] 试图选择 复杂属性中的text框内的文本时, 变成拖拽这个属性了
- collide Events needs rigidbody in Cocos 3.8x but dont need in Cocos 3.7.4
- AssetsManagerEx.cpp AssetsManagerEx::prepareUpdate, cost a lot of times HOT 2
- 【Android】在Cocos所在的Activity的被其他的Activity覆盖或者不可见的时候出现JNI ERROR HOT 1
- Douyin mini-game platform videoplayer progress bar has no rolling ball
- preview the project then it occurs error "fc1977d5-d6f8-4f99-bf65-b9f1f60393b7.json" 404 (Not Found)
- autoAtlas pack costs a lot of time
- Unable to attach file image in android webview HOT 1
- 希望官方能把官方出品的几个cocos的vscode插件上传到 https://open-vsx.org/ 上.
- When install NPM package fflate, build the project it occur errors
- When install NPM package fflate, import it in the project it occur errors
- logic differences in gfx-vulkan/VKCommandBuffer.cpp
- Some unused variables, please have a check
- vivo 小游戏不能使用TTF字体
- Set the Custom pipeline, the shadow color change from light dark to green HOT 1
- compress texture has any optimization of its speed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cocos-engine.