I am currently utilizing Three.js, specifically version 71. My workflow involves creating models in Blender, exporting them as JSON files, and then using THREE.JSONLoader to incorporate these models into my scene as shown below:
this.jsonLoader.load(pathToModelFile, function(geometry, materials) {
//...
});
When loading the models, I have noticed that the materials list only contains THREE.MeshPhongMaterial at index 0. It appears that this material type necessitates a light source (e.g., THREE.SpotLight) in the scene for the model to be visible. Without a light source, the model appears black.
My goal is to load models without the requirement of a light source. To achieve this, I have the following questions, any of which, if answered, would solve my issue:
- Is there a specific flag or property in THREE.MeshPhongMaterial that can be adjusted to display the model without a light source?
- If the first option is not feasible, is there a way to utilize THREE.JSONLoader to apply a different material type that does not rely on a light source, such as THREE.MeshBasicMaterial?
- Is there a method to export models from Blender with the necessary settings already configured (if possible)?
It seems I am encountering a similar difficulty to what was mentioned in the following link, where the question was left unanswered: Switch lighting of THREE.MeshPhongMaterial on / off dynamically