-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Material/light parameters are backward, should be swapped #173
Comments
Here's the numbers with 100/100 default material. I recommend disabling GL_LIGHT_MODEL_AMBIENT to make things simpler, even though it might cause things to appear black in debugging. I had to use glLightModelfv with a pointer to zero it. GL_LIGHT_0 (modelviewport.cc)
GL_LIGHT_1 (modelviewport.cc)
The added 0.2 term is GL_LIGHT_MODEL_AMBIENT. Edited: Note it's important the lights don't sum to 100% so wire frames remain visible over polygons. |
BTW this does look much better in texture mode, and the red face selection is visible (as long as the texture isn't red) for a change. I have to get used to seeing models darker with lighting, but it looks correct. EDITED: In texwidget.cc the material preview uses 0.8 for ambient because it's compensating for GL_LIGHT_MODEL_AMBIENT which defaults to 0.2. I also felt that texture mode was a bit too dark because of the need for the solid mode to not overpower the wireframes (which is still a problem in texture mode for untextured materials, or very bright textures) so I had the modelviewport.cc code to add 0.1 ambient to GL_LIGHT_MODEL_AMBIENT. Not sure if that's best since it still leaves diffuse down around 90% but it looks alright for materials with high to 100% ambient. I'm thinking about adding a something to control the lights and background color. The bright background is too strong working with additive blending modes. |
MM3D has a lighting set up that makes no sense, it's especially bad in the texture view where lighting pretty much washes out completely so it's as if there's none.
I noticed that when a new material is made it has 20% ambient and 80% diffuse, which is not how materials work. It should be 100% on both, and the lighting should be 20/80.
I'm going to try to reverse this relationship and see if it still looks the same or not. I'm making this issue to have a URL to cite.
The text was updated successfully, but these errors were encountered: