Descriptions and Examples for the POV-Ray Raytracer by Friedrich A. Lohmüller
LEGO in POV-Ray

     Virtual LEGO® Models from CAD Programs in POV-Ray
Rendering of virtual LEGO® models from CAD programs
like LDraw™ and LeoGEO or LEGO Digital Designer® in POV-Ray

Français français
Italiano Italiano
Deutsch Deutsch

Home
- POV-Ray Tutorial
 
LEGO® and POV-Ray
   Content
CAD for LEGO®
  - LEGO Digital Designer®
  - LDraw ™
  - LDraw + LeoCAD
  - LDraw + MLCad

CAD to POV-Ray
  - LeoCAD to POV-Ray
  - Axes + Scales
  ->Adapted Colors
  - LGeo POV-Ray Objects

  - LEGO® Model Sizes + Grid

                                       

Adapting Colors of LGEO POV-Ray Objects

For correct rendering of colors with POV-Ray it's necessary to use a standardized contrast. The correct adjustment of contrast is done by the so called gamma correction.
The way how to do this is different from POV-Ray version 3.6 and the new multicore version 3.7
(currently only as beta version, but most time it works well).

In POV-Ray 3.6 we need to add to the head of our scene files 2 lines:

#version 3.6
global_settings{assumed_gamma 1.0}
In POV-Ray 3.7 we need to add to the head of our scene files only 1 line:
#version 3.7
In POV-Ray 3.6, 3.6.2, 3.7 the line:
#if (version < 3.7) global_settings{ assumed_gamma 1.0 } #end
(No gamma correction in scene file any more in version 3.7, such things are (more consequent now) moved to "POVRAY.INI" file!)

For the virtual LEGO elements for POV-Ray from LGEO the colors are defined in the incude file "LGEO\lg\lg_colors.inc".
Some of these colors seem to be defined without gamma correction. So it's necessary to correct the color values a little bit. Also the standard colors are defined without normals and without reflections and so the bricks look a little bit dull. So we can correct this by creating a new color include file i.e. "lg_color2.inc" and we have to save this in the same directory like the original file. (don't forget to change the name in the include file or scene file of your scene!).


POV-Ray3.6 without gamma correction
and original lg_color.inc
POV-Ray3.6 with gamma correction
and original lg_color.inc
POV-Ray3.6 with gamma/POV-Ray 3.7
and adapted lg_color2.inc

Well, how you want the colors to be that's your freedom - what about a zebra texture or any other crazzy things - NO LIMITS! - but I think the most right version above looks more "realistic" like the classic plastic red of LEGO bricks.
I did not overwork on the hole color set of the LGEO include file. But you can download here a first sample of my corrected color include file lg_color2.inc to see what I have changed there.




Some other examples:
With original LGEO lg_color.inc
With adapted lg_color2.inc
With original LGEO lg_color.inc
With adapted lg_color2.inc

© Friedrich A. Lohmüller, 2009
email email: (legacy email redacted)
www.f-lohmueller.de

 LEGO ® is a trademark of the LEGO Group of companies which does not sponsor, authorize or endorse this site.
LEGO has its own homepage:
www.lego.com, and a page on the Mindstorms system: mindstorms.lego.com