POV-Ray : Newsgroups : povray.general : Light beam, laser, noise... : Re: Light beam, laser, noise... Server Time
5 Nov 2024 15:57:34 EST (-0500)
  Re: Light beam, laser, noise...  
From: Rune
Date: 3 Mar 2003 12:01:40
Message: <3e638a74$1@news.povray.org>
Rune wrote:
> I don't have any ready-to-use code but try
> out some things and see what works for you.

Oh well, I made some code anyway...

This one should make dark areas in the image noisy, while keeping bright
areas relatively noise-free. Isn't that the way it is in real
photographs?

// AddNoise macro by Rune S. Johansen
// Example of use:
// AddNoise(camera_location,1.0,0.002,0.5)
#macro AddNoise(camera_location,noise_level,noise_scale,noise_colors)
   sphere {
      0, 1 hollow no_shadow no_reflection
      texture {
         average scale noise_scale
         texture_map {
            #local I = 0;
            #while (I<3)
               #local C = vaxis_rotate(x,1,120*I);
               #local D = 0.5+(2*C-1)*noise_colors;
               [
                  pigment {
                     spotted translate 10*C
                     color_map {
                        [0,rgb 2-D transmit 1-noise_level    ]
                        [1,rgb D   transmit 1+noise_level*1.2]
                     }
                  }
                  finish {ambient 1 diffuse 0}
               ]
               #local I = I+1;
            #end
         }
      }
      scale 0.001 translate camera_location
   }
#end

Rune
--
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com (updated Oct 19)
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.