Output multiple textures from shader


#1

This is a follow up on a problem I described here where I am using a using a technique described as “Render to Texture/UV” which can be used for texture baking. I need it to create a feedback effect based on world position. More info on this here

This is working okay. But I would now like to make this spreadable using multiple geometries on the same shader. So basically I need to write multiple textures per shader.

As I learned it’s not easily possible to output multiple geometries on a geometry shader I was wondering if the same applies to textures?

My questions in short:

How can I output multiple textures from a shader?
Is using textured3d a solution? Is there an example I could look at? And how can I then turn texture3d into a spread of texture2d for further usage in vvvv?

Thanks a lot!


#2

Texture2DArray is your answer


#3

or Renderer (Texture Spread)


#4

Thanks! Both sound like great ideas but how can I assign every geometry to a separate texture? Seems like everything upstream of the Layer pin is non-spreadable in Renderer (TextureArray) and Renderer
(TextureSpread). The geometries get merged all into all textures whereas I need them separate.


#5

checkout ViewportRouter, ViewportIndex and SelectViewport nodes in DX11, and their help patches ;)


#6

just in case
SV_RenderTargetArrayIndex.zip (2.3 KB)


#7

@microdee and @antokhio: Wow! That opens up a new world to me. Thank you. :)

@antokhio your patch does exactly what I was looking for.