TFX in loop


When calling update from a wrapped TFX in a loop it is not possible to called twice the same class. It must be done from different instances.

See patch : (49.8 KB)

Is there a reason for such behavior ?


Yes, when you call Update on a TextureFX you will schedule a draw call that will be executed after the Update of your app in the Draw time slice of your app. So probably only the last draw call schedule that happened on Update will be executed on Draw.

Also, in the patch, you assign the output texture as input to itself, it cannot read and write to the same texture in one draw call. Each TextureFX is the owner of one texture that it uses as render target, ifyou want to create a feedback like that, you have to use CopyTexture to create a copy that you can assign as input to itself.

Bonus tip:

there are a few textures that are always available, you don’t need to ship one.