Back to main page

Post effect

This interface can be seen as one method because it is only divided into 3 calls for version compability and to avoid writing a lot of unused values.

void PostEffect_RenderShader(int OutputSurface, int PostEffect);

OutputSurface must refer to a valid draw surface that is not the final draw surface and PostEffect must refer to a valid shader loaded as a post effect. If you are reading the color buffer from the same draw surface that you are rendering to, it must have an extra color buffer.

Render PostEffect to OutputSurface with the given list of surfaces and vectors. The input surfaces and vectors are cleared to NULL and (0,0,0,0) to clean up for the next render of a post effect.

void PostEffect_GiveInputSurface(int Index, int DrawSurfaceOrTexture, int SubresourceType);

if SubresourceType = 0 then DrawSurfaceOrTexture will give it's color buffer. Every surface have a color buffer.

if SubresourceType = 1 then DrawSurfaceOrTexture will give it's depth buffer if it has any.

0 ≤ Index ≤ 15, drawSurfaceOrTexture must refer to a valid draw surface or texture, 0 <= SubresourceType <= 1 and the selected SubresourceType must exist in DrawSurfaceOrTexture.

Inserts the DrawSurfaceOrTexture at Index in the input to PostEffect_RenderShader.

void PostEffect_GiveInputVector(int Index, float X, float Y, float Z, float W);

The most common mistake with this call is to forget that the first argument is the index and not another float.

0 ≤ Index ≤ 15.

Places (X,Y,Z,W) at Index in the input to PostEffect_RenderShader.