Having a scene.fog is nice but requires a fog = false to materials that you do not want to affect. It would be nice if a fog object could be instead be applied directly to a material. Allowing you to have multiple fog instance in scenery as well.
Here and example case (where only one mesh (the sand floor) gets to receive the scene.fog and all other materials needs to have fog = false set, while a sandMaterial.fog = new THREE.Fog() would be nicer.
http://closier.nl/webgl/espadrilles/
What if it was in the object instead?
So then the material could be material.fog = THREE.SceneFog, material.fog = THREE.ObjectFog or material.fog = THREE.NoFog.
It would be a bit confusing but consistent at least:
scene.fog = new THREE.Fog( 0xff0000 );
object1.fog = null; // default
object1.material.fog = THREE.SceneFog; // default
object2.fog = new THREE.Fog( 0x0000ff );
object2.material.fog = THREE.ObjectFog;
object3.fog = null;
object3.material.fog = THREE.NoFog;
You mean THREE.SceneFog applies to all scenery material, unless THREE.NoFog is defined (similar as current implementation) and if a material has a THREE.ObjectFog it affects only this material? Sounds good to me.
Yes. If object.material.fog is THREE.ObjectFog then the renderer will try to use object.fog.
Sorry to resurrect and old issue, but has there been any experimentation with this? I would also find it useful to assign different fog colors or densities to different objects.
Most helpful comment
Sorry to resurrect and old issue, but has there been any experimentation with this? I would also find it useful to assign different fog colors or densities to different objects.