Subject:
|
Re: Why LDraw.org doesn't use ldconfig.ldr ???
|
Newsgroups:
|
lugnet.cad
|
Date:
|
Thu, 4 Oct 2007 20:37:13 GMT
|
Viewed:
|
8206 times
|
| |
| |
In lugnet.cad, Travis Cobbs wrote:
|
In lugnet.cad, Don Heyse wrote:
|
In lugnet.cad, Travis Cobbs wrote:
|
light. For example, here is an image from the part tracker:
Here is the same part rendered in LDView (with ldconfig.ldr turned on, and
an attempt on my part to approximate the light angle used in ldglite):
Here it is from LDView with no lighting:
|
Now I dont remember exactly how the official ldconfig.ldr colors were
arrived at, but they *are* significantly different from the ldglite colors.
Perhaps theyre intended for a dimmer lighting model. Whatever, they
certainly look a bit washed out and dull in ldglite. I suppose I
should compare my lighting model code to yours to quantify the difference.
Meanwhile, perhaps the official ldliterc.dat file should be modified to
use the original ldlite colors where they already exist? (Edge colors
could still be set to black to make the majority happy)
|
Im pretty sure the ldconfig.ldr colors are designed to match the brick
colors when no lighting is used (as in the second LDView picture above. If
the ambient and diffuse terms add up to more than 1.0, the original colors
end up getting washed out. Im guessing that ldglites ambient and diffuse
terms add up to quite a bit more than 1.0.
When I did the subdued lighting in LDView, I set it up so that the ambient
and diffuse terms add up to 1.0. (It uses 0.5 for the intensity of both the
ambient and the diffuse, actually.) Relatively recently I noticed that my
regular lighting has a diffuse intensity of 1.0 and an ambient intensity of
0.2. Im hesitant to change it now, though, since its been that way for so
long. Ill probably see what 0.8 diffuse looks like and change it if it
seems OK.
|
Id leave your setup alone since it seems to work well with the
current color list. Youre right about ldglite. I didnt like dark
shadows, or maybe I run my monitor too dark to avoid migraines, but
the lighting settings do add up to more than 1.0. To get something I
liked with my equipment, I cranked the ambient up to 0.75 and set the
diffuse light at 0.5. Does the distance to the diffuse light have
any effect? Mine is pretty far back behind the camera.
The ldglite ambient and diffuse lights could be set to your regular
settings with following command line settings:
-lc-1000,1000,1000,1,1,1 -lC0.2,0.2,0.2
Maybe using a different location than (-1000,1000,1000)?
Anyhow, heres my lighting and materials setup for shaded rendering.
What else are we doing differently, besides one/two sided lighting?
Don
// Set the light way up and behind us. Will this make it too dim?
// NOTE: The LDRAW polys are not CCW compliant so the normals are random
// LdLite uses 2 opposing lights to avoid the problem with normals?
// I attempted this below but it does not seem to work for OpenGL.
// Hmmm, perhaps LdLite just took the fabs() of normals instead.
// If I calculate normals then I could do that too.
// x, y, z, dist divisor. (divisor = 0 for light at infinite distance)
GLfloat lightposition0[] = { -1000.0, 1000.0, 1000.0, 0.0 };
GLfloat lightcolor0[] = { 0.5, 0.5, 0.5, 1.0 }; // Half light
GLfloat lightcolor1[] = { 0.75, 0.75, 0.75, 1.0 }; // bright light
glEnable(GL_LIGHTING);
// Medium diffuse light for some minor shadow effects
glEnable(GL_LIGHT0);
glLightfv(GL_LIGHT0, GL_POSITION, lightposition0);
glLightfv(GL_LIGHT0, GL_DIFFUSE, lightcolor0);
// Bright ambient light for the whole scene.
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lightcolor1);
// 2 sided lighting because I'm too lazy to use BFC.
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
// OpenGL's color material feature provides a less expensive way to change
// material parameters. With color material enabled, material colors track
// the current color. This means that instead of using the relatively
// expensive glMaterialfv routine, you can use the glColor3f routine.
//
// Ambient and diffusion properties for front and back faces.
// Full ambient and diffusion for R, G, B, alpha ???
GLfloat full_mat[] = { 1.0, 1.0, 1.0, 1.0 };
GLfloat half_mat[] = { 0.5, 0.5, 0.5, 1.0 };
GLfloat no_mat[] = { 0.0, 0.0, 0.0, 1.0 };
GLfloat no_shininess[] = { 1.0 };
GLfloat lo_shininess[] = { 5.0 };
GLfloat mid_shininess[] = { 15.0 }; // Seems nice for plastic chrome and gold.
GLfloat hi_shininess[] = { 50.0 }; // { 100.0 };
glEnable(GL_COLOR_MATERIAL);
glColorMaterial(GL_FRONT_AND_BACK, GL_SPECULAR);
glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE, full_mat);
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, no_mat);
glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, no_shininess);
glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, no_mat);
|
|
|
|
Message has 1 Reply: | | Re: Why LDraw.org doesn't use ldconfig.ldr ???
|
| (...) The distance would matter, except that you're using a directional light. Since the w component of your light position is 0.0, it's a directional light. As such, -1,1,1 is the same as the -1000,1000,1000 that you have. (How's that for (...) (17 years ago, 4-Oct-07, to lugnet.cad, FTX)
|
Message is in Reply To:
| | Re: Why LDraw.org doesn't use ldconfig.ldr ???
|
| (...) I'm pretty sure the ldconfig.ldr colors are designed to match the brick colors when no lighting is used (as in the second LDView picture above. If the ambient and diffuse terms add up to more than 1.0, the original colors end up getting washed (...) (17 years ago, 4-Oct-07, to lugnet.cad, FTX)
|
43 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
|
|
|
|