Sign in to follow this  
chorlton

ldCad->ldView->povray - Colour mismatch

Recommended Posts

Hi, I'm having a problem where "special" colours used in ldCad are not displaying correctly in ldView and povray. As it's going wrong in ldView, I suspect something wrong with my LGEO setup in ldView but can't quite follow how the mapping is all set up. Perhaps someone here (Philo?) can help.

I'm using ldCad 1.1b, ldView 4.1 and povray 3.7 running on Linux Mint 13.

I'm using the wheels (part 32077) from set 8428 which peeron describes as "Metallic Silver" and so have selected this in ldCad. This is described as (80,M) in the ldCad colour selection. My MPD file contains the following lines for the part in the model.

0 FILE wheel-and-tyre.ldr
0 NAME wheel-and-tyre
0 AUTHOR chorlton
1 80 0 0 0 1 0 0 0 1 0 0 0 1 32077.dat

I open my MPD file in ldView and Export to povray. The resulting povray file contains

#declare LDX_wheel_dash_and_dash_tyre_dot_ldr = union {
// NAME wheel-and-tyre
// AUTHOR chorlton
object {
LDX_32077_dot_dat
LDXSeamMatrix(149.999939, 149.999969, 71.093002, 0, 0.000015, 0.046499)
matrix <1,0,0,0,1,0,0,0,1,0,0,0>
#if (version >= 3.1) material #else texture #end { LDXColor80 }
}

and

#ifndef (LDXColor80) // Black
#declare LDXColor80 = LDXOpaqueColor(0.2,0.2,0.2)
#end

So, it appears that ldCad thinks colour 80 is metallic silver, but ldView thinks it is black, or at least very dark grey. When I set things up, the instructions for ldView and the LGEO part library spoke about colours but I think I've followed all the steps correctly.

Does anyone with experience know where I might have gone wrong? I didn't want to include all my config so please ask for anything relevant.

Thanks

chorlton

edit: There are other colour mismatches, for example the smoked glass of the PF receiver, but the silver wheels give a good example. Hopefully one setup fix will correct everything.

Edited by chorlton

Share this post


Link to post
Share on other sites

Maybe you can try to use C3POwen's customized LGEO files? It includes new parts, but also a new color file which may solve your problems (I don't know exactly what he has done with the color file).

Good pointers thanks. C3POwen's new LGEO.xml file does indeed include a colour entry for "80" and maps it to lg_metallic_silver. There's an entry for this colour in my lg/lg_color.inc file in my LGEO directory.

Unfortunately, I've copied this to /usr/local/share/ldview which is the ldview config directory for Linux and it's made no difference. :hmpf_bad:

My ldraw and lgeo installations were all downloaded and unpacked manually - there's no all-in-one installer for linux - I suspect that LDView might not be finding the LGEO directory at all as it is in a custom location.

Where would I configure where ldview finds the LGEO installation?

Share this post


Link to post
Share on other sites

Quick update - I think my LGEO install was in the wrong location as I had it installed in parallel with my ldraw directory, not inside it. I've now moved LGEO inside the ldraw directory.

This wheel still looked black in LDView but after some faffing about and finally testing in povray, I have this

8428mod.png

It's obviously shinier than pure black but it's still very dark.

Does anyone know if ldraw metallic silver is the correct colour to use for wheel part 32077 from set 8428?

If it is, are there any tips for brightening this up to make it more obviously lighter than the tyre?

Edited by chorlton

Share this post


Link to post
Share on other sites

Firstly, I'm not an expert (or even a novice!) on Linux, and I've always used Windows. However, I'll help if I can...

I ran a quick render of the part/colour you're trying to use, using the wheel and its matching tyre, and got the below. I've also attached the relevant LDraw file and the POV-Ray file generated from LDView, and it might be worth trying to render the POV-Ray file to see what happens.

32077.png

LDR file | POV file

The only things I can imagine that might be causing issues would be the LGEO.xml mapping file path not being specified in LDView (File > Export > Options > Native POV Geometry). Mine is set to "C:\Program Files (x86)\LDraw\LDView\LGEO.xml" on Windows, and that's for a default installation on 64-bit Windows.

A native LGEO version of 32 Trans Black IR has also never been specified, so that might also be causing you a problem.

Regarding the Silver Metallic colouring in my LGEO update, I'll be the first to admit that the finish requires a bit of work to get it behaving like the real thing (reflection quality, etc.).

Does anyone know if ldraw metallic silver is the correct colour to use for wheel part 32077 from set 8428?

It is indeed. Generally, LDraw colours can be checked against the set's part inventory on BrickLink, although it's not 100% accurate.

Share this post


Link to post
Share on other sites

That's amazing! Thanks for the effort C3POwen!

POVRay can't find the LGEO inc files

File '32077.pov' line 146: Possible Parse Error: Cannot find file 'lg_defs.inc',
even after trying to append file type extension.
File '32077.pov' line 146: Parse Error: Cannot open include file lg_defs.inc.

and a quick compare of yours and my pov files shows that mine has no "lg_" declares in it at all. This suggests that both

  • ldView isn't using LGEO because there's no lg_ declares in my pov file
  • povray isn't aware of LGEO because it can't find the .inc files

LGEO.xml is in what I think is the default ldView location for linux (/usr/local/share/ldview) but I'll specify it explicitly, and I have added my ldraw directory to povray.ini and the lgeo files are under there but it's certainly something to trace down.

Thanks for the help, very valuable.

Share this post


Link to post
Share on other sites

@chorlton: metallic colors are tricky to render since they reflect the surrounding environment. Simple difference in background color used by your and C3POwen's might be the reason why your is dark (if you have black as bg color) and C3POwen's is brighter (when bg color is white). Default bg color differs between POV-Ray 3.6 and 3.7 and depend on scene version mark.

Share this post


Link to post
Share on other sites

Thank you all. Tracked down the problems to a couple of issues:

  • The linux port of LDView has a bug (possibly Qt library related?) where the xml path field only allows the selection of a directory path, not a full filename. I was able to work around this by editing the LDView.conf file directly to add the LGEO.xml filename.
  • My povray.ini file was missing the LGEO paths under Library_path settings. This was partly due to me having multiple povray.ini files from multiple installs, and partly thinking that paths were search recursively so I only had to define a parent directory. Added ldraw/lgeo, ldraw/lgeo/ar and ldraw/lgeo/lg to fix.

Result:

8428mod.fix.fr.al.png

Still a few niggles but I'm happy.

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.