# Does anyone understand the theory behind this noise randomizer problem?

 3 Weeks Ago #1 Niber PRO Anon United Kingdom   Join Date: Jan 2003 Posts: 195 Does anyone understand the theory behind this noise randomizer problem? I'm trying to use a random noise texture to randomize cells in a shader, the shader stuff I understand, what I don't understand is why it's impossible to make a randomized noise texture! If I use the Noise filter in Photoshop, the results are just absolutely terrible (it might look noisy, but the actual noise is poorly randomized), So eventually I found a website that creates really good noise, that average at 128 whenever I use "blur Average", However even tho this one is more balanced, I find that mid-range values (those near 128) are WAY more common than high and low values, I was able to confirm this by checkign the Levels filter in Photoshop, notice it shows that the midrange valeus are more common because of how the levels thingy is a steep mountain. Is it something I'm missunderstanding? (about color profiles? gamma? randomization techniques etc), Why is it impossible to make a noise texture where each pixel is randomized between 0-1 without greatly favoring certain color ranges? __________________ 3d Artist moved to China for new opportunities, follow my crazy adventures on my blog: Making games in China Last edited by Niber : 3 Weeks Ago at 07:51 PM. share quote
 3 Weeks Ago #2 oddforce Beginner 🐟 Austria   Join Date: Jun 2005 Posts: 262 If 8 bit color depth is okay, paste this `````` void setup() {   size(1000,1000); } void draw() {   for(x=0;x<1000;x++)      for(y=0;y<1000;y++)     {       point(x, y);        stroke(random(255), random(255), random(255));   } }`````` here: http://valentin.dasdeck.com/processing/index.php, then press play button, then stop, then export to png share quote
 3 Weeks Ago #3 Niber PRO Anon United Kingdom   Join Date: Jan 2003 Posts: 195 Thanks so much, but strangely enough this has the EXACT same problem! (even tho we can see the code in plain view) Notice in this picture from that code, that the histogram shows that midvalues are way more common than dark and light colors. now you could think maybe it's just photoshops histogram that is broken, so I made a test, I set the treshold to 64, meaning that I should see 25% of pixels, yet when I manually count 8x8 pixels = 64 I get only 8 black pixels, meaning that treshold of 64 only got 12.5% pixels, half what I expected! So weird right! __________________ 3d Artist moved to China for new opportunities, follow my crazy adventures on my blog: Making games in China share quote
 3 Weeks Ago #4 pomru Expert   Join Date: Jul 2002 Posts: 577 The histogram that you see in Photoshop's Levels filter is the wrong tool to use for measuring how random your texture is. The steep mountain that you see matches the bell curve visualization of probability that a pixel will have a certain value. From what you've been saying, you seem to be expecting a flat rectanglar-shaped histogram in the Levels filter since truly random textures should have equal probability of values, right? Well, that would be only half-correct. Each pixel does have an equal probability, but statistically, most of the pixels will fall into the midrange. So no matter what random noise texture you throw into the Photoshop Levels filter, you'll get a variation of that steep mountain. So, to measure how random your texture is, you need to use a different tool. For most cases, the human eye is good enough. If you can't spot any pattern in the noise, then the texture is random enough for most purposes. share quote
 3 Weeks Ago #5 oddforce Beginner 🐟 Austria   Join Date: Jun 2005 Posts: 262 Weird indeed. I opened that image in Photoshop. Window->Histogram showed a flat distribution as you would expect. Let me check again. Maybe that levels panel is something else, the panel was labeled histogram when I checked, not levels (latest photoshop version) share quote
 3 Weeks Ago #6 oddforce Beginner 🐟 Austria   Join Date: Jun 2005 Posts: 262 Ok the secret sauce was "cache level". Photoshop uses a scaled down version of the image to quickly compute the histogram. Scaling down averages the pixels which results in that bell curve we see. When you click the warning icon cache level 0 (unscaled) is activated temporarily and the flat histogram is shown. share quote

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts vB code is On Smilies are On [IMG] code is On HTML code is Off CGSociety Society of Digital Artists www.cgsociety.org Powered by vBulletinCopyright ©2000 - 2006, Jelsoft Enterprises Ltd.
Forum Jump
 Please select one User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home -------------------- Gallery     Latest Entries     Featured Videos     Featured 3D     Featured 2D     CG Awards Main     News         Press Releases and Media     General Discussion         Legacy Threads     Off Topic     Recruitment     Education Software     Autodesk Maya         Maya Dynamics         Maya Rendering         Maya Character Setup         Maya Programming     Autodesk Miscellaneous         Autodesk MotionBuilder         Autodesk Mudbox         Autodesk Softimage             XSI: Programming             ICE: Interactive Creative Environment     Autodesk 3ds max         3dsMax SDK and MaxScript         3dsMax Tutorials & Tips         3dsMax Resources         Plugins & Add-ons         Particle Flow     Maxon Cinema 4D         Cinema 4D Resources     The Foundry Modo         The Foundry Time Travel Challenge     Pixologic ZBrush     Photoshop / Painter     Side Effects Houdini     Blender     Lightwave 3D         LW Resources         LW Tutorials     Allegorithmic Substance         Substance Painter         Substance Designer     E-on Software Vue     Compositing Software         The Foundry Nuke         Adobe After Effects         Autodesk Effects and Compositing         Eyeon Software Digital Fusion Challenges     Modeling Challenge         Member Model Collection     Digital Matte Painting Challenge         DMP Mini Challenge Collection     Sketch Challenge         Member SKETCH Collection     FXWARS Challenge         Member FXGallery     Lighting Challenges WIP     Professional Feedback     WIP/Critique: 3D     WIP/Critique: 2D         Speedpaints & Sketchbooks     WIP/Critique: Animation     Collaborative Projects Techniques     Art Techniques and Theories     Digital Matte Painting         Digital Matte Painting Mini-Challenge     Modeling     Texturing and Surfacing     Character Rigging     Animation     Lighting and Shaders     Compositing and Editing     Anatomy and Figurative Art         SPOTLIGHT: Best of the Artistic Anatomy and Figurative Art Forum         Tutorials and Workshops         Personal Anatomy & Sketchbook Threads         References, Resources, and Supplies Technical     Virtual Reality     Game Engine     Graphics Programming     Technical and Hardware
Miscellaneous

All times are GMT. The time now is 09:19 PM.