POV-Ray : Newsgroups : povray.binaries.images : Snow macro test [~30k] Server Time
5 Nov 2024 20:20:35 EST (-0500)
  Snow macro test [~30k] (Message 1 to 10 of 15)  
Goto Latest 10 Messages Next 5 Messages >>>
From: [GDS|Entropy]
Subject: Snow macro test [~30k]
Date: 17 Feb 2009 10:15:51
Message: <499ad4a7$1@news.povray.org>
Hello,

Since writing the exclusion test macro, it occured to me that all I had to 
do to make a snow macro, was modify what I already had to include a call to 
the trace function and a blob.

So far the macro is under 30 lines of code, but I am going to expand it to 
generate more types of snow and perhaps grass and moss before releasing it.

The snow/ice texture is slope dependant, so you can either cover the object 
in ice, cover it in snow, or anything in between. The ice texture needs a 
bit of work, currently it has filter at 0.9, and I'll probably add another 
instance of it to the texture map which will be more reflective/brilliant 
and be completely transparent.

The image below parsed in 1 second when performing a test with 5k blobs, 
which in all honesty was probably too many. Due to the ice it took about 1hr 
47min to render at 512x384.

Total Scene Processing Times
  Parse Time:    0 hours  0 minutes  1 seconds (1 seconds)
  Photon Time:   0 hours  0 minutes  0 seconds (0 seconds)
  Cloth Time:    0 hours  0 minutes  0 seconds (0 seconds)
  Mechsim Time:  0 hours  0 minutes  0 seconds (0 seconds)
  Render Time:   1 hours 47 minutes 18 seconds (6438 seconds)
  Postpr. Time:  0 hours  0 minutes  0 seconds (0 seconds)
  Total Time:    1 hours 47 minutes 19 seconds (6439 seconds)
CPU time used: kernel 3.83 seconds, user 6435.63 seconds, total 6439.45 
seconds
Render averaged 30.53 PPS over 196608 pixels

ian


Post a reply to this message


Attachments:
Download 'snownut.jpg' (26 KB)

Preview of image 'snownut.jpg'
snownut.jpg


 

From: [GDS|Entropy]
Subject: Re: Snow macro test [~30k]
Date: 18 Feb 2009 03:19:36
Message: <499bc498$1@news.povray.org>
I am working on adding icicles to the snow macro, which so far is working 
correctly except that I need to find a way around having the icicle blobs 
separate from the snow blob, but since I am testing that they fall between 
the bounding boxes of the snowed on item, and the snow...I can't include 
them in the main macro....which I need to find a way to do, as in real life 
icicles are part of the parent ice, and blob together as well.

I have a version in which they blob together, which looks really cool...and 
I might utilize that to create an effective stalactite/stalagmite macro.

But for now, here is the most recent beta-test image of the snownut with 
icicles and improved ice texture:

ian


Post a reply to this message


Attachments:
Download 'icicleSnownut.jpg' (19 KB)

Preview of image 'icicleSnownut.jpg'
icicleSnownut.jpg


 

From: Thomas de Groot
Subject: Re: Snow macro test [~30k]
Date: 18 Feb 2009 03:48:26
Message: <499bcb5a@news.povray.org>
"[GDS|Entropy]" <gds### [at] hotmailcom> schreef in bericht 
news:499bc498$1@news.povray.org...
>I am working on adding icicles to the snow macro, which so far is working 
>correctly except that I need to find a way around having the icicle blobs 
>separate from the snow blob, but since I am testing that they fall between 
>the bounding boxes of the snowed on item, and the snow...I can't include 
>them in the main macro....which I need to find a way to do, as in real life 
>icicles are part of the parent ice, and blob together as well.
>
> I have a version in which they blob together, which looks really 
> cool...and I might utilize that to create an effective 
> stalactite/stalagmite macro.
>
> But for now, here is the most recent beta-test image of the snownut with 
> icicles and improved ice texture:
>

This macro looks very promising indeed. Good work. I am looking forward to 
the final result. It would be an excellent contribution to the 
Object-Collection.

It would be interesting to compare this with the already existing snow 
macros (Gilles Tran, Tim Nikias). The length of you code suggests something 
far more compact tha either of those mentioned.

Thomas


Post a reply to this message

From: Mike Hough
Subject: Re: Snow macro test [~30k]
Date: 18 Feb 2009 04:09:05
Message: <499bd031@news.povray.org>
Nice snownut. Here is something you could try for the ice. It mainly the 
photons and dispersion that give it sparkle.

material {
pigment {color rgbt <1, 1, 1, .9>}
finish {phong .4 phong_size 30 reflection .05}
interior {ior 1.33 dispersion 1.1 dispersion_samples 20
media {
emission .1
samples 1, 2
density {
bumps
color_map {
[0 color rgb <0, 0, 0>]
[1 color rgb <0, .3, .3>]
}
scale 3
}
}
}
}

photons {
target
refraction on
reflection on
}


Post a reply to this message


Attachments:
Download 'ice.jpg' (277 KB)

Preview of image 'ice.jpg'
ice.jpg


 

From: [GDS|Entropy]
Subject: Re: Snow macro test [~30k]
Date: 18 Feb 2009 04:21:44
Message: <499bd328@news.povray.org>
"Thomas de Groot" <tDOTdegroot@interDOTnlANOTHERDOTnet> wrote in message 
news:499bcb5a@news.povray.org...
>
> This macro looks very promising indeed. Good work. I am looking forward to
> the final result. It would be an excellent contribution to the
> Object-Collection.
>

Well I hope it turns out well, I think that it will. :-D
It really started as a desire to place a 2d patch of grass everywhere but 
the space occupied by an object, then to cover a mountian with trees that 
stopped at the water level, and now it has kinda blown up from there. Hells, 
2 nights ago I didn't even know how to trace(), and the week before not even 
how to test within boundaries. This has mutated into an attempt to learn SDL 
hard and fast.

Even with icicles the macro parses in 1 second. I think I might have a bead 
on a solution to the bounding box estimation issue, which will allow my 
icicles to blob with the main snow coating and compress the separate icicle 
macro into the snow macro with only maybe 10 more lines of code...IF the 
estimation works..

There is an optimization that occurs to me while writing this, which would 
be to only place objects which are visible to the camera, ignoring those in 
places such as behind the object...but I'll save that for once the icicle 
dilemma has been satisfactorily resolved.

> It would be interesting to compare this with the already existing snow
> macros (Gilles Tran, Tim Nikias). The length of you code suggests 
> something
> far more compact tha either of those mentioned.

Feel free to compare them, the core of mine is about 28-29 lines in povray 
(ignore wordwrap in your reader, see below).
The vector array is just a random array of vectors, and if you were to use a 
min/max rand function based upon the bounding box of your object, you can 
decrease the number of failed tests.
Here is the core section of the snow macro, minus the icicles:

#macro 
snowTest(ctr,vectorArray,testVector,testObject,radVal,strVal,useInterior)
 #local vectorA = min_extent(testObject);
 #local vectorB = max_extent(testObject);
 blob {
 #local i=0;
 #while (i<ctr)
  #if (((vectorArray[i].x <= vectorB.x) & (vectorArray[i].x >= vectorA.x)) & 
((vectorArray[i].y <= vectorB.y) & (vectorArray[i].y >= vectorA.y)) & 
((vectorArray[i].z <= vectorB.z) & (vectorArray[i].z >= vectorA.z)))
   #if (inside(testObject,vectorArray[i]))
    sphere {
     trace (testObject,vectorArray[i],testVector), radVal, strVal
     texture {
      SnowTex0
     }
    }
   #end
  #end
 #set i=i+1;
 #end
 #if (useInterior)
  interior {
   fade_distance 2
   fade_power 3
   ior 1.45
   caustics 1.0
  }
 #end
 }
#end

I haven't seen either of their methods, but recognize Gilles artistic work 
as some of the best.

Note I have attached an image showing pseudo-bounding boxes which I am 
testing against, and a *partial* fix to the icicle problem. I still need to 
"shimmy" the icicles down and out a tad.
Here is the code for the diameter fluctuation of the icicles, btw: 
radVal+((cos(k)*atan(0.125*sqrt(abs(k))))-RRand(RsA, 0.25, 0.5))

Any ideas that you might have would be great.
In fact, a modification of the above core would combine really well with 
your moss texture....maybe give it a try?

ian


Post a reply to this message


Attachments:
Download 'snottySnownut.jpg' (42 KB)

Preview of image 'snottySnownut.jpg'
snottySnownut.jpg


 

From: [GDS|Entropy]
Subject: Re: Snow macro test [~30k]
Date: 18 Feb 2009 04:29:49
Message: <499bd50d$1@news.povray.org>
Wow, that is some nice ice there!
Would you mind if I tried integrating that into the texture, as a "high 
quality" option? (proper attribution would be provided, of course)

Though I doubt it would be practical to render a large scene, or a lot of 
trees covered in snow/ice with those settings...

ian

"Mike Hough" <nos### [at] nospamcom> wrote in message 
news:499bd031@news.povray.org...
> Nice snownut. Here is something you could try for the ice. It mainly the 
> photons and dispersion that give it sparkle.
>
> material {
> pigment {color rgbt <1, 1, 1, .9>}
> finish {phong .4 phong_size 30 reflection .05}
> interior {ior 1.33 dispersion 1.1 dispersion_samples 20
> media {
> emission .1
> samples 1, 2
> density {
> bumps
> color_map {
> [0 color rgb <0, 0, 0>]
> [1 color rgb <0, .3, .3>]
> }
> scale 3
> }
> }
> }
> }
>
> photons {
> target
> refraction on
> reflection on
> }
>
>


Post a reply to this message

From: Mike Hough
Subject: Re: Snow macro test [~30k]
Date: 18 Feb 2009 04:57:09
Message: <499bdb75$1@news.povray.org>
Don't even need to give me credit. You'll probably end up tweaking it to get 
it to work anyway.


"[GDS|Entropy]" <gds### [at] hotmailcom> wrote in message 
news:499bd50d$1@news.povray.org...
> Wow, that is some nice ice there!
> Would you mind if I tried integrating that into the texture, as a "high 
> quality" option? (proper attribution would be provided, of course)
>
> Though I doubt it would be practical to render a large scene, or a lot of 
> trees covered in snow/ice with those settings...
>
> ian
>
> "Mike Hough" <nos### [at] nospamcom> wrote in message 
> news:499bd031@news.povray.org...
>> Nice snownut. Here is something you could try for the ice. It mainly the 
>> photons and dispersion that give it sparkle.
>>
>> material {
>> pigment {color rgbt <1, 1, 1, .9>}
>> finish {phong .4 phong_size 30 reflection .05}
>> interior {ior 1.33 dispersion 1.1 dispersion_samples 20
>> media {
>> emission .1
>> samples 1, 2
>> density {
>> bumps
>> color_map {
>> [0 color rgb <0, 0, 0>]
>> [1 color rgb <0, .3, .3>]
>> }
>> scale 3
>> }
>> }
>> }
>> }
>>
>> photons {
>> target
>> refraction on
>> reflection on
>> }
>>
>>
>
>


Post a reply to this message

From: Thomas de Groot
Subject: Re: Snow macro test [~30k]
Date: 18 Feb 2009 10:18:40
Message: <499c26d0@news.povray.org>
"[GDS|Entropy]" <gds### [at] hotmailcom> schreef in bericht 
news:499bd328@news.povray.org...
> Feel free to compare them, the core of mine is about 28-29 lines in povray 
> (ignore wordwrap in your reader, see below).
> The vector array is just a random array of vectors, and if you were to use 
> a min/max rand function based upon the bounding box of your object, you 
> can decrease the number of failed tests.

I shall experiment with your code. Thank you indeed.

> Any ideas that you might have would be great.
> In fact, a modification of the above core would combine really well with 
> your moss texture....maybe give it a try?

I am sure it will combine nicely, especially as my moss texture is really 
crude, straightforward coding. This would do a much better job.

Thomas


Post a reply to this message

From: Thomas de Groot
Subject: Re: Snow macro test [~30k]
Date: 19 Feb 2009 03:22:28
Message: <499d16c4$1@news.povray.org>
"[GDS|Entropy]" <gds### [at] hotmailcom> schreef in bericht 
news:499bd328@news.povray.org...
> "Thomas de Groot" <tDOTdegroot@interDOTnlANOTHERDOTnet> wrote in message 
> news:499bcb5a@news.povray.org...
>> It would be interesting to compare this with the already existing snow
>> macros (Gilles Tran, Tim Nikias). The length of you code suggests 
>> something
>> far more compact tha either of those mentioned.
>
>
> I haven't seen either of their methods, but recognize Gilles artistic work 
> as some of the best.
>

Here are the two site locations:
http://www.oyonale.com/modeles.php?lang=en&page=35
http://www.nolights.de/downloads.html#surcoat


Thomas


Post a reply to this message

From: [GDS|Entropy]
Subject: Re: Snow macro test [~30k]
Date: 24 Feb 2009 05:47:05
Message: <49a3d029@news.povray.org>
Here is a test scene using the latest stable version of the snowmacro, 
without icicles, as the exact implementation of that feature is in an 6-way 
deathmatch with itself...probably some hybrid will be the outcome.

This scene shows the performance of the macro on various surfaces, with 
manual blob size/strength adjustment. Snow origin direction is y+, but can 
be anything, so you can simulate wind coming from a particular direction.

Note I used a plain white texture, not the actual snow texture include for 
this test render, as the high quality texture renders slowly.

ian


Post a reply to this message


Attachments:
Download 'SnowScene_0_.jpg' (84 KB)

Preview of image 'SnowScene_0_.jpg'
SnowScene_0_.jpg


 

Goto Latest 10 Messages Next 5 Messages >>>

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