LDView POV-Ray rendering in 2020

POV-Ray rendering in 2020
I've been exploring lego rendering using the LDraw system over the last few months, and it's been quite a journey. I've found several guides online from over the last ten years that have had various tips on how to get a good render using LDraw & POV-Ray. There was a lot of great info in them, but some of the advice was now out of date, and I had to spend a while comparing info between guides to get a good process.

So, now that I have a process that I'm pretty happy with, I thought I'd share it here for other's interest, and feedback is also welcome.

0. Install the LDraw AIOI package
Install whatever designers you like, and for rendering I am using LDView, the LDraw parts library, and Pov-Ray 3.7. (I am not using any of the POV-Ray alternatives such as Mega-Ray etc, as it seems POV-Ray 3.7 is newer / better than them.)

After installing that, I also install the latest version of LDView I can get, newer than what is in the LDraw AIOI at time of writing, which does change the .pov file exported, it seems to use new features of POV-Ray 3.7. I downloaded it from here: https://github.com/tcobbs/ldview/release...v4.4_Beta2

1. Generate the POV-Ray file in LDView
When LDView exports to a .pov file, it knows about high resolution part models designed for rendering, which results in a much better quality render. (It's doing this by using LGEO.xml to map to .inc part files, instead of using the standard / editor .dat part definition files). 

The process to generate the pov file is to open your model file (probably an .ldr file) in LDView, then choose file menu, export...

I don't edit any of the options here, just save the file

2. Set up POV-Ray to render larger resolutions
You'll probably want to render a larger file than what POV-Ray offers by default. For one thing, the Anti-Aliasing in POVRay is not great. So, render at 2x the dimensions you want, then resize down in a program that has bicubic (or other better) resize algorithm (eg. I use the free image editor, Paint.net). 

So, to do this, you need to make a one-time edit to a file that POV-Ray reads to get the render size options to offer. The file will be located at: C:\Users\[yourusername]\Documents\POV-Ray\v3.7\ini\quickres.ini

Making sure POV-Ray is closed at the time, open that file into a text editor.

If you wanted to render at 1920x1080 as you final resolution, you would want an option to render initially as 3840x2160, which you would add to the end of the file as:
[3840x2160, No AA]

Once you've added this once, save and close the file. Now this size will be available all the time in POV-Ray as a render option - which we'll get to in a minute.

3. Edit your .pov file in POV-Ray - change it to use Radiosity rendering
The default lighting provided in the .pov file from LDView has a standard 3-lights lighting setup, which casts some fairly strong shadows. I prefer to use an alternative lighting option called Radiosity rendering. To change to this I make two simple copy-paste changes at the top of .pov file, which I can do exactly the same on any file I want to render. They are:

Open the .pov file in POV-Ray first. Look at the top of the file, right below the comments, for these two lines:
#version 3.7;

#if (version >= 3.7) global_settings {assumed_gamma 1} #end

Replace them with (don't miss the scroll bar and extra lines here):
#version 3.7;

#include "rad_def.inc"

global_settings {
      max_trace_level 10
      radiosity {
              Rad_Settings(Radiosity_Final, on, off)
      assumed_gamma 1

light_source { // X, Y, Z
      <-1000, -1500, -1000>
      color rgb 0.5
      area_light 200, 200, 10, 10

#declare LDXSkipLight1 = 1;
#declare LDXSkipLight2 = 1;
#declare LDXSkipLight3 = 1;

Then scroll down just a bit to the // Camera settings section, and look for these 5 lines:
#ifndef (LDXFloorR) #declare LDXFloorR = 0.8; #end // Floor Red
#ifndef (LDXFloorG) #declare LDXFloorG = 0.8; #end // Floor Green
#ifndef (LDXFloorB) #declare LDXFloorB = 0.8; #end // Floor Blue
#ifndef (LDXFloorAmb) #declare LDXFloorAmb = 0.4; #end // Floor Ambient
#ifndef (LDXFloorDif) #declare LDXFloorDif = 0.4; #end // Floor Diffuse

Replace with:
#ifndef (LDXFloorR) #declare LDXFloorR = 1; #end // Floor Red
#ifndef (LDXFloorG) #declare LDXFloorG = 1; #end // Floor Green
#ifndef (LDXFloorB) #declare LDXFloorB = 1; #end // Floor Blue
#ifndef (LDXFloorAmb) #declare LDXFloorAmb = 0; #end // Floor Ambient
#ifndef (LDXFloorDif) #declare LDXFloorDif = 0.9; #end // Floor Diffuse

4. Do a test render
The final render can take a while, even on a multi-core i7 cpu, so you want to be sure you're happy. So do a small test render to make sure its looking right.

You do this by, in POV-Ray, in the dropdown list of resolutions in the top left corner choose a small size (eg 800x600) , then press the Run icon across the top toolbar.

5. Do the final render
Once a test render looks good, time to do the final render.

To do this, go back to that dropdown list of resolutions, and look for your large size you added earlier, and choose that. Then press Run again. For a fairly simple model, the render will probably take 15 mins to an hour, depending on your hardware.

6. Resize to your final size
Open your resulting .png file in your image editing program, and resize it down 50% to your final resolution, and save.

So that's my process, I think it produces pretty nice results, with a fairly simple workflow per image. I hope someone finds it helpful. And also would be interested to hear what anyone else is doing with POV-Ray now in 2020.
« Next Oldest | Next Newest »

Messages In This Thread
POV-Ray rendering in 2020 - by Ber - 2020-10-21, 3:07
RE: POV-Ray rendering in 2020 - by Ber - 2020-10-23, 7:27

Forum Jump:

Users browsing this thread: 1 Guest(s)