Comments (2)
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)
GLfloat ambient[] = { 0.2f, 0.2f, 0.2f, 1.0f }; //(0.8+0.2)*0.2
GLfloat diffuse[] = { 0.72f, 0.72f, 0.72f, 1.0f }; //0.9*0.8
GL_LIGHT_1 (modelviewport.cc)
GLfloat ambient[] = { 0.2f, 0.12f, 0.12f, 1.0f }; //(0.4+0.2)*0.2
GLfloat diffuse[] = { 0.72f, 0.4f, 0.4f, 1.0f }; //0.5*0.8
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.
from mm3d.
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.
from mm3d.
Related Issues (20)
- 1.3.13 Minor Animation Issue When Starting New Animation HOT 2
- md3filter.cc DBL_MIN should probably be -DBL_MAX HOT 1
- Groupwin (Clean up) doesn't remove materials (as advertised)
- Zero divide is missing from normalize/normalize3 (glmath.h/glmath.cc) functions HOT 2
- edgedivcmd.cc reverses addTriangleToGroup's args HOT 1
- glmath.h operator-= and += don't return & reference
- Model>Edit Model Meta Data... does not save changes HOT 1
- Request to not antialias the Paint Texture image HOT 6
- Opening and Immediately Closing
- knuckleheaded code in bsptree.cc HOT 2
- After creating triangle using "Make face from vertices", allow "Invert normals" to operate on this newly added triangle HOT 2
- Adjustable radius and strength options for attract tools.
- Support spacemice HOT 3
- two years passed without release HOT 3
- Grid snapping? HOT 1
- I want to report one issue and one question HOT 8
- Add Pixelated Texture view HOT 1
- Animation mode won't allow moving verticies on Linux HOT 3
- Export to WRML/WRL (for Kicad models)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mm3d.