mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
99.32k stars 35.12k forks source link

why such difference between Lambert and Basic Material? #1158

Closed namiwang closed 12 years ago

namiwang commented 12 years ago

Hi there, I've create a simple scene, camera and renderer(I tried both canvas and webgl one), no light. I've got a png image of a cloud, or say, part of is white and is transparent. I create a mesh by:

cloud=new materialClass( { map: THREE.ImageUtils.loadTexture( "img/cloud.png" ),opacity:0.3+Math.random()*0.5,transparent: true, overdraw:true } )

and when materialClass is MeshLambert one, the object looks mostly black, but when materialClass is Basic one, the object looks mostly white, I'm wondering why...is this just the normal appearance? well...I'm still learning about what is a Lambert Material,sorry for my ignorant. thanks a lot.

victusfate commented 12 years ago

Not sure how MeshLambert's are designed in three.js, but I'm familiar with lambertian reflectors (http://en.wikipedia.org/wiki/Lambertian_reflectance). You might want to start reading there namiheike

chandlerprall commented 12 years ago

Lambert is much better for using in a lighted scene. It also has an ambient property which defaults to 0x050505 (pretty dark). You can change it with material.ambient.setHex(0xFFFFFF)

namiwang commented 12 years ago

thanks everybody, I'm learning these basic concept and knowledge,

btw, there're still no way to avoid the diagonal line using canvasRenderer and opacity, right?

mrdoob commented 12 years ago

Apart from material.overdraw = true there isn't much we can do about it until the W3C allows disabling antialias on 2D contexts...