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\$
  • \$\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 Sep 20 '17 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\$ – DRoK Dev Sep 20 '17 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 Sep 20 '17 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\$ – DRoK Dev Sep 20 '17 at 3:03
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\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.