model-viewer icon indicating copy to clipboard operation
model-viewer copied to clipboard

Add bloom post-processing effect

Open cdata opened this issue 6 years ago • 11 comments

Depends on #213

cdata avatar Nov 15 '18 23:11 cdata

Hello, I've seen this has been opened for a while. May I help with something?

jcguarinpenaranda avatar Jun 20 '20 17:06 jcguarinpenaranda

@jcguarinpenaranda Absolutely! Contributions are very welcome, and this should be reasonably doable given that three.js already supports it: https://threejs.org/examples/webgl_postprocessing_unreal_bloom.html

We'll want it to be off by default since it has render cost. What kind of parameterization are you considering?

elalish avatar Jun 22 '20 15:06 elalish

Is there any example of how can we use bloom with the model viewer? I want neon light on the model.

ti-hardikshah avatar Jan 12 '21 13:01 ti-hardikshah

No, but you can fork us and add Bloom in our three.js code using their examples. If you'd like to contribute it back when you get it working, that would be much appreciated.

elalish avatar Jan 12 '21 17:01 elalish

nobody up for the task? I might have a stab

AhrenFullStop avatar Sep 14 '21 14:09 AhrenFullStop

@AhrenFullStop By all means! Happy to review. I should really expose a rendering performance metric so we can track how expensive these these features are. I don't have a good sense for it at the moment. As long as it defaults to off it should be fine though.

elalish avatar Sep 14 '21 15:09 elalish

This would be an amazing feature to integrate. I was thinking of trying something like this example - https://p3d.in/jCj24

braedenf avatar Oct 04 '21 00:10 braedenf

hi, will this be implemented any time soon?

Beilinson avatar Nov 06 '22 04:11 Beilinson

Not on my roadmap, but PRs welcome!

elalish avatar Nov 07 '22 17:11 elalish

Not on my roadmap, but PRs welcome!

It should be possible by simply replacing the threeRender.render(scene, scene.camera) line in the Renderer with composer.render() from this example, right? Or is there something else I'm missing in the rendering stack?

In that case all the post-processing effects could be exposed through some simple interface where each one is a singleton and can either get added or removed simply?

Beilinson avatar Nov 07 '22 19:11 Beilinson

That sounds about right, but given the performance hit we'll want it to be optional.

elalish avatar Nov 08 '22 15:11 elalish