C3POwen

[Guide] Rendering LDraw models using POV-Ray

Recommended Posts

Is there any way to make transparent less tasking to render? Trying to render water in an image, but it seems that for any decently-sized body of water, transparency is an absolute no-no.

Share this post


Link to post
Share on other sites

Have you tried to display it with a panorama viewer such as PTViewer?

I am assuming it will work, however I did not try it.

only problem I see is in my render vertical field of view is 180 degrees(can be changed) , I am not sure if they need 360 degrees.

Is there any way to make transparent less tasking to render? Trying to render water in an image, but it seems that for any decently-sized body of water, transparency is an absolute no-no.

Yeah, transparency is a CPU demanding process.

I am not really sure if there is a lot of things you cando to speed it up...

Switch to POV Ray 3.7 if you have multi core CPU (assuming you have 3.6 on multi core CPU)

render over night

watch a lot of movies.

Maybe somebody else can help better than I can...

How did you make water???

Edited by TotalyWicked

Share this post


Link to post
Share on other sites

Is there any way to make transparent less tasking to render? Trying to render water in an image, but it seems that for any decently-sized body of water, transparency is an absolute no-no.

In case of "water", the transparent parts could be possible defined the same way as non-transparent. Reason for slowness is the "merge" operation used for transparent parts instead of "union" which is used for non-transparent parts. "Merge" removes internal "walls" from an object that is constructed by combining other objects using constructive solid geometry. This makes it look like made from one piece of transparent material since internal walls are not visible.

But for water, I would say, it is not that bad to get some extra "sparkling waves" there due to those walls. So my suggestion is to cheat and use transparent material, but non-transparent geometry. I think, LGEO has each brick defined twice - once as transparent and once as non-transparent, so use the non-transparent. I wonder how much difference in speed and quality it will make.

Share this post


Link to post
Share on other sites

In case of "water", the transparent parts could be possible defined the same way as non-transparent. Reason for slowness is the "merge" operation used for transparent parts instead of "union" which is used for non-transparent parts. "Merge" removes internal "walls" from an object that is constructed by combining other objects using constructive solid geometry. This makes it look like made from one piece of transparent material since internal walls are not visible.

But for water, I would say, it is not that bad to get some extra "sparkling waves" there due to those walls. So my suggestion is to cheat and use transparent material, but non-transparent geometry. I think, LGEO has each brick defined twice - once as transparent and once as non-transparent, so use the non-transparent. I wonder how much difference in speed and quality it will make.

@hrontos is indeed correct. When you export a model from POV-Ray, if you use a transparent part it will use the "clear" variation of a part where it is merged together to create a completely "solid" part. If you look through your POV-Ray file, you'll see parts appended with "_clear", so a standard 2x4 brick would show as "lg_3001_clear". If you remove the "_clear" from the end of the part name, then it will use the standard non-merged part, where you'll notice some of the component shapes used to create the shape that would not normally show when being rendered with a solid/opaque colour.

I ran some tests using a transparent blue 2x4 brick rendered at 1600x900 with anti-aliasing turned on and no radiosity, and the results were as follows:

"Standard" LGEO part: 33 seconds

"Clear" LGEO part: 42 seconds

I then changed the colour to solid/opaque blue, and rendered both variations of the same brick, using the same settings as above:

"Standard" part with solid colour: 03 seconds

"Clear" part with solid colour: 04 seconds

Although using the "non-transparent" part may be slightly quicker, the more transparency you use will still cause it to render slowly. If you're using transparent bricks to render your water, then that could take days!

If you're using a plane to render the water, and just wish to apply some ripple effects, then perhaps try using a solid colour with some reflectivity to simulate a water effect.

Some good guides on this can be found here:

Share this post


Link to post
Share on other sites

Thanks, hrontos and C3POwen, will try with non-"clear" parts and see if I can reduce the rendering time sufficiently enough to make it worthwhile. Otherwise, I will just have to go with a solid blue colour, I suppose.

Share this post


Link to post
Share on other sites

I shall try and create a more accurate version of Chrome Gold (and Chrome Silver), as it should be more yellow, with perhaps a less mirror-like reflection.

Okay, thanks! :wub:

Well, better late than never... I've updated the colour definition for Chrome Gold (which I think looks a bit more accurate) and I've updated the current version of the LGEO Parts Pack download with this definition.

For a comparison, please see the below images, which are from 79000 Riddles for The Ring.

Before:

79000%20Old%20Chrome%20Gold.png

After:

79000%20New%20Chrome%20Gold.png

I've also been working on a few new parts, as well as a number of part fixes, and will look into releasing a full update to the parts pack soon.

Share this post


Link to post
Share on other sites

Well, better late than never... I've updated the colour definition for Chrome Gold

Great, thanks! I have been awaiting this. It does look a lot better! :classic:

My tryout rendering of several layers of trans-blue using the non-clear LGEO pieces, didn't turn out great:

tryout.png

Although I have to say that rendering time was reduced dramatically. :grin:

Share this post


Link to post
Share on other sites

Great, thanks! I have been awaiting this. It does look a lot better! :classic:

My tryout rendering of several layers of trans-blue using the non-clear LGEO pieces, didn't turn out great:

Although I have to say that rendering time was reduced dramatically. :grin:

Really does not look very good.

So second attempt: use clear LGEO pieces, but use smaller parts. LDD2POVRay converted model took ages with 8x8 plate, but only a fraction of that when I used 64 1x1 plates. So try many smaller parts (16 1x1 plates) instead of each of those 4x4 plates. This speed improvement is related to bounding boxes POV-Ray uses.

Share this post


Link to post
Share on other sites

I'll try it out. If it works, no wonder my old renders didn't work. They were done with 16 x 16 plates. :laugh:

Share this post


Link to post
Share on other sites

I'll try it out. If it works, no wonder my old renders didn't work. They were done with 16 x 16 plates. :laugh:

:laugh: I am not sure you would manage with those plates to post the rendered pictures till the end of the world.

Edited by hrontos

Share this post


Link to post
Share on other sites

GUIDE UPDATE: I have updated the LGEO-Update.zip file in the Downloads section with 6 new parts, 1 updated part and 31 fixed parts.

LGEO-Update-2012-12-15.png

The FIXED, UPDATED and NEW LGEO parts from the 2012-12-15 update

The main improvement here is that the tips for a lot of slopes now render at the correct height (about the same height as a stud). There are some slope parts that I still need to fix, and not all of them are particularly straightforward.

I've also started to play with image maps, where a part is overlain with an image (such as with the two 1x8 tiles from the Architecture series).

The colour definitions also includes the Chrome Gold update from the 12th.

Edited by C3POwen

Share this post


Link to post
Share on other sites

So I finally tried HDRI with POV-Ray. I am still not 100% happy with end results. Also i still need to figure out how to add a floors that does not reflect environment, and only reflects object.

hdr_test_1.jpg

hdr_test_2_g2.2.jpg

Edited by TotalyWicked

Share this post


Link to post
Share on other sites

Also i still need to figure out how to add a floors that does not reflect environment, and only reflects object.

That will be tricky if not impossible at all. You can make skysphere as not being visible in reflections, but this means, that model will also not reflect it. Or you can make floor non-reflective but this would mean that also model will not be reflected.

The only solution that came to my mind right now is two pass render. Render whole scene with sky sphere not visible in reflections and with no_image statement on the model. This will get you the environment and the floor with reflection of only model. On second pass render only model with sky sphere visible in reflections but render with transparency output. This should give you image containing only the model (no environment, no floor). Overlay the second over the first to get complete output.

Share this post


Link to post
Share on other sites

So second attempt: use clear LGEO pieces, but use smaller parts. LDD2POVRay converted model took ages with 8x8 plate, but only a fraction of that when I used 64 1x1 plates. So try many smaller parts (16 1x1 plates) instead of each of those 4x4 plates. This speed improvement is related to bounding boxes POV-Ray uses.

Tried it out and got this:

tryout3.png

So I think it could just be the colour of the top plate that looks bad. I think it's very_light_trans_blue or something. I'm thinking though that since the transparency hardly gets through the second layer, much less the third, I'll just settle for three layers. Let me see how that works out. :classic:

By the way, this took approximately 12 hours to render, so not great either.

Though I have to say that this render does look a lot better than the last one. :grin:

Edited by Palathadric

Share this post


Link to post
Share on other sites

By the way, this took approximately 12 hours to render, so not great either.

Though I have to say that this render does look a lot better than the last one. :grin:

Yes, it looks much better. It was finished before the end of the world so it is quite good time. :grin:

Further improvement you can achieve by using bricks without the word "LEGO" on them. Definitely on second and third layer, may be even on first layer. Since you need larger watter it will not be visible either so skip it from the begining and save additional time.

Share this post


Link to post
Share on other sites

Can I take the logo off individual pieces or only off all of them?

Share this post


Link to post
Share on other sites

Can I take the logo off individual pieces or only off all of them?

It is a bit tricky. In LGEO, the presence of logo depends on setting of lg_quality.

Studs are globally declared in lg_defs.inc. Declarations are made only if variable LG_DEFS_INC is not defined.

This means, if you sort your bricks, you can set the lg_quality to max for first layer and the set it to lower level for later layers. After setting to lower value, undefine LG_DEFS_INC to force redefinition of the studs and other global objects which depend on the lg_quality.

Taking into account the size of your model, I think, the logo will not be visible at all, so you can skip it completely.

Share this post


Link to post
Share on other sites

If you manually edit the file, you might be able to change the value of lg_quality on the fly. Have it set to one value for the top layer so the logo appears, then change its value before doing the other layers. No guarantees, but it might work.

Share this post


Link to post
Share on other sites

That will be tricky if not impossible at all. You can make skysphere as not being visible in reflections, but this means, that model will also not reflect it. Or you can make floor non-reflective but this would mean that also model will not be reflected.

The only solution that came to my mind right now is two pass render. Render whole scene with sky sphere not visible in reflections and with no_image statement on the model. This will get you the environment and the floor with reflection of only model. On second pass render only model with sky sphere visible in reflections but render with transparency output. This should give you image containing only the model (no environment, no floor). Overlay the second over the first to get complete output.

I think i did it

hdri_3.jpg

single pass render

800x600, no AA, fast radiosity

i am still not 100% happy but its a start

Share this post


Link to post
Share on other sites

If you manually edit the file, you might be able to change the value of lg_quality on the fly. Have it set to one value for the top layer so the logo appears, then change its value before doing the other layers. No guarantees, but it might work.

But for the most part it's rendering both layers at the same time. :sceptic:

Share this post


Link to post
Share on other sites

I think i did it

single pass render

800x600, no AA, fast radiosity

i am still not 100% happy but its a start

I think, I miss something. I thought you want to avoid the environment (HDR image) to be reflected on the floor, while still reflected on the minifigures.

But for the most part it's rendering both layers at the same time. :sceptic:

Yes, it is rendering whole model at once. But parsing is sequential and this means, you can change settings (even material definitions) between two bricks.

If you POV file looks like this (just an pseudo example):

declaration of settings;

declaration of brick 1

declaration of brick 2

declaration of brick 3

You can change it to:

declaration of settings;

declaration of brick 1

declaration of brick 2

change of settings;

declaration of brick 3

This means, that brick 3 will use completely different quality and material settings (depending on what you will alter).

In this particular case the change of settings probably consists of these 3 lines:

#declare lg_quality = 2;

#undef(LG_DEFS_INC)

#include "lg_defs.inc"

Last two lines force the POV-Ray to do the basic declarations once again.

Share this post


Link to post
Share on other sites

I think, I miss something. I thought you want to avoid the environment (HDR image) to be reflected on the floor, while still reflected on the minifigures.

Sorry, let me clarify a bit.

HDRI map I am using, already has celing reflected on the floor.

That's why I only need to reflect a minifig, and ignore HDRI map

To avoid double celing reflection.

I hope this makes it more clear...

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.