- Home /
How do you use Mathf.PerlinNoise in a compute shader?
Hello there,
I made a terrain generator and a texture generator for the terrain, but the performance wasn't really good. And since the texture is 10x more detailed then the terrain (because I didn't want the terrain to be really detailed) I wanted to move my texture script to a compute shader, but as you can see from the question I couldn't find a way to use Mathf.PerlinNoise in a compute shader. Does someone know a way to use the function? If not it's not the biggest problem, but differently I have to - First generate the terrain and store the height in a low resolution image to pass to my compute shader or - Create a perlin noise function myself that I can write in both c# and HLSL
If you need a bit more detail about what I actually want to make you can view my devlogs on https://youtube.com/playlist?list=PLEN0z45X0Yw9leG_HuM65WyXHnpQLxsCW Devlog number 2 gives the best information about the terrain
Answer by esgnn · Jan 21 at 06:41 PM
Thank you for the answer The crazy thing is I just made a perlin noise script for a standard surface shader and a script (see https://codeboy124.itch.io/that-traveling-guy-test-1-world for the result) about at the time you as posted your answer
Answer by sacredgeometry · Jan 05 at 09:55 AM
Either use the noise function or implement one yourself. There are plenty of examples out there.
Your answer
![](https://koobas.hobune.stream/wayback/20220613051311im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to destroy terrain using Sebastian Lague's Marching Cubes implementation 1 Answer
Terrain import detail texture 0 Answers
Better Terrain Texturing Method 2 Answers
When Painting New Textures Over Old Ones on Terrain, a white outline Appears? 0 Answers
Terrain toolkit procedural terrain texturing Help needed 2 Answers