Subject:
|
Re: Chrome Parts
|
Newsgroups:
|
lugnet.cad
|
Date:
|
Fri, 9 Aug 2002 17:31:27 GMT
|
Viewed:
|
979 times
|
| |
| |
In lugnet.cad, Don Heyse writes:
> In lugnet.cad, Steve Bliss writes:
> > In lugnet.cad, Don Heyse wrote:
> > Gold: http://www.ldraw.org/library/official/images/334/3001.png
> > Silver: http://www.ldraw.org/library/official/images/383/3001.png
> >
> > The gold looks interesting; not exactly "gold plated", but definitely
> > distinctive. But the silver looks remarkably normal. Maybe you
> > implemented shiny-silver as a different color code? Grepping the source
> > code for 334 doesn't turn up anything super-interesting (ie, I missed
> > it).
>
> Well I could work with the colors and specular values a bit.
> I think I used the same colors values as ldview, but picked
> my own specular values based on empirical testing. I think
> I used different specular values for silver, so it may look
> different from that angle. You get a better impression of
> the shininess when you spin the brick, but I guess that's
> not what we're looking for here.
At a guess by looking at the two images, the gold specular is set up to be
shiny for a wider angle, which causes the studs to be shiny in the sample
gold image. You'll note that the rest of the brick isn't really shiny at
all from this viewing/lighting angle. Then again, it just might be an
artifact of the color chosen that makes the eye think that it is a
distinctive material property.
The specular angle is controlled by the specular exponent, which in OpenGL
is accomplished with the GL_SHININESS parameter to glMaterialf. LDView uses
64 for all opaque surfaces and 128 (the max) for all transparent surfaces.
As it turns out, the lower this value is, the wider the specular angle is.
Toying around with it, I discovered that a value of 3 (out of 128) produces
an angle that is wide enough to be visible in LDView on the studs of a brick
in the default viewing angle. (Setting it to 0 causes the exact specular
color you specify to be used from all angles).
The only other specular changes currently in LDView are dropping the
GL_SPECULAR color for black rubber to be dark gray (7.5%), while the
specular color for other opaque colors is medium gray (50%), and transparent
colors is light gray (75%). One thing you should be aware of is that it is
perfectly legitimate to set your specular color to be more than 100%. The
final colors are all clamped to 100% in the frame buffer, but if you use
values greater than 1.0 for your color components, it will actually cause it
to be brighter. Using non-gray specular colors might also produce a more
metallic looking surface (at least for gold), but I'm not sure about this.
> It uses a different opengl extension, but it does work (or at least
> it did work the last time I tried it.) I haven't figured out how
> to do this for the Mac versions yet :(
For Mac off-screen rendering, try sending e-mail to Alex Raftis (who is
working on the Mac OS X port of LDView): alex@REMOVE.raftis.net. I'm pretty
sure he uses off-screen rendering for his printing support. It will be Mac
OS X-specific (probably Cocoa code), so I'm not sure how well it will
integrate to your GLUT usage.
--Travis Cobbs (tcobbs@REMOVE.halibut.com)
|
|
Message has 1 Reply: | | Re: Chrome Parts
|
| (...) You guessed it, or did you sneak a look at the code. ;) (...) That's interesting. I used a value of 15 for for the gold, and 50 for the silver. Apparently 15 produces a wide enough angle for my default view and light positions. I don't like (...) (22 years ago, 9-Aug-02, to lugnet.cad)
|
Message is in Reply To:
| | Re: Chrome Parts
|
| (...) Well I could work with the colors and specular values a bit. I think I used the same colors values as ldview, but picked my own specular values based on empirical testing. I think I used different specular values for silver, so it may look (...) (22 years ago, 9-Aug-02, to lugnet.cad)
|
25 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|