View Full Version : Making Noise [UDK]
08-10-2011, 05:37 AM
I spent the evening... and half the morning it looks like.. working on getting a realtime version of Ken Perlin's simplex noise running inside UDK.
First version went way over the instruction limit, so I popped out part of the compuation to a lookup texture, so now it runs in real time, but my simplex picking and blending isn't quite right. Its very noisy, but not in a useful way.
If I can get this working it will be pretty sweet for realtime effects though. :) The sun was a fun thing that worked even with this broken version.
08-10-2011, 11:07 AM
Nice, is it a 3D warping noise on the mesh, or is it still pendant on UV's and you can see the seams.
08-10-2011, 01:35 PM
It's a 3D calculated noise field using Ken Perlin's improvements to his original noise algorithm. The original one has visible discontinuities every 256 units, this one, when it works right, resolves those issues and a couple others.
How the object gets it's coloration is dependent on the input to the noise node. For texture space based noise plug in uv coords appended with a z component of 0. For true 3d noise plug in a position, like world or local position.
I have some other examples to review that others have written that actually work.
08-10-2011, 09:24 PM
Are there any texture sampler calls in this? Could be used for some alpha in a lerp where noise is needed and you dont want to create a map for them
maybe i just dont understand what it is creating. hah
08-10-2011, 09:51 PM
Absolutely awesome, Vailias! Was just listening to Perlin's interview on the FxGuide podcast, as linked elsewhere on PC I think (here's a direct link (http://www.fxguide.com/player/?media_url=http%3A%2F%2Fmedia.blubrry.com%2Ffxpodc ast%2Fmedia.fxguide.com%2Ffxpodcast%2Ffxg-110809-KenPerlin.mp3&width=550&height=175)). Excited to see where this goes.
08-10-2011, 10:54 PM
Awesome sauce man! I hope you can show some closer examples, this could be really useful for vertex blending and detail mapping on beauty pieces.
08-11-2011, 12:21 AM
:) Thanks for the input guys. There is currently 1 texture sampler call for the noise permutation array. I had it in code.. but with it there it took over 3300 instructions.
If I can get this working in a light enough state the applications are near limitless to adding subtle realism to our worlds.
Other people have done realtime implementations.. I'm by no means the first, but its a complex enough thing I wanted to try so I can learn a bit more. :) I was inspired by this thread (http://www.polycount.com/forum/showthread.php?t=86970&page=3). The grass and everything are TOO monochrome even for nice healthy grass. So either some blended per-instance random value, OR a shader with position based noise hue shift could work extremely well. Of course UDK doesn't have a built in noise generator.. and away I went with reading through a few papers of shader math.
@ChrisPerr: Perlin Noise can be thought of as a sort of basic procedural texture atom. It outputs a pseudo random pattern in the range of -1 to +1. Basic noise is boring but good for adding large scale variations to things. Fractal noise is amazing for a number of things. If you do a simple fractal series addition you get really crazy complex gradient shifts. Adding successive absolute value's of noise functions gets patterns that resemble turbulent flow. You can use these for clouds, fire effects, or even plug it into mesh displacement, alter the coordinates per frame (ie multiply your x,y or z by some factor of time) and you can get a rolling non linear wind effect.
You can plug in the output of a noise function to a sine function on a gradient texture and get very convincing marble.
You could take basic fractal noise, mask it against an AO map of your model, then apply a mud texture for nearly unique dirtying of objects anywhere in the world sharing the same texture set.
You could control the number of octaves of noise with camera distance, while using the output as a control texture for subtle hue and saturation shifts to a character's skin along with the specularity levels to get near infinite detailing and variation out of a fairly flat texture. I once made rather convincing skin procedurally back on lightwave 5.5 with no textures. LW5 didn't have UV mapping capability. :D It took a long while to render on the super fast Pentium 400mhz computers at school, but it looked sweet.
Course, its not free, but its cool to me that this CAN be done realtime now. My first modeling program ONLY had procedural texture generation for its materials, and fractal noise was the major player.
anyway I altered a GLSL example I found on the web to see if it worked better in UDK.. and I'm getting very similar results. I may table this for a bit to clear my brain, then come back and build it up step by step so I can watch it evolve. This whole exercise has taught me a bit. :) I didn't truly understand all the concepts involved with this when I started it, but I can visualize it now. YAY learning!
also as requested close up pix of the current implementation(s)
As you can see the borders between each simplex are REALLY visible, which is not supposed to be the case.
I'm also considering doing a bit of a texture based kludge if the programmatic versions are too heavy for realistic realtime use.
vBulletin® v3.8.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.