-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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 ambient color #6501
Comments
We now assume the material reflects ambient light the same way it reflects direct light, and that is specified by |
I have set in 3dsmax ambient for my models everywhere... If I change it to diffuse it will appear in js object? And have I to set diffuse color in 3dsmax to black now in order to see models how they will look in browser? |
No need to do that. object.material.emissive = new THREE.Color( 0.2, 0.2, 0.2 ); cheers |
It seems to me a strange assumption that ambient == diffuse for two reasons :
For exampe : if you were looking Inside a building with spots light Inside it from the exterior, it may be necessary to tune ambient material color for interior and exterior. Edit : also some materials may have a different color when lightened with diffuse vs ambient lighting |
In 3DS Max always set diffuse to (255,255,255) for all the materials. Now for all those who don't understand the "ambient" value in 3DS Max. The ambient color map is not visible in viewports or renderings unless the level of ambient light is greater than default value of black. I hope it's cristal clear now. |
Seems I have understood about 3DS Max. I have to set one value for all "ambient" colors in Max and not to change it for any model. :) And in THREE to find according value for global AmbientLight. |
To understand better the "ambient" value in THREE: http://necromanthus.com/Test/html5/girl_JS.html http://necromanthus.com/Test/html5/girl_JS_emissive.html Clear enough isn't it? |
Yes inded, which is totally logical but you dont always want ambient light to be black, usually it will often be greater than 0 I only wanted to point out that : IMHO, a material named "phong" without ambient sounds really strange for me. Also emissive and ambient color are not really related, emissive is more used to display modelised light (light emitter object), ambient to simulate special material that react differently on direct and indirect lighting Below a simple sample showing how using differents ambient and diffuse color may help to produce specials effects/material : |
You don't need "ambient" for a "Phong" material. cheers |
pretty women :) (as a side note the background is blinking in IE11)
Sorry, but I can't see the point, (indeed normal and specular are requiered too as for gouraud shading, only difference is perpixel normals or not). But finally does this mean you agree ? Or did you think ambient is useless in phong material ? NB.: I am really sorry to disturb, but as I use ThreeJS more and more (and I like it), it make me a little worry, because as far I can remember (3D studios or 3D engines Ambient have always been availables in materials) ( This is part of the phong lighting model : http://en.wikipedia.org/wiki/Phong_reflection_model ) |
That ambient is the effect of |
For now "ambient" and "diffuse" is the same thing in THREE. |
It doesn't in Chrome, Firefox and Opera. |
Sorry, but as I use ThreeJS I just want to help using my experience, and this requiere I give my opinion good or not, but yes It may not be the right thread ... :/, I subscribed just few days ago to GitHuB... at some time we are all newbies ... (For the blinking it is related to render clear color I think, I got this problem, cant remember exacly but setting 0 to alpha clearcolor may help) |
You should contact the Microsoft IE dev team to report the issue. |
trolling start 10 years ago IE was 95% of users... at this time they was the rules.... in the 2000s it was even possible to embed directX (3D) in web browser(IE) ... so who have not follow the "global rules", this is a too loooong question that have been debated too much, but if someone sell 10 cars a year, do they are legitimate to explain to a company that sell 1000000 cars how they should do ? /trolling end |
At this moment IE11 represents 1-2% of the market ... |
Depends on your market, IE11 on desktop its 25% (http://www.netmarketshare.com/) [58% for IE generally] |
Ben, It has nothing to do with MY market. Less than 8% for ALL the Internet Explorer versions. cheers |
But to be back to the topic there is no confusion for me between ambient, diffuse, specular and emissive color, they have different usage in 3D. If you only want to display a simple model this may work fine, you can by some workaround get fair results by tuning emissive, lights or whatever but, IMO in lot of cases the lack of ambient color and or level will limit the possibilities of the 3d engine.. Something with en emissive color should always be visible even with no light on (ambient + spot + etc... == 0) If you have a scene when you can turn off the light every object with emissive color will stay visible wich is wrong if they are not light source. |
We chose to simplify the API, and hardwire I understand you may want to implement special effects. Your work-around is to create a Extending materials in this way is a bit tedious, but you can find examples on stackoverflow. |
@WestLangley |
Let me just conclude with the following and I will leave you quiet (for some time) :) sorry IMHO : Some real world materials may react differently when lightened with a direct or indirect light (ambient), but the main probleme I can see in this simplification is that people will have to take care or tune their materials outside of their 3d editor |
If you are doing texturing however you probably want the colors of the texture * ambient light to be returned rather than a flat color? Also if you just want a flat color use |
At this moment you need to edit every JS, DAE or OBJ file if you want the best results. cheers p.s. |
Yes that's what I do for now, manualy modifying the material, but it is possible to get the same render than you get in 3d studio (I managed to get exact same render result in 3DzzD than the 3DS scene model I exported from 3D Max nb.: only using blin material not special one), removing ambient component will just make it harder to do this in the futur |
One good example could be skin : That may be the same for many translucent objects like banknotes. |
I think you have moved out of scope of the |
Hehe this a modification I needed and I've done too ^^ by adding "map_bump" pattern but using it as a normal map (not a bump), but OBJ lack a lot of things (and obj exporter are rarely complet), 3DS handle a lot of more things and exporters work pretty well. NB.: note that it would be possible to make it automatic by detecting normal map (most blue) VS bump (grayscale) |
I'm aware of those special effects you can achieve (I used to use 3DSMAX in the past). But that's not how materials behave in the real world, so we opted for simplifying the API so people have less things to "learn" and, at the same time, there are less things for us to maintain or worry about. |
I understand the desire to make the API as simple as possible (I really had the same goal in the past), but this may cause unwanted sides effects that will requiere more works for ThreeJS users, like need to rework materials after export from a 3D modeler, Maybe a middle solution is possible as keeping ambient but using diffuse if it is not defined.? |
I must say I also find this to be a very weird decision to remove ambient coefficients seeing they are part of many illuminations models. Especially since it was implemented previously? And I understand what you mean with how materials behave in the real world, but isn't that part of the beauty of computer graphics? It doesn't have to be real life! 😄 |
As @WestLangley said they tied
Or would that not have the same optimizing effect? I get two values from my original model information: A
Similar solution for my specular color... I would really like to be able to set ambient again in my materials so I can set the materials exactly as defined in my model. |
In openGL materials also have different ambient, diffuse, and specular colors (link). As I understood from others also 3DMax allows different ambient and diffuse colors. And like I said also my model definition holds different ambient and diffuse color definitions. It seems sad that something which was implemented for a long time (at least since r25) and which was working well for lots of people is removed from the library because of the sake of simplifying the API. Can the API not be simplified without losing the possibility to set ambient for those who use it? I also like @tistatos his view: but isn't that part of the beauty of computer graphics :) |
We tried. It confused people more people than actual people used it. Doesn't follow the real physical world. Ultimately people want to have realistic renders. Eventually, I think I understand it's sad that things get removed. A way to make sure things don't get removed is by helping with user support. If I see there is something problematic that new users are struggling for and no one helping them then I have two options, put the library development on hold so I can help these users, or remove what they're struggling with. Putting the library on hold is dangerous (I could get burned out), so I give priority to not doing that. |
Maybe you can just build the |
@mrdoob I will look into that... But is doing Hope you won't remove |
In the future they most likely be moved to the |
@mrdoob I try where I can to help with user support. But to be honest I am no expert either and I actually have no clue how to fix my broken |
I use AssimpJSONLoader and can't find model's ambient color of materials in r71. Everything looks dark. In r68 it was ok.
Sorry 4 my English.
The text was updated successfully, but these errors were encountered: