Vertex shader in post effects. Increase vertex quantity

Good morning everybody.

I’ve noticed that for custom post effects we have only 4 vertices, which makes sense, but it’s limited.

I achieved the effect I need by using Fragment shaders, but it’s a waste or resources and the phone gets hot, which forces Chrome to shut down after a while…

Is there any way to increase the number of vertices?

Thanks.

Hi @dadiaar,

That’s interesting, I never thought using more vertices on a post effect. The primitive for the screen quad is definite here, without patching the engine I am not sure you can change it:

@mvaligursky may have a point of view in that.

1 Like

Hi Leonidas

Thanks for your reply. I’ll give a try to that.

As example, have you seen a wave effect? I saw an example here, I don’t recall the URL, but basically, it was a fragment shader. 2M operations each frame when a vertex shader could do a few dozens/hundreds only.

Have a nice day.

A wave effect usually won’t be a post process effect but a shader applied to a regular model. There you have full control over what model that is.

If you would like to render it on screen space, you can potentially scale it to fill the whole viewport.

This would work. Use another ortogonal camera with a plane in front of it, a material, etc. It’s just not optimal.

Interestingly enough, the example I was talking about was in a question you asked: wave effect

I’m looking for a fast way to test your idea using the editor, but if I can’t find it soon, I’ll have to do as you said and compile my own thing.

Thanks.

1 Like