roland

LDraw POV-Ray animations

Recommended Posts

Hi all,

I was wondering if anyone here has experience animating LDraw models using POV-Ray.

I'm working on a POV-Ray animation feature for my LDCad program. The export it self is going well but I have too little experience using POV-Ray to fine tune all those quality settings.

So I'm looking for some help in that department.

I'm mainly thinking about the global settings, this is what I'm using now:

#declare doRadiosity=true;
#declare useHQRadiosity=(frameCnt>1);

global_settings {
ambient_light rgb <1,1,1>
assumed_gamma 2.2000
max_trace_level 20

#if (doRadiosity)
radiosity {
brightness 1.0000
media on
always_sample on
recursion_limit 6

#if (useHQRadiosity)
//this should reduce noise, but will be much slower
pretrace_end 0.01
//count 1000
low_error_factor 0.1
nearest_count 20
#end
}
#end
}

But I feel it might be less then optimal.

Any advice is welcome.

Share this post


Link to post
Share on other sites

Hi, my first advice is purely selfish: export the model as a separate file from the scene and settings, say “model.inc” for the model and “model.pov” for the scene.

For now, I’m using LDView (which works fine with LGEO) and a script to get rid of the scene’s particulars in order to use mine (ground, lights, settings…).

As for radiosity, it’s really hard to tune. General settings don’t work (and are not given by official sources (apart from the presettings which are always qualified as “a start before fine tuning”)).

I use these settings for HQ, that’s sloowww:

   pretrace_start 64/image_width
   pretrace_end 4/image_width
   count 800
   nearest_count 20
   error_bound 0.2
   recursion_limit 1
   low_error_factor 0.7
   gray_threshold 0
   minimum_reuse 0.005
   brightness 1.0
   adc_bailout 0.01/2
   normal on
   media on

For some scenes (e.g. lots of white bricks/tiles), pretrace_end can go down to 1/image_width. Else, I get artifacts (“dust” in lightly shadowed corners).

The shiny nature of LEGO is at play here.

I also tried “photons” to get a better feel to transparent parts. That’s not worth it: you need a lot of photons to see something a bit useful and it adds between 1 and 10 times of computation time.

As for animations, I dreamt of using POV-Ray’s clock to move groups of parts but only gone so far as automating the render of different poses….

Share this post


Link to post
Share on other sites

I agree to SylvainLS: Rendering radiosity settings, especially HQ radiosity settings consumes a lot of time. Especially if you not just have a single render but a sequence of many renders.

I use very simple global settings for most of my renders: global_settings { assumed_gamma 1.0 }

Usually I do not use radiosity for my renders at all. My experience is that radiosity does not much improve the visual impact of a lego render. The main issue for a render with respect to a natural look is lighting! So if your lighting is poor, your render looks kind of artificial.

However, in the case that I use radiosity settings I use very fast and low Q settings:

radiosity {

pretrace_start 0.08

pretrace_end 0.02

count 50

error_bound 0.5

recursion_limit 1

}

So what’s the reason that you are not satisfied with your render? Which feature is less optimal? May you please provide a render?

regards

Papacharly

Share this post


Link to post
Share on other sites

Thanks to both for your thoughts.

Hi, my first advice is purely selfish: export the model as a separate file from the scene and settings, say “model.inc” for the model and “model.pov” for the scene.

For now, I’m using LDView (which works fine with LGEO) and a script to get rid of the scene’s particulars in order to use mine (ground, lights, settings…).

I was thinking about allowing include files to override stuff but have a contained single .pov by default.

So what’s the reason that you are not satisfied with your render? Which feature is less optimal? May you please provide a render?

The main thing I'm 'fighting' currently is to have a single default setup which looks good/roughly the same color wise when used with or without radiosity enabled.

Currently this gives me (without radiosity):

testA.png

and (with radiosity)

testB.png

Which seems over exposed (I think I'm using emission wrong, but I read somewhere to use that instead of ambient).

I also don't really understand the sky sphere, as yesterday it blended the whole scene and now it suddenly only changes the background color and seem to influence the global lighting while I'm pretty sure nothing has changed :sceptic:

This is generated from my current test export:

http://www.melkert.net/test/povTest.zip

The zip includes the original ldraw file and the LDCad animation script, but will only work with my last dev build, but might give some insight in how animations are generated (feedback on that is also welcome).

Share this post


Link to post
Share on other sites

Just got the blended background again, same settings just a bigger model (with radiosity same settings as the above zip file):

testC.png

Edited by roland

Share this post


Link to post
Share on other sites

Roland,

from my understanding

(1) ambient is a simple, but effective and good method to add lighting to black shadowed areas. You may state this method is kind of a fake.

(2) radiosity is an high Q and advanced ray tracing method to calculate the influence of scattered light from all parts to all other parts, respectively to shadowed areas too. So this method simulates reality. Obviously this is a time consuming procedure.

(3) emission is not meant to replace ambient light or radiosity. If you add emission to parts, these parts will emit light, they act as a light source!! As bricks usually do not glow, I think its better to not use emission. The same is true for your plane (floor).

BTW: A good method to only see e.g. the influence of the plane (or any other part) is to switch off all other lights (light sources, sky sphere, glowing bricks,…).

Feasible standard values (without radiosity) usually are ambient 0.3 and diffuse 0.7. If you use radiosity instead you may set ambient to 0 and diffuse to 1.

This is your setup (test_pc.pov, incl_pc.pov) without emission and radiosity, but with ambient 0.3 and diffuse 0.7:

640x640.jpg

Not sure I understood your requirement “single default setup …” in the right way:

If you use the same settings for rendering, rendering either with or without radiosity definitely has to lead to different results. If you would not see any difference after rendering it would make no sense to add radiosity.

Sky sphere: I do not use sky sphere as a light source. It generates some kind of homogeneous respectively unnatural lighting from all directions. I prefer setting up specific light sources. It may make sense if you wish to create some patterned sky, respectively if you explicitly intend to show parts of a patterned sky in your renders. So what’s the reason for using sky sphere? What are you aiming for?

BTW: An excellent povray tutorial with lots of examples can be found here.

Share this post


Link to post
Share on other sites

Thanks for the info and alternative .pov's

from my understanding

(1) ambient is a simple, but effective and good method to add lighting to black shadowed areas. You may state this method is kind of a fake.

(2) radiosity is an high Q and advanced ray tracing method to calculate the influence of scattered light from all parts to all other parts, respectively to shadowed areas too. So this method simulates reality. Obviously this is a time consuming procedure.

(3) emission is not meant to replace ambient light or radiosity. If you add emission to parts, these parts will emit light, they act as a light source!! As bricks usually do not glow, I think its better to not use emission. The same is true for your plane (floor).

I'm not sure about ambiant/emission thing, from the povray helpfile:

Note: Versions of POV-Ray prior to 3.7 did not provide the emission keyword for finish, and it was customary to resort to ambient instead for such purpose. This is now discouraged, as ambient is now disabled when using radiosity.

This is why I switched to emission, it works quite well until you add a sky sphere.

Not sure I understood your requirement “single default setup …” in the right way:

If you use the same settings for rendering, rendering either with or without radiosity definitely has to lead to different results. If you would not see any difference after rendering it would make no sense to add radiosity..

I meant a single file using control variables, so #if can be used to make decisions I was hoping to the user a single 'out of the box' setup which will look decent when using ether option.

That way you could e.g. use radiosity for single frames and disable it for animation (that is if you're unwilling to let it render for hours when doing a animation of a couple of minutes :) )

I didn't like the hard separation between floor and the horizon you see when the camera angle is low.

Thanks again for the feed back papacharly.

Share this post


Link to post
Share on other sites

This is why I switched to emission, it works quite well until you add a sky sphere.

Hard to realize that my povray knowledge is kind of old-fashioned, as I still stick to ambient instead of emission. Seems I have to learn again and reconsider my technique (some day) ... :wink:

I didn't like the hard separation between floor and the horizon you see when the camera angle is low.

Possible solutions for avoiding this hard separation are given in this topic.

And kudos to you for doing all the work with respect to LDcad!! Great tool.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.