POV-Ray : Newsgroups : povray.newusers : <no subject> : Re: <no subject> Server Time
15 Aug 2022 17:54:47 EDT (-0400)
  Re: <no subject>  
From: Alain
Date: 25 Nov 2018 12:49:36
Message: <5bfae0b0$1@news.povray.org>
Le 18-11-24 à 22:09, j13r a écrit :
> Hi all,
> 
> I would like to make a image of magnetic field loops (similar to these:
>
https://ichef.bbci.co.uk/news/304/media/images/58947000/jpg/_58947314_162169main_trace_solar_flare_lg-1.jpg
> https://martianchronicles.files.wordpress.com/2010/05/loops.gif
> http://www.space.com/images/i/000/015/747/original/sun-as-art-swirls.jpg
> more information here: https://en.wikipedia.org/wiki/Coronal_loop
> )
> The only difference is that I want them on a disk.
> 
> So far I tried to make the loops with multiple "torus" elements,
> which are light sources at the same time.
> I added more of these in larger sizes to give it a glow/halo effect.
> This is all very similar to the lightsabre object example.
> 
> However, already with a few of these (8, see code below), the rendering is
> getting slow. I think the reason is that the ~130 torus objects are overlapping
> each other. This leads to a lot of root tests (742109138, see output below).
> I was wondering if you could suggest a smarter technique?
> 
> It would also be good to be more flexible than with the torus.
> I attached my code below.
> 
> Cheers,
>         Johannes
> 

You use a lot of lights and it does cause a big slowdown.

Proposition :
1) Remove all those lights.
2) Use only full torus, not segments.
3) Enable radiosity.
4) In the radiosity block, add media on to allow your emissive media to 
participate.

Suggested radiosity block :
global_settings{
  radiosity{
   pretrace_end 0.01
   count 15000 33333
   nearest_count 4 20
   error_bound 0.7
   low_error_factor 0.3
   media on
   }
  }
Add to your scene :
#default radiosity{importance 0.01}
// get an average of 150 samples for most of the elements of the scene

Add to your emissive torus :
importance 1
// Use the full amount of samples for the very bright emissive objects

Finally, adjust the emission value to get reasonable illumination.

#declare glowarc= object{
//light_source { <0, 5, 0> color rgb <0,0,.5> }
// bright white arc
object {arc pigment{Clear} hollow
  interior { media{ emission <1,1,1>*100 } }// reduce emission as needed
  importance 1
}


#while (i<number_of_subarcs)
  #declare i = i + 1;
  // we jitter them slightly
  #declare myscale = 1/Rand_Normal(1,0.05,r1);
  #declare xrot = Rand_Normal(0, 7, r1);
  #declare yrot = Rand_Normal(0, 3, r1);
  #declare zrot = 0;
  object {
   arc pigment{Clear} hollow
   scale myscale
   rotate <xrot,yrot,zrot>
   interior { media{
    emission <0,0,1>*pow(10,1+1*rand(r1))
   } }
   importance 0.7
// less bright, but narrower
  }
  // make fuzzy, weak halos with thickarc objects
  object {
   thickarc pigment{Clear} hollow
   scale myscale
   rotate <xrot,yrot,zrot>
   interior { media{emission <.01,.01,1>*(0.4/number_of_subarcs)} }
   importance 0.5
// not as bright, can do away with slightly less samples
  }
#end
}


Post a reply to this message

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