Author Topic: Rendertexture as input?  (Read 2929 times)

Is it possible to have Unity's rendertexture as Substance's primary input parameter?

I have tried it but it doesn't seem to work. It only seems to accept image from disk.

Anyone tried this? Run time procedural is all great, but it would be much better if input can also change using rendertexture.

If I have to write rendertexture onto disk, that is just not "realtime" enough in my opinion.

Is there any input that I can choose in Substance designer that can accept rendertexture?

If rendertexture doesn't work, will texture2D or texture object work ? ( input them using the script )
 

Hi saehoon,

Texture2D will work. Just note that it will need certain options configured (such as ReadWrite):

http://docs.unity3d.com/ScriptReference/ProceduralMaterial.SetProceduralTexture.html

I'm having a similar dilemma, I've created a Substance Material that uses an input image as a mask to add custom text to the texture in Unity. I've got a text input field that renders out via a camera to a renderTexture, but I'm having trouble figuring out how to convert that to a usable Texture2D.
Sorry for the dumb question, I'm new to coding, I've seen a few scripts like this one, (http://answers.unity3d.com/questions/9969/convert-a-rendertexture-to-a-texture2d.html)  and I'm not sure how or where I need to apply them to get the usable Texture2D that I want.

Hi kcla3d,

It's not a dumb question. I would keep looking at google for examples of converting the image capture of a RenderTexture to Texture2D. Perhaps this one might help?

http://answers.unity3d.com/questions/27968/getpixels-of-rendertexture.html

then once you have your "tex" variable populated, you pass that along to ProceduralMaterial.