To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 9437
9436  |  9438
Subject: 
[LSC] Colour Definition meta-statement
Newsgroups: 
lugnet.cad.dev
Date: 
Wed, 21 Jan 2004 05:28:08 GMT
Viewed: 
1751 times
  
Here's the initial write up for a color definition meta-statement, to be used in
ldconfig.ldr and in any model file.  The LSC has a couple of outstanding issues
with this spec, let's discuss those in follow-up messages.

Please respond with any comments, suggestions, complaints, questions, etc.

Steve

LDraw.org Colour Definition meta-statement
------------------------------------------

This meta-statement will specify the properties of a single LDraw colour code.
This statement may appear at any time in an LDR file, but will probably be most
useful in the file header.

Scope.  A color definition will affect colors from the point it first appears,
continuing through the end of the file.  Commands preceding a colour definition
will not be affected by the definition.  Color definitions will expire at the
end of the file in which they appear, effectively going out of scope.  Color
definitions will be passed to subfiles.

The configuration file, ldconfig.ldr, is not affected by the scoping rules, in
the sense that the definitions in ldconfig.ldr remain in effect after the
renderer is finished processing ldconfig.ldr.

Syntax.  The entire statement must appear on one line.  It's broken into two
lines in this definition for clarity.
   0 !COLOUR name CODE x VALUE v EDGE e [ALPHA a] [DITHER d]
             [LUMINANCE l] [CHROME | METALLIC | RUBBER | MATERIAL <params>]

Tags.  CODE, VALUE, EDGE, ALPHA, DITHER, LUMINANCE, CHROME, METALLIC, RUBBER and
MATERIAL are keyword tags.  Some tags are followed by a single parameter value.
Tags are case-insensitive.

Numeric parameters may be specified in decimal or hexidecimal.
Hexidecimal values must be prefixed with #.
Byte values are integers in the range 0-255.
Identifiers are alphanumeric strings, case-insensitive.

Definitions of parameters.
   name - A short name for the color.  Name may be any identifier.  This item is
provided mainly for human recognition.  Name is a required element.

   CODE x - The LDraw color code.  For LDraw compatibility, x is an integer
0-511.  If strict LDraw compatibility is not required, x is any identifier
recognized by a rendering program as a color code.  Code is a required element.

   VALUE v - The color value.  v is a 24-bit RGB value.  VALUE is a required
element.

   EDGE e - The contrasting edge color.  e may be either a color code or an RGB
value.  EDGE is a required element.

   ALPHA a - The alpha channel (transparency) value.  a is a byte value, where 0
is totally colorless and #FF is completely opaque.  LDraw programs that use
dither-transparency recognize values 1-127 as transparent, and 128-255 as
opaque. A 0 value is totally colorless (useful for temporarily hiding sections
of models).  ALPHA is an optional element.

   DITHER d - Specifies the color should be dithered, and provides the second
color value.  d may be either a color code or an RGB value.  DITHER is optional.

   LUMINANCE l - Brightness for colors that glow.  l is a byte value.  Luminance
is not used by LDraw renderers, but may be used for translation to other
rendering systems.  LUMINANCE is optional.

   Only one of CHROME, METALLIC, RUBBER, and MATERIAL may be specified for a
single color.  They all specify the finish/texture to be applied to an object
being rendered. Other finish-tags may be defined over time.

   CHROME - A flag indicating that surfaces should have a mirror-like finish.
Not currently used by LDraw-compatible programs, but may be implemented in the
future.  CHROME is optional, and may not appear with METALLIC, RUBBER or
MATERIAL.

   METALLIC - A flag indicating that surfaces should have a finish like Lego's
'metallic' colors.  These colors are commonly called 'pearlescent' by fans.  Not
currently implemented in LDraw-compatible programs.  METALLIC is optional, and
may not appear with the CHROME, RUBBER or MATERIAL.

   RUBBER - A flag indicating that surfaces should have a finish like rubber
(typically rubber tubing or rubber tyres).  RUBBER is optional, and may not
appear with CHROME, METALLIC or MATERIAL.

   MATERIAL [name <params> ...] - Some other surface finish requiring
customized parameter(s).  Name is an identifier.  MATERIAL is not used for
official LDraw.org color definitions, it has been made available for use by
programs.  MATERIAL is optional, and may not appear with CHROME, RUBBER or
METALLIC.  MATERIAL should be the last tag on the !COLOUR statement.



Message has 5 Replies:
  Re: [LSC] Colour Definition meta-statement
 
I'll bite. (Note that none of my comments are meant as criticism.) In lugnet.cad.dev, Steve Bliss wrote: <SNIP> (...) I personally think the # for hex numbers is a mildly bad idea. The currently accepted way to specify hexidecimal values is to (...) (20 years ago, 21-Jan-04, to lugnet.cad.dev)
  Re: [LSC] Colour Definition meta-statement
 
(...) I prefer the currently used 0x prefix, but I guess if you picked # to match other file formats in use by ldraw users then I can live with it. I forget, does POV or HTML use # for the hex prefix? (...) No spaces in the name? Alpha-numeric only? (...) (20 years ago, 22-Jan-04, to lugnet.cad.dev)
  Re: [LSC] Colour Definition meta-statement
 
(...) When I first read, this, it seemed reasonable, but probably difficult to implement in a renderer. The more I think about it, though, the more I think the difficulty outweighs the niceness. Specifically, I think it would be a royal pain to (...) (20 years ago, 28-Jan-04, to lugnet.cad.dev)
  Re: [LSC] Colour Definition meta-statement
 
I have these comments: 1) Why not use COLOURDEF in stead of introducing the'!' ? 2) CHROME | METALLIC | RUBBER seem to me like materials. Are they just shortcuts for convenience? 3) It should be possible to specify RGB color in decimal. Either r,g,b (...) (20 years ago, 29-Jan-04, to lugnet.cad.dev)
  Developers! What softwares? ([LSC] Colour Def...)
 
(...) Why not just RGB instead of the not too intuitive VALUE? (I mean, it colud be any parameter value) Developers, what softwares will be updated to support this? L3P? ML-Cad? L3Lab? LDView? ...? /Tore (20 years ago, 6-Feb-04, to lugnet.cad.dev)

28 Messages in This Thread:











Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR