Suggestions for blurring a DynamicTexture used in NodeMaterial?

I have a DynamicTexture supporting user drawing operations (using canvas) that feeds in as an input to a NodeMaterial.

I’d like to blur this texture, but setting a blur filter on the canvas has odd results when I do prolonged drawing operations.

If that doesn’t work correctly for me, I’m fine with blurring it when it’s rendered, but I’m not sure how to do that in a NodeMaterial.

Since I’m using lighting info / shadows on the material, is my best bet to convert this to a custom shader rendering the diffuseTexture on a StandardMaterial? I’ve implemented blurring in a custom shader before, so I know I could get that to work.

Is there perhaps some built in way to heavily blur the texture as it goes through the system (beyond what setting the sampling mode can do)?

You could probably use some post process as we have some nice kernel blur ones ?

Can you use that on a texture without applying it to the rendered scene?

you could use the direct render function of the postprocessmanager like we do in our shadowGenerator: this._scene.postProcessManager.directRender(this._blurPostProcesses, texture, true);

1 Like

Thanks a bunch, I’ll give it a shot!

1 Like

I wasn’t able to get the post processing working, but I did find my canvas blur issue. I wasn’t closing the stroke paths, and so as it restroked them, it filled in all the antialiasing making it look like it hadn’t done it at all.