Jump to content


[Guide] Rendering LDraw models using POV-Ray

LDraw POV-Ray Rendering render

  • Please log in to reply
430 replies to this topic

#51 TK-949

TK-949

    Posts: 19
    Joined: 28-February 12
    Member: 26994

Posted 28 February 2012 - 04:56 PM

Since I'm new to all this rendering stuff, I have a problem with an error message in POV-Ray. I was trying to render my 7190 Millennium Falcon Model but the Part 4150ps4 seems to be not liked by POV-Ray. The Line: LDX_1_dash_16ri19_dot_dat_in_part causes the Error: Expected 'object', undeclared identifier 'LDX_1_dash_16ri19_dot_dat_in_part'. I don't have any clue what that means.

#52 C3POwen

C3POwen

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

Posted 28 February 2012 - 09:49 PM

View PostTK-949, on 28 February 2012 - 04:56 PM, said:

Since I'm new to all this rendering stuff, I have a problem with an error message in POV-Ray. I was trying to render my 7190 Millennium Falcon Model but the Part 4150ps4 seems to be not liked by POV-Ray. The Line: LDX_1_dash_16ri19_dot_dat_in_part causes the Error: Expected 'object', undeclared identifier 'LDX_1_dash_16ri19_dot_dat_in_part'. I don't have any clue what that means.
I've come across this, and there seems to be a problem with the POV-Ray file that LDView creates, but I've not worked out how to stop it automatically happening each time.

The easiest way to manually fix this is to go to Search > Replace and then paste LDX_1_dash_16rin19_dot_dat_in_part into "Find" and LDX_1_dash_16ri19_dot_dat_in_part into "Replace with" and then click Replace All. When you try to run the render, it should now work without issue.

The actual LDraw file that POV-Ray is trying to recreate is called "1-16ri19.dat", and LDView seems to add an "n" to a couple of instances of this within the POV-Ray file.

#53 TK-949

TK-949

    Posts: 19
    Joined: 28-February 12
    Member: 26994

Posted 29 February 2012 - 12:48 AM

View PostC3POwen, on 28 February 2012 - 09:49 PM, said:

I've come across this, and there seems to be a problem with the POV-Ray file that LDView creates, but I've not worked out how to stop it automatically happening each time.

The easiest way to manually fix this is to go to Search > Replace and then paste LDX_1_dash_16rin19_dot_dat_in_part into "Find" and LDX_1_dash_16ri19_dot_dat_in_part into "Replace with" and then click Replace All. When you try to run the render, it should now work without issue.

The actual LDraw file that POV-Ray is trying to recreate is called "1-16ri19.dat", and LDView seems to add an "n" to a couple of instances of this within the POV-Ray file.

But there is no "n" in the line in question...

#54 C3POwen

C3POwen

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

Posted 29 February 2012 - 10:05 AM

View PostTK-949, on 29 February 2012 - 12:48 AM, said:

But there is no "n" in the line in question...
No, not in the line it marks as being in error, but it is there elsewhere in the file, and this is what causes the problem.

Did you try the fix that I suggested?

#55 TK-949

TK-949

    Posts: 19
    Joined: 28-February 12
    Member: 26994

Posted 29 February 2012 - 12:58 PM

View PostC3POwen, on 29 February 2012 - 10:05 AM, said:

No, not in the line it marks as being in error, but it is there elsewhere in the file, and this is what causes the problem.

Did you try the fix that I suggested?

Yes, and it worked. Thank you.
Another thing. Transparent-Black looks almost opaque (although very "glossy") in my renders. Any suggestion how to fix this? I've placed Han and Chewie in the cockpit, but all you see is black :sad:

Edited by TK-949, 29 February 2012 - 12:59 PM.


#56 whitew0lf

whitew0lf

    Posts: 21
    Joined: 17-January 12
    Member: 24397

Posted 29 February 2012 - 01:25 PM

Hello again!

I hava a problem, maybe someone here can help me.
When I insert a TECHNIC flex system hose into my model (from part file or with LSynth) both ends disappear when I render it. In LDView, and in MLCad it looks complete and good, but in SR3D and when rendering the hose both ends disappear.

Like here at the drain pipe:
Posted Image

#57 C3POwen

C3POwen

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

Posted 29 February 2012 - 06:53 PM

View PostTK-949, on 29 February 2012 - 12:58 PM, said:

Transparent-Black looks almost opaque (although very "glossy") in my renders. Any suggestion how to fix this? I've placed Han and Chewie in the cockpit, but all you see is black :sad:
Are you using MLCad or SR 3D Builder for your models? If you're using MLCad, are you sure that the colour you're selecting is "40 Trans_Black" and not "32 Trans_Black_IR_Lens"? The latter will produce something that looks opaque, and not transparent.

View Postwhitew0lf, on 29 February 2012 - 01:25 PM, said:

When I insert a TECHNIC flex system hose into my model (from part file or with LSynth) both ends disappear when I render it. In LDView, and in MLCad it looks complete and good, but in SR3D and when rendering the hose both ends disappear.
I don't believe SR 3D Builder supports anything generated using LSynth, but if you export the model from LDView to POV-Ray, then it should work.

Are the hose ends set to be hidden within MLCad? Do you have an example LDR file I could look at?

#58 whitew0lf

whitew0lf

    Posts: 21
    Joined: 17-January 12
    Member: 24397

Posted 01 March 2012 - 09:17 AM

View PostC3POwen, on 29 February 2012 - 06:53 PM, said:


I don't believe SR 3D Builder supports anything generated using LSynth, but if you export the model from LDView to POV-Ray, then it should work.

Are the hose ends set to be hidden within MLCad? Do you have an example LDR file I could look at?

Actually SR3D shows some part of the hose (nearly the same as in the render).
Here is the LSynth version of the building floor:
LDR
If you change it to the official "Technic Flex-system hose 9L 76324.dat" it is the same. I looked into the model file but only the Lsynth waypoints are hidden.

#59 Palathadric

Palathadric

  • Makes other members' internet speeds seem ridiculously fast


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

Posted 01 March 2012 - 01:50 PM

View Postpalathadric, on 27 February 2012 - 08:30 AM, said:

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.
And here they are:
Posted Image  Posted Image

Posted Image  Posted Image

Posted Image

I used, quite obviously. Different lightings for the different renderings, but which one would you say looks the best? The colours are not right, and I suppose once you have them it will be then I will still have to work on the lighting to make sure it looks right with the particular colour.
The first one is a render with a transparent background, supposedly, but it doesn't really seem transparent and Photoshop did not recognize it as being transparent, either. :sceptic: Am I missing something here?
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

#60 legolijntje

legolijntje

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

Posted 01 March 2012 - 05:08 PM

Does PovRay saves the image as an png? If not, it can create a transparant background, but it will be white in the actual image, because e.g. jpg don't support transparant. So, you'll need a png to get working transparant backgrounds.

#61 C3POwen

C3POwen

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

Posted 01 March 2012 - 08:22 PM

View Postwhitew0lf, on 01 March 2012 - 09:17 AM, said:

Here is the LSynth version of the building floor:
If you change it to the official "Technic Flex-system hose 9L 76324.dat" it is the same. I looked into the model file but only the Lsynth waypoints are hidden.
I ran a (very quick) render from the LDR file you supplied and got the following:

Posted Image

I didn't modify the file that LDView created in any way, nor the LDR file before exporting it, and it seemed to work without issue. As the POV-Ray file is based on what LDView shows, I'm not quite sure what to suggest. Has everything been installed in the way shown at the beginning of the guide? Is LSynth installed in a different location?

View Postpalathadric, on 01 March 2012 - 01:50 PM, said:

The colours are not right, and I suppose once you have them it will be then I will still have to work on the lighting to make sure it looks right with the particular colour.
If it helps, I'll post a preliminary version of the file here.

It needs to be placed into the "lg" folder within the LGEO directory, for example: "C:\Program Files\LDRAW\LGEO\lg"

View Postpalathadric, on 01 March 2012 - 01:50 PM, said:

The first one is a render with a transparent background, supposedly, but it doesn't really seem transparent and Photoshop did not recognize it as being transparent, either. :sceptic: Am I missing something here?

View Postlegolijntje, on 01 March 2012 - 05:08 PM, said:

Does PovRay saves the image as an png? If not, it can create a transparant background, but it will be white in the actual image, because e.g. jpg don't support transparant. So, you'll need a png to get working transparant backgrounds.
To force PNG output, you need to add +FN to the text box in POV-Ray next to the image resolution dropdown box. To force transparency, use +FN +UA. It is something I put into the guide, and can be currently found under "7.6 Transparency".

Edited by C3POwen, 01 March 2012 - 10:27 PM.


#62 Palathadric

Palathadric

  • Makes other members' internet speeds seem ridiculously fast


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

Posted 01 March 2012 - 11:44 PM

View PostC3POwen, on 01 March 2012 - 08:22 PM, said:

I didn't modify the file that LDView created in any way, nor the LDR file before exporting it, and it seemed to work without issue. As the POV-Ray file is based on what LDView shows, I'm not quite sure what to suggest. Has everything been installed in the way shown at the beginning of the guide? Is LSynth installed in a different location?
I often had problems with this. LDView seems to not always recognize parts from the LSynth library for some reason. I think it also depends on the installation folder, for some reason.

View PostC3POwen, on 01 March 2012 - 08:22 PM, said:

If it helps, I'll post a preliminary version of the file here.

It needs to be placed into the "lg" folder within the LGEO directory, for example: "C:\Program Files\LDRAW\LGEO\lg"
Thanks, C3POwen!

View PostC3POwen, on 01 March 2012 - 08:22 PM, said:

To force PNG output, you need to add +FN to the text box in POV-Ray next to the image resolution dropdown box. To force transparency, use +FN +UA. It is something I put into the guide, and can be currently found under "7.6 Transparency".
Yeah, I tried it the first time, but I accidently changed, in the "floor" menu. the 1-yes to 0-yes. So I had both 0-yes and 0-no and then the floor was on 1, so I guess that's why it did what it did. :blush:
Once again, thanks a lot C3POwen!
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

#63 whitew0lf

whitew0lf

    Posts: 21
    Joined: 17-January 12
    Member: 24397

Posted 02 March 2012 - 12:24 PM

View PostC3POwen, on 01 March 2012 - 08:22 PM, said:

I ran a (very quick) render from the LDR file you supplied and got the following:

I didn't modify the file that LDView created in any way, nor the LDR file before exporting it, and it seemed to work without issue. As the POV-Ray file is based on what LDView shows, I'm not quite sure what to suggest. Has everything been installed in the way shown at the beginning of the guide? Is LSynth installed in a different location?



Okay I looked through the whole POV-Ray file, but did not find anything. So I uninstalled and re-installed LDView, and now it is okay.
Thanks for the help!

Edited by Calabar, 02 March 2012 - 12:32 PM.
Quoted image removed


#64 Palathadric

Palathadric

  • Makes other members' internet speeds seem ridiculously fast


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

Posted 02 March 2012 - 04:22 PM

View Postwhitew0lf, on 02 March 2012 - 12:24 PM, said:

Okay I looked through the whole POV-Ray file, but did not find anything. So I uninstalled and re-installed LDView, and now it is okay.
Thanks for the help!
I don't know why it does this. Had a similar problem with MLCad a while back and another time with the LDraw library in general, but I finally got them working again. When I installed SR 3D Builder, there was a couple conflicts with the previously installed LDraw library, but I just left it as I don't use MLCad much anymore anyway.
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

#65 TK-949

TK-949

    Posts: 19
    Joined: 28-February 12
    Member: 26994

Posted 02 March 2012 - 05:34 PM

View PostC3POwen, on 29 February 2012 - 06:53 PM, said:

Are you using MLCad or SR 3D Builder for your models? If you're using MLCad, are you sure that the colour you're selecting is "40 Trans_Black" and not "32 Trans_Black_IR_Lens"? The latter will produce something that looks opaque, and not transparent.

I'm using MLCad and always take 40 for Trans Black. After I replaced the lg_colors.inc with your file it worked. Now you can actually see, what happens in the cockpit.

#66 TK-949

TK-949

    Posts: 19
    Joined: 28-February 12
    Member: 26994

Posted 03 March 2012 - 02:22 AM

*oh2* Ahhhhhh, computer crashed. After 24 hrs of rendering! Any chance to rescue the image through the pov-state file? *huh*

(2 minutes later):

Oh, found it. It's still there! PHEW!

[Edit]:

Done!

Posted Image

It looks alright, although I think the blue bricks don't have the right color. And can someone tell me, which light I have to move/turn (and how) so that the reflection is not directly on the cockpit?

Edited by TK-949, 03 March 2012 - 09:54 AM.


#67 TK-949

TK-949

    Posts: 19
    Joined: 28-February 12
    Member: 26994

Posted 03 March 2012 - 10:46 PM

Does the lg_colors.inc mess with the LDConfig.ldr? Because, since I installed your file the colors in MLCad are confused, have other numbers and Reddish Brown is missing... *huh*

#68 C3POwen

C3POwen

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

Posted 04 March 2012 - 12:14 AM

View PostTK-949, on 03 March 2012 - 02:22 AM, said:

It looks alright, although I think the blue bricks don't have the right color. And can someone tell me, which light I have to move/turn (and how) so that the reflection is not directly on the cockpit?
The blue in the lg_color.inc is based on the official blue values from Peeron, but if you wish to enter your own RGB value for the colour you can do so by opening the file with a text editor and running a search for "lg_blue" and changing the RGB values.

Telling you which light you would need to move would not be possible without actually looking at the the .pov file you have and running test renders, as you may not have your model set at the same rotation as someone else's. Experimentation would be the best thing to try, and there are plenty of POV-Ray guides out there that go into detail, some of which I list in the "More information" section.

View PostTK-949, on 03 March 2012 - 10:46 PM, said:

Does the lg_colors.inc mess with the LDConfig.ldr? Because, since I installed your file the colors in MLCad are confused, have other numbers and Reddish Brown is missing... *huh*
No, it has no effect on it whatsoever, as it is a file that is purely referenced by POV-Ray, and not MLCad or any other LDraw-based software (such as LDView or LeoCAD).

#69 TK-949

TK-949

    Posts: 19
    Joined: 28-February 12
    Member: 26994

Posted 05 March 2012 - 01:46 PM

View PostC3POwen, on 04 March 2012 - 12:14 AM, said:

The blue in the lg_color.inc is based on the official blue values from Peeron, but if you wish to enter your own RGB value for the colour you can do so by opening the file with a text editor and running a search for "lg_blue" and changing the RGB values.

Maybe it's just the lighting.

View PostC3POwen, on 04 March 2012 - 12:14 AM, said:

Telling you which light you would need to move would not be possible without actually looking at the the .pov file you have and running test renders, as you may not have your model set at the same rotation as someone else's. Experimentation would be the best thing to try, and there are plenty of POV-Ray guides out there that go into detail, some of which I list in the "More information" section.

Yeah, that was a dumb question anyway.

View PostC3POwen, on 04 March 2012 - 12:14 AM, said:

No, it has no effect on it whatsoever, as it is a file that is purely referenced by POV-Ray, and not MLCad or any other LDraw-based software (such as LDView or LeoCAD).

That's odd, I don't know where this confused palette came from.

#70 Palathadric

Palathadric

  • Makes other members' internet speeds seem ridiculously fast


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

Posted 14 March 2012 - 08:28 AM

Just a question: is there any benefits/disadvantages of working on a 64-bit computer as opposed to a 32-bit one? Are any programs needed incompatable with 64-bit or produce better or worse results?

Any updates soon to be added to the guide?
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

#71 whitew0lf

whitew0lf

    Posts: 21
    Joined: 17-January 12
    Member: 24397

Posted 23 March 2012 - 02:20 PM

Here is a good guide how to use radiosity:
How to use radiosity
or
if you don't want to get too deep into technical things you can try
Fast rad

#72 Palathadric

Palathadric

  • Makes other members' internet speeds seem ridiculously fast


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

Posted 24 March 2012 - 12:13 AM

Nice tutorials WhiteWolf.
I wonder when C3POwen will get around to updating this tutorial. He hasn't been around in over a week. :cry_sad:

Does the lg_colour.inc downloadable file here contain the correct colours for all the original brick colours?

Edited by palathadric, 24 March 2012 - 12:15 AM.

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

#73 whitew0lf

whitew0lf

    Posts: 21
    Joined: 17-January 12
    Member: 24397

Posted 24 March 2012 - 08:26 AM

I think there are several different lg_color.inc files, because of using different POV-Ray settings renders different colours.
Here is what I've done:
There is a site with offcial LEGO colours LUGNET color reference(unfortunatelly right now the server is down)and it has some .inc files. The problem is that these colors are the old ones (i.e. no light-bluish grey color) so I used the offical colours for the old ones and tried to figure out the new colours.
Here is the result:
lg_colors.inc
Again, it is not 100% the official colors, but close to them.

#74 TK-949

TK-949

    Posts: 19
    Joined: 28-February 12
    Member: 26994

Posted 01 April 2012 - 11:56 AM

Can someone send me a link to the lg_color.inc C-3POwen posted a while ago? I accidentally deleted mine.

#75 Palathadric

Palathadric

  • Makes other members' internet speeds seem ridiculously fast


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

Posted 01 April 2012 - 11:09 PM

View PostTK-949, on 01 April 2012 - 11:56 AM, said:

Can someone send me a link to the lg_color.inc C-3POwen posted a while ago? I accidentally deleted mine.
First post on this page, mate.
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

2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users