0
\$\begingroup\$

I'm probably asking this question wrong. I'm using Turbulence Library to generate noise as shaders. What I want to do is take the noise generated by these shaders and apply them to Texture2Ds that I'm procedurally generating.

What I want to do is take the value of each pixel from the noise, then while procedurally generating a texture, use to determine how much I put another color "on top of" another color in a procedurally generated mesh. I would post an example picture, but I can't do that since I can only post one link with my reputation.

I strongly suspect that I will just have to write my own shader from scratch, but is there no way to just take noise from a shader and apply it to a Texture2D so I can continue to use the Standard shader?

\$\endgroup\$
4
  • \$\begingroup\$ Why do you say there's no way to take noise from a shader and apply it to a texture? That's effectively what the rendering pipeline does every time it writes shader output to the frame buffer. All you need to do is capture that output into a RenderTexture of your choosing instead of the frame buffer, using a camera with a target texture set or Graphics.Blit — have you tried either of these avenues? \$\endgroup\$
    – DMGregory
    Commented Sep 20, 2017 at 1:46
  • \$\begingroup\$ I've never heard of RenderTextures before. Will they basically let me get a bitmap out of a Shader while still in C#? Because that's pretty much all I need. Hell, I have the pictures I was talking about here: answers.unity3d.com/questions/1409480/… \$\endgroup\$
    – user107538
    Commented Sep 20, 2017 at 2:02
  • \$\begingroup\$ You don't even strictly need the C#, you could do it entirely with asset/scene/inspector setup if you so chose. I don't see any obstacles to what you're describing. \$\endgroup\$
    – DMGregory
    Commented Sep 20, 2017 at 2:06
  • \$\begingroup\$ I'm not really sure how to do this. I don't actually have access to Unity for another two hours, but the problem basically boils down to "I don't know what to drag it over in the Inspector" and "I don't know how to use a shader like Mathf.PerlinNoise" \$\endgroup\$
    – user107538
    Commented Sep 20, 2017 at 3:03

1 Answer 1

1
\$\begingroup\$

I think Custom Render Textures is what you need: you can fill it with your own shader, use parameters from materials, assign it to texture slots (like a normal Texture2D), etc.

\$\endgroup\$

You must log in to answer this question.