Hello,
Is it possible to render a material's output directly to a texture? I've seen plenty of tutorials on the scene capture actor, but implementing something simple like directly rendering to a texture from a shader seems to elude me. I suppose it can be done using a custom node and just writing the HLSL, but I don't see how I could pass a render target from one shader / material to another (which is the end goal, here).
Thoughts?
Replies
Just take the output of whatever material you want in a texture and pipe it directly into however you plan to use it in the other.
As you don't mention any lighting involved I'm assuming there is none and it's just emissive.
Assuming you have a really good reason not to just incorporate your gradient masking in the other shader itself, UDK should have the options shown above in the Material Instance interface. Enable the checkboxes above, and once you close the material instance, it should bake out a texture (shares the same name as the mat instance).
(at least, I'm pretty sure that's not custom to our Unreal build, anyway)
Regarding incorporating the gradient into the original texture, of course I can. But I'm creating some rather complex procedural gradients, and I quickly realized how valuable it'd be to render a procedural gradient to a texture of NxN size, and replace the procedural output with an image (at least as far as optimization is concerned). It has it's uses, anyway.
If I really need it, I can always write some quick GLSL or something to do the job, but I was hoping there was a way to do that in UDK.
Sorry to bump without a solution, but I thought I'd throw my support behind anyone who wants to make this possible!
I have wanted to play around with the idea of a totally GPU based painting program for a LONG time, but always had other stuff to do.
You can do it with a little bit of UnrealScript, but the implementation is quite slow (but then so are rendertargets anyway). You can create a RenderTarget and draw a Material tile to that through the canvas. You may find it is a frame behind, I'm not sure as I've never tried it.