C3POwen

[Guide] Rendering LDraw models using POV-Ray

Recommended Posts

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.

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

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.

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Updated the guide with some extra information on transparency usage, as well as a link to a useful guide.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
Share on other sites

Stil waiting for those colour files. :classic:

Thanks for guide. Renders are already looking pretty good.

Share this post


Link to post
Share on other sites

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
Oversized image converted in text link

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

I rendered at 640x480 and then shrunk it down.

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
Share on other sites

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.

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.