How many pixels are rendered using Draw Material to Render Target ?

I’m wondering how many pixels are rendered when I render a material directly to a render target using the Draw Material to Render Target node.

My understanding is that with Unreal materials, the pixel shader is run once for each pixel, and the vertex shader run once for each vertex.

I guess the pixel shader is run once for every pixel of the render target’s Size, so if the render target is 10x10 then the pixel shader would be run 100 times ?

I wonder how many times would the vertex shader be run, maybe 4 times for the ‘quad’ that is rendered ?

If you want to use a render target, and you want it to look good on larger screens ( even if it only takes up 1/3 of the main screen ), it has to be basically the same size as the screen you’re playing the game on. And you end up rendering two frames for every one.

It’s a very heavy operation.

I’m assuming drawing a material to a render target has to be much less?

Yes I’m using the Draw Material to Render Target to calculate the delta of Gerstner ocean waves in a material, then stash the output to a render target.

From there I can read values from the render target in blueprint, use the render target in materials to apply world displacement, repeat the waves pattern into the far distance etc. without re-calculating the ocean waves again and again.

1 Like

Sounds interesting :slight_smile:

Right - That is my understanding, (in general, and for an unlit pixel) that there will be an invocation for each pixel drawn (there’s actually more to it than this, but it’s a simple close enough model of what is usually happening). The vertex shader is once per vertex and then simply interpolated. This is why the custom UV / Vertex Interpolator workflow is so powerful. In the vast majority of cases, (especially prior to nanite, but likely even still) there will be far fewer vertices on screen than pixels.
In the case of the render material to target, yes, expect roughly the number of pixels to be invoked by the PS and 4 invocations of the VS.