对选定网格进行后处理 [英] Post-processing to selected meshes
本文介绍了对选定网格进行后处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在three.js中,是否可以仅将后处理效果应用于选定的网格?
例如,具有带颗粒效果的立方体,而场景的其余部分则没有. 谢谢!
解决方案
是. three.js示例,其中显示了如何使用遮罩将后处理应用于选定的网格. >
我认为可以提高示例的清晰度,但是您可以像这样修改示例:
composer4 = new THREE.EffectComposer( renderer, new THREE.WebGLRenderTarget( rtWidth, rtHeight, rtParameters ) );
composer4.addPass( renderScene );
composer4.addPass( renderMask );
composer4.addPass( effectDotScreen );
composer4.addPass( clearMask );
composer4.addPass( effectVignette );
您将获得如下输出:
这是一个复杂的示例,因此您将必须仔细研究.
three.js.r.77
In three.js is it possible to apply postprocessing effects only to selected meshes?
For example to have a cube with grain effect while the rest of the scene does not have it. Thank you!
解决方案
Yes. There is a three.js example that shows how to apply postprocessing to selected meshes using masking.
I think that example can be improved for clarity, but you can modify the example like so:
composer4 = new THREE.EffectComposer( renderer, new THREE.WebGLRenderTarget( rtWidth, rtHeight, rtParameters ) );
composer4.addPass( renderScene );
composer4.addPass( renderMask );
composer4.addPass( effectDotScreen );
composer4.addPass( clearMask );
composer4.addPass( effectVignette );
You will get an output like this:
It is a complicated example, so you will have to study it carefully.
three.js.r.77
这篇关于对选定网格进行后处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文