ShaderToy PostProcess

I’m trying to apply this ShaderToy on a PostProcess but I don’t understand what is wrong.
Can anyone help me?

With PostProcess: https://playground.babylonjs.com/#8Z0MKW#26
Without: https://playground.babylonjs.com/#8Z0MKW#27

ShaderToy: https://www.shadertoy.com/view/MdSyWh

In the t function, it is texture2D(textureSampler, p, m) and not texture2D(textureSampler, p/m).

Also, you should set a sampler which is using trilinear mapping, as the post process is relying on sampling the mipmaps (that’s the 3rd parameter of texture2D, which is really a textureLod in this case):

3 Likes

Amazing, nice works perfectly.
But I notice it’s very low quality, I think sampling mipmaps won’t give smooth glow.

Do you know of any examples of nice glows/blooms?
I’ve tried using the built-in ones, but they burn the image like crazy.

The built-in ones have some settings to control the effect: have you tried to use them?

Did you try to use the Default Rendering Pipeline where one may tune different parameters of Glow and Bloom effects?

Yes, I have used the Glow and Bloom extensively. But I’m trying to get a more UE5 feel type of bloom/glow.
Going for those those sort of soft blurs, bleeding highlights, with no burnt whites.
Something like these:
Example 1
Example 2
Example 3
What would you recommend to achieve that?

In your testings, have you used hdr setting? For eg, for the DefaultRenderingPipeline, it means to pass true as the 2nd parameter. It can make a huge difference.

1 Like

Could you help me figure out what I need to change to make this other shader work? :pray:
https://playground.babylonjs.com/#8Z0MKW#29

texture2DProj should be renamed textureProj.

However, it still won’t work because the effect is not a post-process, it is a shader material that must be applied to meshes. You will also need to set a value for projectionMatrix, modelViewMatrix and tDiffuse.

2 Likes