POV-Ray : Newsgroups : povray.binaries.images : Animation with billboards Server Time
31 Jul 2024 22:14:24 EDT (-0400)
  Animation with billboards (Message 4 to 13 of 13)  
<<< Previous 3 Messages Goto Initial 10 Messages
From: Ray Gardener
Subject: Re: Animation with billboards
Date: 5 Jun 2009 16:09:44
Message: <4a297b88$1@news.povray.org>
Christian Froeschlin wrote:
> Nice. I suppose only the trees are billboards?

Thank you; yes.


> Can this technique produce shadows as well?

Yes, but the shadows look increasingly wrong when the lightsource is at 
right angles to the viewing direction. The light "sees" the billboards 
from the side instead of face-on. Ground-level renders fare better 
because shadows get thin anyway, but overall I prefer to leave shadows off.

Shadows could probably be rendered in a separate pass by facing the 
billboards at the light and then compositing them back, but there's a 
point where the complexity of setting that up weighs against the 
simplicity of just using actual geometry (and it defeats the point of a 
raytracer to employ scanline-style workarounds). You could use cross 
billboards too.

The savings in memory and bounding-tree traversal are probably not high 
enough (or perhaps don't matter in these days of powerful hardware) to 
use billboards primarily, but I find them very helpful when prototyping 
because it's usually easier to get a picture than a model, and pictures 
are more portable between different renderers, gallery building is easy, 
etc. It's nice to have the option of dropping in billboards for any 
models that I don't have available yet -- I can quickly storyboard a 
scene, play with ideas, etc. before committing to making or finding the 
real geometry.

Joerg Schrammel's (Genesis Toolkit) work with textured cones is a neat 
in-between approach, which requires less (or no) camera-facing of trees 
and can cast reasonable shadows. The downside is that the textures are a 
little trickier to set up.

Mixing geometry with billboards is done to good effect for some trees. 
Trunk and branches are 3D but leaf clusters are billboards. They are 
rotated fully to camera-face (not just around the Y axis), and it's easy 
to sway them in animations to simulate wind. They also light better.


Some script code to experiment with:

// Some arrays go here, e.g., to define textures, texture lookup,
// billboard size/position, etc.

// The texture below is an example of one texture declaration.

#declare App_rect_texture[0] =
texture
{
	pigment
	{
		image_map
		{
			png "tree.png" map_type 0 interpolate 2 once
		}
		translate x * -0.5
	}
	finish { ambient 0.5 }
}


// App_cam_pos is normally assigned from an array of camera positions
// defined for an animation, e.g.,

#declare App_cam_pos = App_cam_positions[Current_frame_index];

#declare I = 0;

#while(I < App_number_of_objects)

	// I use a quad poly, but a two-tri mesh would work too.
	// I specified five instead of four points because otherwise
	// one gets a lot of "open poly; closing" warnings.
	polygon
	{
		5, <-0.5, 0>, <-0.5, 1>, <0.5, 1>, <0.5, 0>, <-0.5, 0>

		no_shadow // At your discretion. One could compute
		// a per-object lightsource angle and selectively
		// enable shadows for a threshold, or dupe the billboard
		// at right angles to itself (e.g., cross billboard).

		texture { App_texture[App_texture_index[I]] }
		// If you have several textures, put them in an
		// App_texture array, and then use an
		// App_texture_index array to translate object IDs
		// to textures.


		scale App_rect_size[I]
		// XY scale from unit square.
		// App_rect_size[I].z should always be 1.0

		#if(App_rect_billboard[I])
			// Cam-facing logic; rotates billboard only
			// around the Y axis.
			#declare App_v = App_cam_pos - App_rect_pos[I];
			#declare App_v = vnormalize(<App_v.x, 0, App_v.z>);
			#declare App_a = degrees(acos(vdot(App_v, <0,0,-1>)));
			#if(App_v.x > 0)
				#declare App_a = App_a * -1;
			#end
			rotate y * App_a
		#end
		translate App_rect_pos[I]
	}
	#declare I = I + 1;
#end


Ray


Post a reply to this message

From: Alain
Subject: Re: Animation with billboards
Date: 6 Jun 2009 11:14:41
Message: <4a2a87e1$1@news.povray.org>
Ray Gardener nous illumina en ce 2009-06-05 16:10 -->
> Christian Froeschlin wrote:
>> Nice. I suppose only the trees are billboards?
> 
> Thank you; yes.
> 
> 
>> Can this technique produce shadows as well?
> 
> Yes, but the shadows look increasingly wrong when the lightsource is at 
> right angles to the viewing direction. The light "sees" the billboards 
> from the side instead of face-on. Ground-level renders fare better 
> because shadows get thin anyway, but overall I prefer to leave shadows off.
> 
> Shadows could probably be rendered in a separate pass by facing the 
> billboards at the light and then compositing them back, but there's a 
> point where the complexity of setting that up weighs against the 
> simplicity of just using actual geometry (and it defeats the point of a 
> raytracer to employ scanline-style workarounds). You could use cross 
> billboards too.
> 
> The savings in memory and bounding-tree traversal are probably not high 
> enough (or perhaps don't matter in these days of powerful hardware) to 
> use billboards primarily, but I find them very helpful when prototyping 
> because it's usually easier to get a picture than a model, and pictures 
> are more portable between different renderers, gallery building is easy, 
> etc. It's nice to have the option of dropping in billboards for any 
> models that I don't have available yet -- I can quickly storyboard a 
> scene, play with ideas, etc. before committing to making or finding the 
> real geometry.
> 
> Joerg Schrammel's (Genesis Toolkit) work with textured cones is a neat 
> in-between approach, which requires less (or no) camera-facing of trees 
> and can cast reasonable shadows. The downside is that the textures are a 
> little trickier to set up.
> 
> Mixing geometry with billboards is done to good effect for some trees. 
> Trunk and branches are 3D but leaf clusters are billboards. They are 
> rotated fully to camera-face (not just around the Y axis), and it's easy 
> to sway them in animations to simulate wind. They also light better.
> 
>
You can have the shadows and the bilboards in one pass.
Just double the billboards. One set always faces the camera and is set to no_shadow.
The second set is set to face the light and is set to no_image.


Post a reply to this message

From: Ray Gardener
Subject: Re: Animation with billboards
Date: 6 Jun 2009 17:46:45
Message: <4a2ae3c5@news.povray.org>
Alain wrote:
> Ray Gardener nous illumina en ce 2009-06-05 16:10 -->
>> Christian Froeschlin wrote:
>>> Nice. I suppose only the trees are billboards?
>>
>> Thank you; yes.
>>
>>
>>> Can this technique produce shadows as well?
>>
>> Yes, but the shadows look increasingly wrong when the lightsource is 
>> at right angles to the viewing direction. The light "sees" the 
>> billboards from the side instead of face-on. Ground-level renders fare 
>> better because shadows get thin anyway, but overall I prefer to leave 
>> shadows off.
>>
>> Shadows could probably be rendered in a separate pass by facing the 
>> billboards at the light and then compositing them back, but there's a 
>> point where the complexity of setting that up weighs against the 
>> simplicity of just using actual geometry (and it defeats the point of 
>> a raytracer to employ scanline-style workarounds). You could use cross 
>> billboards too.
>>
>> The savings in memory and bounding-tree traversal are probably not 
>> high enough (or perhaps don't matter in these days of powerful 
>> hardware) to use billboards primarily, but I find them very helpful 
>> when prototyping because it's usually easier to get a picture than a 
>> model, and pictures are more portable between different renderers, 
>> gallery building is easy, etc. It's nice to have the option of 
>> dropping in billboards for any models that I don't have available yet 
>> -- I can quickly storyboard a scene, play with ideas, etc. before 
>> committing to making or finding the real geometry.
>>
>> Joerg Schrammel's (Genesis Toolkit) work with textured cones is a neat 
>> in-between approach, which requires less (or no) camera-facing of 
>> trees and can cast reasonable shadows. The downside is that the 
>> textures are a little trickier to set up.
>>
>> Mixing geometry with billboards is done to good effect for some trees. 
>> Trunk and branches are 3D but leaf clusters are billboards. They are 
>> rotated fully to camera-face (not just around the Y axis), and it's 
>> easy to sway them in animations to simulate wind. They also light better.
>>
>>
> You can have the shadows and the bilboards in one pass.
> Just double the billboards. One set always faces the camera and is set 
> to no_shadow.
> The second set is set to face the light and is set to no_image.

Hey, yeah, thanks, I'll try that.
Ray


Post a reply to this message

From: Ray Gardener
Subject: Re: Animation with billboards
Date: 6 Jun 2009 20:26:16
Message: <4a2b0928@news.povray.org>
Cousin Ricky wrote:
> Now that is one wicked water hazard!

Yep. The heightfield is actually based on part of a real course, 
although I forget where exactly (the layout anyway; I had to guess at 
the elevations). Some people like their holes challenging. :)

There aren't any water hazards actually in the line of play; it's just 
on the surrounding perimeter. If you shank, on another course you'd be 
deep in some bad rough anyway (or on another fairway).

Shadows coming out nice per Alain's suggestion (attached image), the 
video is about halfway rendered. I added 'no_reflection' to the 
light-facing billboards as well to keep reflections matched to the 
cam-facing boards.

Ray


Post a reply to this message


Attachments:
Download 'animtest102.png' (392 KB)

Preview of image 'animtest102.png'
animtest102.png


 

From: Ray Gardener
Subject: Re: Animation with billboards
Date: 6 Jun 2009 21:56:42
Message: <4a2b1e5a@news.povray.org>
Same animation, with shadows:

http://www.daylongraphics.com/products/landshaper_golf/gallery/povray_flyover4.swf 


Ray


Post a reply to this message

From: Alain
Subject: Re: Animation with billboards
Date: 7 Jun 2009 10:54:01
Message: <4a2bd489$1@news.povray.org>
Ray Gardener nous illumina en ce 2009-06-06 20:27 -->
> Cousin Ricky wrote:
>> Now that is one wicked water hazard!
> 
> Yep. The heightfield is actually based on part of a real course, 
> although I forget where exactly (the layout anyway; I had to guess at 
> the elevations). Some people like their holes challenging. :)
> 
> There aren't any water hazards actually in the line of play; it's just 
> on the surrounding perimeter. If you shank, on another course you'd be 
> deep in some bad rough anyway (or on another fairway).
> 
> Shadows coming out nice per Alain's suggestion (attached image), the 
> video is about halfway rendered. I added 'no_reflection' to the 
> light-facing billboards as well to keep reflections matched to the 
> cam-facing boards.
> 
> Ray
> 
> 
> 
> ------------------------------------------------------------------------
> 
Now, the only thing that can tip you is that the bilboards don't self shadow. 
Most peoples won't notice that, it's minimised by the actual texture and the 
shadows from the other ones.


Post a reply to this message

From: Darren New
Subject: Re: Animation with billboards
Date: 7 Jun 2009 12:46:19
Message: <4a2beedb$1@news.povray.org>
Ray Gardener wrote:
> Same animation, with shadows:

Very nice. You have to look very close to tell the trees are billboards.

-- 
   Darren New, San Diego CA, USA (PST)
   There's no CD like OCD, there's no CD I knoooow!


Post a reply to this message

From: John VanSickle
Subject: Re: Animation with billboards
Date: 8 Jun 2009 08:28:51
Message: <4a2d0403$1@news.povray.org>
Ray Gardener wrote:
> Hi all, thought I'd share the output of Leveller's recent changes to its 
> POV-Ray export -- textured billboards that auto-rotate to face the 
> camera during stills and animations, plus path-based camera motion.

One thing you could try is to render a scene with just the 3d model of 
the tree from the same general direction as the camera will view the 
actual tree in the final scene; then use this image as the visible 
billboard representation of each tree in the scene.  That will tend to 
mitigate the "Doom corpse" effect, IYKWIM.  For each frame, render the 
tree from that frame's view direction.

The model will be the only thing in the scene and should render quickly.

Also, the shady side of the tree will be darker than the sunny side of 
the tree.

For the shadow, you would use one consistent image_map for all of the 
frames, rendered with a camera where the sun would be, against the 
ground as background.

The upshot is that each frame is done in a two-render pass, one for the 
image_map for the visible tree objects, and then the final render for 
the frame.

For additional fun and games, you could also make specially-blurred 
image_maps from the tree renders, so that when they are used in the 
final render they are automatically anti-aliased and will not flicker in 
the animation.  I used this in my IRTC entry "Robotany" to make some 
lettering smoothly legible without insane levels of anti-aliasing.

Regards,
John


Post a reply to this message

From: Ray Gardener
Subject: Re: Animation with billboards
Date: 22 Jun 2009 22:40:37
Message: <4a4040a5$1@news.povray.org>
Alain wrote:
> Now, the only thing that can tip you is that the bilboards don't self 
> shadow. Most peoples won't notice that, it's minimised by the actual 
> texture and the shadows from the other ones.

For trees, yes, it's not too bad. I'm now working with grass and, 
depending on the variation of blade color and height, the lack of 
self-shadowing in grass is much more noticeable.

Overall, I stress to end users that these are for prototype rendering. 
Given that the "age of multicore" is getting nicely underway, I don't 
expect to compete directly with proper rendering but rather to augment 
it. Especially for animations, e.g., in high-end studios you'll see them 
render out fast or realtime OpenGL clips, which look bad, but are great 
at conveying the location, shape, motion, etc. of elements. JvS's 
two-pass suggestion for billboard generating is interesting in that it's 
a fast and easy way to preview CSG objects -- all the complexity is 
flattened into an imagemap.

Granted, this competes with simply using low-quality settings, but 
having the option could be useful, because the type of quality tradeoff 
is quite different.

Ray


Post a reply to this message

From: Ray Gardener
Subject: Re: Animation with billboards
Date: 22 Jun 2009 22:44:04
Message: <4a404174$1@news.povray.org>
John VanSickle wrote:
> Ray Gardener wrote:
>> Hi all, thought I'd share the output of Leveller's recent changes to 
>> its POV-Ray export -- textured billboards that auto-rotate to face the 
>> camera during stills and animations, plus path-based camera motion.
> 
> One thing you could try is to render a scene with just the 3d model of 
> the tree from the same general direction as the camera will view the 
> actual tree in the final scene; then use this image as the visible 
> billboard representation of each tree in the scene.  That will tend to 
> mitigate the "Doom corpse" effect, IYKWIM.  For each frame, render the 
> tree from that frame's view direction.
> 
> The model will be the only thing in the scene and should render quickly.
> 
> Also, the shady side of the tree will be darker than the sunny side of 
> the tree.

Yeah, I'd like to try that. My tree models aren't too complex, should 
only add a few seconds per frame. I can also skip imagemap creation 
every N-1 out of N frames given some angular tolerance, say, wait until 
the camera angle has gone above five degrees from the last time we 
rendered imagemaps.

Ray


Post a reply to this message

<<< Previous 3 Messages Goto Initial 10 Messages

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