Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
OriIIusion opened this issue Mar 22, 2024 · 3 comments
Open

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

OriIIusion opened this issue Mar 22, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@OriIIusion
Copy link
Contributor

Bug描述

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

Bug复现流程

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

报错截图

image

测试引擎版本:

0.7.2

@OriIIusion OriIIusion added the bug Something isn't working label Mar 22, 2024
@hellmor
Copy link
Collaborator

hellmor commented Apr 21, 2024

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

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

@OriIIusion
Copy link
Contributor Author

感谢指点,已解决。

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

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

@OriIIusion
Copy link
Contributor Author

发现了一种新的解决办法

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants