Jump to content


[Guide] Rendering LDraw models using POV-Ray

LDraw POV-Ray Rendering render

  • Please log in to reply
410 replies to this topic

#26 C3POwen

C3POwen

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

Posted 10 February 2012 - 07:54 PM

View Postmarkg, on 10 February 2012 - 07:32 PM, said:

Here are two images, the first, lighter image is from 3.7 and the second darker image is from 3.6.  I prefer the 3.6 image - any idea what settings I need to change in 3.7 to improve the image?  I'm using the same *.pov file for both renders.
I've found that POV-Ray 3.7 has some gamma issues when rendering from the default LGEO library.

I've got around this by adding a line to the "lg_color.inc" file, which can be located at "C:\Program Files\LDraw\LGEO\lg" (use "C:\Program Files (x86)\LDraw\LGEO\lg" for 64-bit Windows).

You can open this using any text editor and, near the top of the file, insert the following:

global_settings {
  assumed_gamma 2.2
  }
Save the file, close POV-Ray 3.7 and then restart it. You should find that the render in 3.7 is now almost identical.

This is something that I need to add to the guide, as I'd completely forgotten I'd set that up after installing POV-Ray 3.7.

Incidentally, you may need to add some new custom resolutions to your "quickres.ini" file, as your POV-Ray file looks like it's trying to create a 16:9 image.

View Postlegolijntje, on 10 February 2012 - 07:46 PM, said:

I've got a little problem. Actually it isn't really a problem, but when I render, my black parts always look more like dark grey parts, maybe that's because of the lightning, I don't know, but how can I solve this?
A few questions: Which version of POV-Ray are you using? If it's 3.7, then it may be the problem that markg mentioned above. Do the other colours also look too bright or washed out? Are you using the fog function?

If all of the colours look fine apart from the black, then it may be an issue with the colour definitions that are being used. Do you have an example *.pov file that I could look at? And perhaps an example image that you've created, so I can run a render and compare?

If you're using fog, then you may need to increase the distance that it starts affecting the render.
GUIDE: Rendering LDraw models using POV-Ray (Updated 2014-01-16) | Useful POV-Ray files

Rendering tip: The LDraw colour palette contains definitions for rubber colours. If tyres are set to colour 256 (Rubber Black), they will look more like rubber when it comes to rendering.

#27 markg

markg

    Posts: 19
    Joined: 20-April 10
    Member: 10352
    Country: Canada

Posted 10 February 2012 - 08:52 PM

View PostC3POwen, on 10 February 2012 - 07:54 PM, said:

I've found that POV-Ray 3.7 has some gamma issues when rendering from the default LGEO library.

I've got around this by adding a line to the "lg_color.inc" file, which can be located at "C:\Program Files\LDraw\LGEO\lg" (use "C:\Program Files (x86)\LDraw\LGEO\lg" for 64-bit Windows).

You can open this using any text editor and, near the top of the file, insert the following:

global_settings {
  assumed_gamma 2.2
  }
Save the file, close POV-Ray 3.7 and then restart it. You should find that the render in 3.7 is now almost identical.

Thanks - this fixed it for me.

cheers - mark

#28 Palathadric

Palathadric

  • Makes other members' internet speeds seem ridiculously fast


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

Posted 11 February 2012 - 12:39 PM

View Postwhitew0lf, on 10 February 2012 - 07:09 AM, said:

If POV-RAy do not recognize LGEO parts probably it is not defined in it's master ini file. To do so in POV-RAy go to 'tools', edit master POVRAY.INI and in the end where is something like this
Library_Path="C:\Windows\Fonts"
add these lines:
Library_Path="C:\LDraw\LGEO"
Library_Path="C:\LDraw\LGEO\lg"
Library_Path="C:\LDraw\LGEO\ar"
(of course the path depends on where the LGEO files are)
I hope this helps.
Okay, I did this, and it didn't work at first, but, after a few tweaks, it did work. So now I can render with LGEO. Great! However, I could not use the "Koyancolours" file. It just shows all these errors, I don't understand why. I did it as it said in the guide. Perhaps I should download POV-Ray 3.7, as that way I would at least be on the same page as the rest of you as far as the actual programme is concerned.
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

#29 C3POwen

C3POwen

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

Posted 11 February 2012 - 02:49 PM

View Postpalathadric, on 11 February 2012 - 12:39 PM, said:

However, I could not use the "Koyancolours" file. It just shows all these errors, I don't understand why. I did it as it said in the guide.
I've not tried using that set of colours, but I know it requires a bit of customisation on the side of the user first. I'll be posting my set of colours soon, once I've completely updated it, and this should work with LDView-generated files without issue.

View Postpalathadric, on 11 February 2012 - 12:39 PM, said:

Perhaps I should download POV-Ray 3.7, as that way I would at least be on the same page as the rest of you as far as the actual programme is concerned.
Either one should be fine. They both require some manual setup (with 3.7 needing a little more), but are essentially the same program, except 3.7 can utilise more than one CPU.
GUIDE: Rendering LDraw models using POV-Ray (Updated 2014-01-16) | Useful POV-Ray files

Rendering tip: The LDraw colour palette contains definitions for rubber colours. If tyres are set to colour 256 (Rubber Black), they will look more like rubber when it comes to rendering.

#30 Palathadric

Palathadric

  • Makes other members' internet speeds seem ridiculously fast


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

Posted 11 February 2012 - 03:53 PM

View PostC3POwen, on 11 February 2012 - 02:49 PM, said:

Either one should be fine. They both require some manual setup (with 3.7 needing a little more), but are essentially the same program, except 3.7 can utilise more than one CPU.
Definitely downloading. :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

#31 Brickdoctor

Brickdoctor

  • On a Title Roll


    Posts: 20369
    Joined: 06-June 10
    Member: 11254
    Country: California, USA

Posted 12 February 2012 - 02:22 AM

These commands that you're editing into the POV-Ray file can be used for MegaPOV, too, right? (same file type, I believe)

#32 C3POwen

C3POwen

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

Posted 12 February 2012 - 02:47 PM

View PostBrickdoctor, on 12 February 2012 - 02:22 AM, said:

These commands that you're editing into the POV-Ray file can be used for MegaPOV, too, right? (same file type, I believe)
Yes, as far as I'm aware. MegaPOV is just a branch of POV-Ray 3.6, so it should all work fine as long as the LGEO paths are set up correctly.

From what I've read, MegaPOV also has some nifty effects that don't appear in POV-Ray, such as blurred reflections (which can be achieved in POV-Ray, but not so easily) which would be brilliant for things like the visor in 3365 Space Moon Buggy.
GUIDE: Rendering LDraw models using POV-Ray (Updated 2014-01-16) | Useful POV-Ray files

Rendering tip: The LDraw colour palette contains definitions for rubber colours. If tyres are set to colour 256 (Rubber Black), they will look more like rubber when it comes to rendering.

#33 Calabar

Calabar

    Posts: 2072
    Joined: 11-April 10
    Member: 10232
    Country: Italy

Posted 12 February 2012 - 03:30 PM

Someone some posts ago linked a guide about creating transparent backgrounds (that is very interesting for me).
That guide seems to refers to MegaPOV. So it is necessary to achieve this option or it is possible with POWRay too?
"Official LEGO Sets made in LDD" topic: Read guidelines before posting!

#34 hrontos

hrontos

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

Posted 12 February 2012 - 04:10 PM

View PostCalabar, on 12 February 2012 - 03:30 PM, said:

Someone some posts ago linked a guide about creating transparent backgrounds (that is very interesting for me).
That guide seems to refers to MegaPOV. So it is necessary to achieve this option or it is possible with POWRay too?

It works in POV-Ray. Just add

background { color rgbft 1 }

to your scene and render with +ua option.

#35 Palathadric

Palathadric

  • Makes other members' internet speeds seem ridiculously fast


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

Posted 12 February 2012 - 04:11 PM

Is MegaPOV "better" than POV-Ray?
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

#36 hrontos

hrontos

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

Posted 12 February 2012 - 04:21 PM

View Postpalathadric, on 12 February 2012 - 04:11 PM, said:

Is MegaPOV "better" than POV-Ray?
For LEGO rendering purposes not.

MegaPOV has richer scene definition language. It supports hdr lighting which was not supported by POV-Ray before version 3.7.

POV-Ray 3.7 support multi processing and that's the main benefit. HDR lighting is also supported.

#37 Palathadric

Palathadric

  • Makes other members' internet speeds seem ridiculously fast


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

Posted 12 February 2012 - 04:30 PM

Right. Thanks! So POV-Ray 3.7 it is then.
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

#38 C3POwen

C3POwen

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

Posted 12 February 2012 - 05:13 PM

View Posthrontos, on 12 February 2012 - 04:10 PM, said:

It works in POV-Ray. Just add

background { color rgbft 1 }

to your scene and render with +ua option.
Well, I've given it a go and it does indeed seem to work, although there's a slight "halo" around the actual model itself if you use anti-aliasing, so it's worth rendering without anti-aliasing and then resizing the image in a graphics program afterwards.

It also adds true alpha transparency to see-through elements, which is good to see.

For those not sure where to add the +UA, it goes in the text box to the right of the resolution presets. Also, if you're using POV-Ray 3.6, which defaults to the BMP file format, enter +FN +UA to force a PNG file with transparency.

I'll be adding this to the main guide soon. Thanks, hrontos!

NOTE: The guide has been updated with the above, as well as a bit more about lighting.

Edited by C3POwen, 12 February 2012 - 06:34 PM.

GUIDE: Rendering LDraw models using POV-Ray (Updated 2014-01-16) | Useful POV-Ray files

Rendering tip: The LDraw colour palette contains definitions for rubber colours. If tyres are set to colour 256 (Rubber Black), they will look more like rubber when it comes to rendering.

#39 Calabar

Calabar

    Posts: 2072
    Joined: 11-April 10
    Member: 10232
    Country: Italy

Posted 14 February 2012 - 05:24 PM

@C3POwen
Could you give us some approximate indications about the time necessary for a rendering?

I'd like to know:
- time necessary for a rendering such as the one we see in the guide, with your PC (your processor is?)
- how the size of the model influence the rendering time (using same effects, lights and resolution)
- how optional effects increase the rendering time: increasing resolution and disabling antialiasing, or applying Radiosity and HDR.


Another thing about the guide.
Step 8.3
Instead than require the use of the regedit, you could prepare a zip containing both the MLCad.grp file and a .reg file to make the modify on the windows register.
"Official LEGO Sets made in LDD" topic: Read guidelines before posting!

#40 C3POwen

C3POwen

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

Posted 14 February 2012 - 06:52 PM

View PostCalabar, on 14 February 2012 - 05:24 PM, said:

@C3POwen
Could you give us some approximate indications about the time necessary for a rendering?
I'll put some things together for you in the guide regarding how long it takes me to produce the images currently shown. As for radiosity and HDR, I've not tried these out so wouldn't be able to give you an idea of how long it might take for a little while, until I have some time to actually play around with these settings.

View PostCalabar, on 14 February 2012 - 05:24 PM, said:

Another thing about the guide.
Step 8.3
Instead than require the use of the regedit, you could prepare a zip containing both the MLCad.grp file and a .reg file to make the modify on the windows register.
I've just added a REG file to the guide to accomplish this at your suggestion.
GUIDE: Rendering LDraw models using POV-Ray (Updated 2014-01-16) | Useful POV-Ray files

Rendering tip: The LDraw colour palette contains definitions for rubber colours. If tyres are set to colour 256 (Rubber Black), they will look more like rubber when it comes to rendering.

#41 hrontos

hrontos

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

Posted 14 February 2012 - 07:18 PM

HDR lighting itself does not have influence on performance. It works with radiosity and performance of radiosity does not directly depend on it. This means if you use HDR image or solid color sky sphere the radiosity sampling will take almost the same time.

Radiosity itself is controlled by more than 10 parameters and it be like few hundreds of pixels per second to few pixels per minute. It does not make sense to go below 20 pixels per seconds. The will be no significant difference for us "amauter renderers". This performance is for i3@2.4GHz rendering using POV-Ray 3.7 utilizing all four available cores.

#42 C3POwen

C3POwen

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

Posted 22 February 2012 - 08:04 PM

Updated the guide with some extra information on transparency usage, as well as a link to a useful guide.
GUIDE: Rendering LDraw models using POV-Ray (Updated 2014-01-16) | Useful POV-Ray files

Rendering tip: The LDraw colour palette contains definitions for rubber colours. If tyres are set to colour 256 (Rubber Black), they will look more like rubber when it comes to rendering.

#43 Calabar

Calabar

    Posts: 2072
    Joined: 11-April 10
    Member: 10232
    Country: Italy

Posted 22 February 2012 - 08:18 PM

View PostC3POwen, on 22 February 2012 - 08:04 PM, said:

Updated the guide with some extra information on transparency usage, as well as a link to a useful guide.
Great!
Did you handle shadows on transparency background too? (EDIT: I read the other topic only now!)
Can we consider now the guide as "definitive" or there is other things you plan to add/modify?
"Official LEGO Sets made in LDD" topic: Read guidelines before posting!

#44 C3POwen

C3POwen

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

Posted 22 February 2012 - 08:30 PM

View PostCalabar, on 22 February 2012 - 08:18 PM, said:

Great!
Did you handle shadows on transparency background too?
Can we consider now the guide as "definitive" or there is other things you plan to add/modify?
I'm afraid the shadows on transparency is a bit beyond what I've learnt so far, and the linked guide is the best thing I've come across for those wanting to achieve it.

I still plan on adding some stuff about radiosity, but I'll save that for when I've got more free time to truly experiment, since (as hrontos said previously) processing it can take a long time.

Really, the guide is more to get someone to a point where they have a fair understanding of what they're doing and why, and to let them experiment from there.

I also need to finish two downloadable files that should improve colours when rendering, but it's a very laborious task... :hmpf:
GUIDE: Rendering LDraw models using POV-Ray (Updated 2014-01-16) | Useful POV-Ray files

Rendering tip: The LDraw colour palette contains definitions for rubber colours. If tyres are set to colour 256 (Rubber Black), they will look more like rubber when it comes to rendering.

#45 Palathadric

Palathadric

  • Makes other members' internet speeds seem ridiculously fast


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

Posted 25 February 2012 - 02:17 PM

Stil waiting for those colour files. :classic:
Thanks for guide. Renders are already looking pretty good.
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

#46 Blakbird

Blakbird

  • Technic Angel of Retribution


    Posts: 2033
    Joined: 09-November 07
    Member: 2164
    Country: USA

Posted 26 February 2012 - 07:37 AM

View PostC3POwen, on 08 February 2012 - 05:39 PM, said:

I have to admit that I've yet to give radiosity and HDR lighting a go, but I shall certainly try at some point, and then update the guide.

Does it increase rendering times by much?
Yes. Good radiosity will increase the render time by 10-100X. If there is any transparency involved (like your sample image), the time is much longer again. HDR doesn't really change the render time much. As an example, the sample I made of your render below uses radiosity and HDR and took about 4 hours to render on a quad-core. I also used brighter lights than you did, so that's not really part of the comparison. You will especially see differences in the reflections and in places which were not lit much in the original image.

Image

Edited by Calabar, 26 February 2012 - 10:57 AM.
Oversized image converted in text link

Blakbird
Technicopedia

#47 C3POwen

C3POwen

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

Posted 26 February 2012 - 02:36 PM

View PostBlakbird, on 26 February 2012 - 07:37 AM, said:

If there is any transparency involved (like your sample image), the time is much longer again. [...] As an example, the sample I made of your render below uses radiosity and HDR and took about 4 hours to render on a quad-core. [...] You will especially see differences in the reflections and in places which were not lit much in the original image.
Thanks for the comparison! There's certainly more detail showing where previously it looked darker.

Transparency certainly is a bit of a killer when it comes to rendering, and the more complex the part (such as having many transparent studs) the longer it takes.

What size did you render the model at, if you don't mind me asking?
GUIDE: Rendering LDraw models using POV-Ray (Updated 2014-01-16) | Useful POV-Ray files

Rendering tip: The LDraw colour palette contains definitions for rubber colours. If tyres are set to colour 256 (Rubber Black), they will look more like rubber when it comes to rendering.

#48 Blakbird

Blakbird

  • Technic Angel of Retribution


    Posts: 2033
    Joined: 09-November 07
    Member: 2164
    Country: USA

Posted 27 February 2012 - 01:26 AM

View PostC3POwen, on 26 February 2012 - 02:36 PM, said:

What size did you render the model at, if you don't mind me asking?

I rendered at 640x480 and then shrunk it down.
Blakbird
Technicopedia

#49 conchology

conchology

    Posts: 54
    Joined: 17-August 11
    Member: 19829
    Country: Philippines

Posted 27 February 2012 - 07:33 AM

View PostBrickdoctor, on 12 February 2012 - 02:22 AM, said:

These commands that you're editing into the POV-Ray file can be used for MegaPOV, too, right? (same file type, I believe)

Not everything is the same in MegaPOV and PovRay, some things work and others don't work. Even color can be differently rendered. You can check on the MegaPov website what is possible and not. The only downside is that I never managed to get LGEO to work on my mac with MegaPOV  :hmpf_bad:

The best thing in MegaPOV for me is that the you can do great things with HDR light, etc... for reflection on material and to get very realistic images  :thumbup:

#50 Palathadric

Palathadric

  • Makes other members' internet speeds seem ridiculously fast


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

Posted 27 February 2012 - 08:30 AM

View PostBlakbird, on 26 February 2012 - 07:37 AM, said:

Yes. Good radiosity will increase the render time by 10-100X. If there is any transparency involved (like your sample image), the time is much longer again. HDR doesn't really change the render time much. As an example, the sample I made of your render below uses radiosity and HDR and took about 4 hours to render on a quad-core. I also used brighter lights than you did, so that's not really part of the comparison. You will especially see differences in the reflections and in places which were not lit much in the original image.

Image
Very nice render, Blakbird!
I will post one of my new renders sometime this week, so you can all see the progress. The minifigs look horrible now compared to the rest of the bricks. Will have to re-render all of my models without them, I think. Or maybe I'll do one with and one without.
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





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

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users