![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
So, for those interested: I'm currently working on a set of macros to drop
snow onto objects, see my thread in p.b.g "Ingenious snow placement?".
The input to actually save parsing time when competing against the brute
force method (just dropping buckets of particles onto the object) is the
topview image. It can be generated with a simple script which measures the
boundary-box using min- and max_extent and matches an orthographic camera to
look at the object. The object has to be white, the background black.
Once this image is generated, the macro will subdivide the image with a
regular grid into cells. Each cell's edges are checked if they intersect the
white of the image (this is cleverly done using trace() and a heightfield)
or, if that fails, if the entire cell is actually inside the object's
topview (by checking if the center is inside). Of course, small objects
might get lost, but the macros are designed for a single object with a
rather proper boundary-box, and that "getting-lost" issue is always the case
for discrete sampling...
Once the cells are determined full or empty, full cells will receive the
brute force method and get one bucket of trace(). The empty cells don't get
buckets, and thus, I save lots of parsing time! Additionally, particles will
drop straight through the object and will also hit surfaces underneath the
first surface, but it checks if the normal is actually pointing towards the
sky, to see if I've just hit the bottom of a surface.
And the small overhead due to the pretesting phase is worth it! The macro
ran on the tree in the image below (using the topview also supplied, but
with 1000x1000 dimensions for better accuracy) in 53 seconds. It generated
53.000 cells and discarded 42.000 empty cells (that's 80% of the volume!)
and dropped 80 particles in each active cells. I got 40.000 surface hits
that way, which are displayed in the 3D-Image of the tree.
Now I need to write macros to add further detail, like accumulation of snow
at walls and in edges and such. Also, the described technique above is only
meant to be used to generate an initial, crude set of positions, which I can
use as starting points for more detailed traces.
Comments and suggestions welcome (though I don't expect many, after all, I'm
just presenting some simple algorithm :-)
Regards,
Tim
--
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Post a reply to this message
Attachments:
Download 'tree_top.jpg' (21 KB)
Download 'tree_snow.jpg' (34 KB)
Preview of image 'tree_top.jpg'
![tree_top.jpg](/povray.binaries.images/attachment/%3C41b8a467%40news.povray.org%3E/tree_top.jpg?ttop=441697&toff=5800&preview=1)
Preview of image 'tree_snow.jpg'
![tree_snow.jpg](/povray.binaries.images/attachment/%3C41b8a467%40news.povray.org%3E/tree_snow.jpg?ttop=441697&toff=5800&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I've forgotten to add the tree itself in the last image, it's kinda hard to
see that the particles are really *on* the surface without it...
--
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Post a reply to this message
Attachments:
Download 'tree_snow2.jpg' (115 KB)
Preview of image 'tree_snow2.jpg'
![tree_snow2.jpg](/povray.binaries.images/attachment/%3C41b8a502%40news.povray.org%3E/tree_snow2.jpg?ttop=441697&toff=5800&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Tim Nikias wrote:
> I've forgotten to add the tree itself in the last image, it's kinda hard to
> see that the particles are really *on* the surface without it...
I'm the last person qualified to give advice on something this advanced,
but something sticks out to me. The snow on the tree looks fantastic. It
really looks like, well, snow! The thing is that even on the branches
that are nearly vertical, there are snow particles. Since it's still
green here (not that I'm complaining) I can't verify this for myself,
but it seems to me like only really wet snow will stick at that angle.
Maybe you need to incorporate some Teflon into your macro? :)
This was especially evident on the trunk. Generally there would be a
little bit of wind (snow very rarely falls straight down - maybe you
should change the angle you shoot trace() from, if that's possible?), so
snow would stick more evenly on one side and very little at all on the
other side.
The more I look at these WIP renders the more I think this should be a
POVCOMP entry... :)
~Mike
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
SNIP
> The thing is that even on the branches
> that are nearly vertical, there are snow particles. Since it's still
> green here (not that I'm complaining) I can't verify this for myself,
> but it seems to me like only really wet snow will stick at that angle.
> Maybe you need to incorporate some Teflon into your macro? :)
Like I said, there was no discarding of the samples yet, this will be done
with other macros. So as long as the surface doesn't actually point
downwards, particles will stick. "Teflon" will be implemented in successive
macros to be run over the collected data.
> This was especially evident on the trunk. Generally there would be a
> little bit of wind (snow very rarely falls straight down - maybe you
> should change the angle you shoot trace() from, if that's possible?), so
> snow would stick more evenly on one side and very little at all on the
> other side.
It was shot in -y-direction, as that is the topview. I've already been
thinking about how to add a different vector, but this should be implemented
for the topview-macro as well, and then things get difficult successively
for the calculation of the grid etc. But it is on my to-do list.
> The more I look at these WIP renders the more I think this should be a
> POVCOMP entry... :)
I'd have to read the rules first to find out if it is okay to make use of
Arbaro for the tree, and then I'd have to ask permission of the person I'm
making this image for. It'll be a christmas present and images that I've
made as a gift are meant to stay unique prints. Putting it on a Poster would
make it famous, but then again, lots of people would have it hanging in
their room (wishful thinking?), and that's like everyone owning a Mona
Lisa... But I'll give it a thought. :-)
Thanks for the positive feedback, BTW.
Regards,
Tim
--
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> This was especially evident on the trunk. Generally there would be a
> little bit of wind (snow very rarely falls straight down - maybe you
> should change the angle you shoot trace() from, if that's possible?), so
> snow would stick more evenly on one side and very little at all on the
> other side.
Here we go. Five hours of fiddling around with vector arithmetics, I finally
ended up with this and then soon noticed, that I could have gotten it
earlier if I hadn't been to focussed on a certain approach... Ah, well. At
least it's done.
Now, you can pick a direction at which you want to drop the snow (and create
the orthographic view with). The image was created by dropping snow from
above and right (-x-y is the direction then: left and down). Used some
higher settings than in the last one to see if the branches' tips get
properly mapped, and as far as I can tell, they do (mathematically, they
should, anyways). 3m20seconds to create 68.000 surface points.
Teflon was still not invented... ;-)
Regards,
Tim
--
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Post a reply to this message
Attachments:
Download 'tree_snow3.jpg' (116 KB)
Preview of image 'tree_snow3.jpg'
![tree_snow3.jpg](/povray.binaries.images/attachment/%3C41b8dce4%40news.povray.org%3E/tree_snow3.jpg?ttop=441697&toff=5800&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Very cool (cold?) I would suggest a multiple-run senario, initialy straight
down, then with a lighter snow in several directions (wind swirlies). This
would get rid of the snow exclusively covering one side of the tree,
letting you give a light dusting on the side(s) you want the wind to blow.
Looking good.
-S
5TF!
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
looking good Tim. very good.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> looking good Tim. very good.
Thank you. I hope to have a few more basic macros up and running soon, so
that I can release the code to the public (like I do with all major
scripts...).
Regards,
Tim
--
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> Very cool (cold?) I would suggest a multiple-run senario, initialy
straight
> down, then with a lighter snow in several directions (wind swirlies). This
> would get rid of the snow exclusively covering one side of the tree,
> letting you give a light dusting on the side(s) you want the wind to blow.
I'm not sure I understand what you mean. Should I just layer several layers
of snow on top of each other, but from various directions?
That aside, my idea was that the current macro just produces *all* points on
a surface pointing towards a certain direction, removing some points and
adding details - like places where snow accumulates and grows to small piles
against walls and such - is planned to be implemented with macros which
build upon the gathered surface-data.
Regards,
Tim
--
"Tim Nikias v2.0"
Homepage: <http://www.nolights.de>
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Tim Nikias" <JUSTTHELOWERCASE:timISNOTnikias(at)gmx.netWARE> wrote:
> I'm not sure I understand what you mean. Should I just layer several layers
> of snow on top of each other, but from various directions?
>
That is what I meant. i.e a LOT of points from the top, a bunch from the
main wind direction, and a few from a third direction, jut to get a little
variagation rather than solid snow on one side and none on the other. BUT--
> That aside, my idea was that the current macro just produces *all* points on
> a surface pointing towards a certain direction, removing some points and
> adding details - like places where snow accumulates and grows to small piles
> against walls and such - is planned to be implemented with macros which
> build upon the gathered surface-data.
>
This would, obviously, be even better. I was just trying to thing of a quick
way to make it a little less harsh/sharply one sided.
Awesome, though. This two-pass method ought to work with a lot of different
applications.
-s
5TF!
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |