Did BBL Have Some API Like Threejs FsQuad?

I want to write a postprocess. In this pps before I render it into main textureSampler, I need to render 4 RenderTargetTexture(RTT) with shaders. In Unity/threejs we can use blit /fsquad to render a shader and output to specified RTT, but in BBL, I don’t find any way like these to render sth into RTT.
RTT in unity/threejs just look like texture, RTT in BBL is very complicated and more like a probe?

Specify an effect/shader/material
Specify a RenderTargetTexture
And render into RTT

@Evgeni_Popov can definitely help with that one :slight_smile:

In parallel something like this would work: Babylon.js Playground

1 Like

I’m not sure to understand, is TextureTools.ApplyPostProcess what you want? It takes a post process (a shader) and a texture as input and render a full quad in the texture by using this shader.

Note the texture is an InternalTexture, you can get it from a RenderTargetTexture by doing rtt.getInternalTexture().


That EffectWrapper is!!!
But I have a trouble that if I use EffectWrapper in postprocess, postProcess didn’t work(It will output lastest effectWrapper output)
This is PG:

onApplyObservable is notified before onBeforeRenderObservable :sob: :sob: :sob:

I force to change onapply to make pps work :sob: :sob: :sob:
I think it is not the best way

I am not sure why not using @Evgeni_Popov technique then ?

I need to render them every frame, TextureTools.ApplyPostProcess will create a renderTargetWrapper and a postprocess to render pps into RTT, and dispose them after render.

so you can create your RTT, and then like in the code above use scene.postProcessManager.directRender ? It is what we do for shadows or effectLayer for instance

1 Like

Yes, I use EffectRenderer(ER) to render shader into RTT.
I preconceived that onBeforeRenderObservable is called before onApplyObservable and ER must be used before onApply called. So I use ER in callback of onBeforeRenderObservable, it is always working wrong. I have a try to use ppsManager.directRender, it works wrong too.
Finally, I find that onBeforeRender is called after onApply, I override pps.apply , and ER work correctly.

It look nice :grin: :grin: :grin:

@Evgeni_Popov Thank you all :smiley: :smiley: :smiley: