Orillusion / orillusion

Orillusion is a pure Web3D rendering engine which is fully developed based on the WebGPU standard.
https://www.orillusion.com
MIT License
4.47k stars 551 forks source link

[BUG]: 设置拾取模式为pixel后,添加bloompost报错 #382

Closed OriIIusion closed 1 month ago

OriIIusion commented 5 months ago

Bug描述

设置拾取模式为pixel后,添加bloompost报错,无法添加bloom 将拾取模式的代码注释以后,可以添加bloom

Bug复现流程

https://codepen.io/OriIIusion/pen/gOyWaEq 看此案例 1.默认开启pick,然后添加bloom,发现报错了,bloom没添加上 2.将pickmode代码注释掉,bloom可以正常添加

报错截图

image

测试引擎版本:

0.7.2

hellmor commented 4 months ago

Bloom的effect添加方式不对。你的sample中添加成功后效果如下 image

将BloomPost的添加方式改为 let job = Engine3D.startRenderView(this.view); job.addPost(new BloomPost())

OriIIusion commented 4 months ago

感谢指点,已解决。

目前文档中只有通过以下一种方式添加 let postProcessing = this.scene.addComponent(PostProcessingComponent); postProcessing.addPost(BloomPost);

建议增加说明还有另一种添加的方式,并且增加提示按原来的方式添加和设置拾取模式为pixel时会发生冲突

OriIIusion commented 4 months ago

发现了一种新的解决办法

Engine3D.startRenderView()源码中有这段 if (this.setting.pick.mode == "pixel") { let postProcessing = view.scene.getOrAddComponent(PostProcessingComponent); postProcessing.addPost(FXAAPost); }

所以这样也可以添加 let post = scene.getOrAddComponent(PostProcessingComponent); post.addPost(BloomPost);

lslzl3000 commented 1 month ago

resolved in v0.8