Jump to content


[Guide] Rendering LDraw models using POV-Ray

LDraw POV-Ray Rendering render

  • Please log in to reply
420 replies to this topic

#226 Philo

Philo

    Posts: 325
    Joined: 07-April 10
    Member: 10185
    Country: France

Posted 27 November 2012 - 09:34 AM

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

#227 Palathadric

Palathadric

  • Makes other members' internet speeds seem ridiculously fast


    Posts: 5190
    Joined: 30-July 11
    Member: 19379
    Country: Great Unknown

Posted 09 December 2012 - 08:27 PM

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.
They that love God will never meet for the last time.
This life isn't the end. We will meet again.
Posted Image     Posted Image     Posted Image
Brickshelf Account
See my work in the Official Lego sets made in LDraw topic

#228 TotalyWicked

TotalyWicked

    Posts: 110
    Joined: 07-February 12
    Member: 25823

Posted 10 December 2012 - 05:06 PM


View PostPhilo, on 27 November 2012 - 09:34 AM, said:

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.

View PostPalathadric, on 09 December 2012 - 08:27 PM, said:

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, 10 December 2012 - 05:20 PM.


#229 hrontos

hrontos

    Posts: 624
    Joined: 05-August 11
    Member: 19500
    Country: Slovakia

Posted 10 December 2012 - 05:11 PM

View PostPalathadric, on 09 December 2012 - 08:27 PM, said:

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.

#230 C3POwen

C3POwen

    Posts: 400
    Joined: 01-November 10
    Member: 14029
    Country: United Kingdom

Posted 10 December 2012 - 09:04 PM

View Posthrontos, on 10 December 2012 - 05:11 PM, said:

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:

#231 Palathadric

Palathadric

  • Makes other members' internet speeds seem ridiculously fast


    Posts: 5190
    Joined: 30-July 11
    Member: 19379
    Country: Great Unknown

Posted 11 December 2012 - 12:05 AM

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.
They that love God will never meet for the last time.
This life isn't the end. We will meet again.
Posted Image     Posted Image     Posted Image
Brickshelf Account
See my work in the Official Lego sets made in LDraw topic

#232 C3POwen

C3POwen

    Posts: 400
    Joined: 01-November 10
    Member: 14029
    Country: United Kingdom

Posted 12 December 2012 - 10:37 PM

View PostC3POwen, on 30 September 2012 - 11:52 AM, said:

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.

View PostPalathadric, on 30 September 2012 - 03:39 PM, said:

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:
Posted Image

After:
Posted Image

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.

#233 Palathadric

Palathadric

  • Makes other members' internet speeds seem ridiculously fast


    Posts: 5190
    Joined: 30-July 11
    Member: 19379
    Country: Great Unknown

Posted 12 December 2012 - 11:28 PM

View PostC3POwen, on 12 December 2012 - 10:37 PM, said:

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:
Posted Image
Although I have to say that rendering time was reduced dramatically. :grin:
They that love God will never meet for the last time.
This life isn't the end. We will meet again.
Posted Image     Posted Image     Posted Image
Brickshelf Account
See my work in the Official Lego sets made in LDraw topic

#234 hrontos

hrontos

    Posts: 624
    Joined: 05-August 11
    Member: 19500
    Country: Slovakia

Posted 13 December 2012 - 12:14 AM

View PostPalathadric, on 12 December 2012 - 11:28 PM, said:

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.

#235 Palathadric

Palathadric

  • Makes other members' internet speeds seem ridiculously fast


    Posts: 5190
    Joined: 30-July 11
    Member: 19379
    Country: Great Unknown

Posted 13 December 2012 - 08:30 AM

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:
They that love God will never meet for the last time.
This life isn't the end. We will meet again.
Posted Image     Posted Image     Posted Image
Brickshelf Account
See my work in the Official Lego sets made in LDraw topic

#236 hrontos

hrontos

    Posts: 624
    Joined: 05-August 11
    Member: 19500
    Country: Slovakia

Posted 13 December 2012 - 10:38 AM

View PostPalathadric, on 13 December 2012 - 08:30 AM, said:

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, 15 December 2012 - 10:03 PM.


#237 C3POwen

C3POwen

    Posts: 400
    Joined: 01-November 10
    Member: 14029
    Country: United Kingdom

Posted 15 December 2012 - 05:51 PM

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.

Posted Image
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, 15 December 2012 - 06:30 PM.


#238 legolijntje

legolijntje

    Posts: 1941
    Joined: 06-June 10
    Member: 11214
    Country: The Netherlands

Posted 15 December 2012 - 06:26 PM

Thanks C3POwen, I hope I can try them out this weekend :thumbup:

#239 TotalyWicked

TotalyWicked

    Posts: 110
    Joined: 07-February 12
    Member: 25823

Posted 19 December 2012 - 04:57 PM

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.

Posted Image

Posted Image

Edited by TotalyWicked, 19 December 2012 - 05:03 PM.


#240 hrontos

hrontos

    Posts: 624
    Joined: 05-August 11
    Member: 19500
    Country: Slovakia

Posted 19 December 2012 - 09:25 PM

View PostTotalyWicked, on 19 December 2012 - 04:57 PM, said:

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.

#241 Palathadric

Palathadric

  • Makes other members' internet speeds seem ridiculously fast


    Posts: 5190
    Joined: 30-July 11
    Member: 19379
    Country: Great Unknown

Posted 19 December 2012 - 10:31 PM

View Posthrontos, on 13 December 2012 - 12:14 AM, said:

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:
Posted Image
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, 19 December 2012 - 10:32 PM.

They that love God will never meet for the last time.
This life isn't the end. We will meet again.
Posted Image     Posted Image     Posted Image
Brickshelf Account
See my work in the Official Lego sets made in LDraw topic

#242 hrontos

hrontos

    Posts: 624
    Joined: 05-August 11
    Member: 19500
    Country: Slovakia

Posted 19 December 2012 - 11:19 PM

View PostPalathadric, on 19 December 2012 - 10:31 PM, said:

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.

#243 Palathadric

Palathadric

  • Makes other members' internet speeds seem ridiculously fast


    Posts: 5190
    Joined: 30-July 11
    Member: 19379
    Country: Great Unknown

Posted 19 December 2012 - 11:42 PM

Can I take the logo off individual pieces or only off all of them?
They that love God will never meet for the last time.
This life isn't the end. We will meet again.
Posted Image     Posted Image     Posted Image
Brickshelf Account
See my work in the Official Lego sets made in LDraw topic

#244 hrontos

hrontos

    Posts: 624
    Joined: 05-August 11
    Member: 19500
    Country: Slovakia

Posted 20 December 2012 - 12:00 AM

View PostPalathadric, on 19 December 2012 - 11:42 PM, said:

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.

#245 LDView Travis

LDView Travis

    Posts: 19
    Joined: 09-April 12
    Member: 27850

Posted 20 December 2012 - 03:05 AM

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.

#246 TotalyWicked

TotalyWicked

    Posts: 110
    Joined: 07-February 12
    Member: 25823

Posted 20 December 2012 - 07:17 AM

hrontos,
Still looking for 1 pass solution.
so far this is the clothest thing i found.
Making matte/shadow-textures in instant-compositings

#247 TotalyWicked

TotalyWicked

    Posts: 110
    Joined: 07-February 12
    Member: 25823

Posted 20 December 2012 - 07:34 AM

View Posthrontos, on 19 December 2012 - 09:25 PM, said:

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
Posted Image
single pass render
800x600, no AA, fast radiosity
i am still not 100% happy but its a start

#248 Palathadric

Palathadric

  • Makes other members' internet speeds seem ridiculously fast


    Posts: 5190
    Joined: 30-July 11
    Member: 19379
    Country: Great Unknown

Posted 20 December 2012 - 08:17 AM

View PostLDView Travis, on 20 December 2012 - 03:05 AM, said:

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:
They that love God will never meet for the last time.
This life isn't the end. We will meet again.
Posted Image     Posted Image     Posted Image
Brickshelf Account
See my work in the Official Lego sets made in LDraw topic

#249 hrontos

hrontos

    Posts: 624
    Joined: 05-August 11
    Member: 19500
    Country: Slovakia

Posted 20 December 2012 - 11:03 AM

View PostTotalyWicked, on 20 December 2012 - 07:34 AM, said:

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.

View PostPalathadric, on 20 December 2012 - 08:17 AM, said:

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.

#250 TotalyWicked

TotalyWicked

    Posts: 110
    Joined: 07-February 12
    Member: 25823

Posted 20 December 2012 - 02:22 PM

View Posthrontos, on 20 December 2012 - 11:03 AM, said:



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...





Also tagged with one or more of these keywords: LDraw, POV-Ray, Rendering, render

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users