• Content count

  • Joined

  • Last visited

  1. Sometimes camera captures a cross-shaped(or other shapes like circle) glare at the point where the light's intensity is big. The reason seems to be light diffraction. Like the attached images shows. What kind of technicals do I need to implement this effect ? Is there any demos of babylon.js ? I guess I may need post-precessing, right? Thanks.
  2. Thanks, the snippet just solved my problem. You're great help, thanks.
  3. So the only way is exporting the model again in modeling applications, there's no solution inside babylon itself, is it right?
  4. Here it is:
  5. Yes, I apply `DirectionalLight` and use `PBRMetallicRoughnessMaterial`. Actually my code is like: var scene = new BABYLON.Scene(engine); var camera = new BABYLON.ArcRotateCamera("Camera", Math.PI / 2, Math.PI / 2, 2, BABYLON.Vector3.Zero(), scene); camera.attachControl(canvas, true); camera.radius = 80; var light = new BABYLON.DirectionalLight("light", new BABYLON.Vector3(0, 0, -20), scene); var pbr = new BABYLON.PBRMetallicRoughnessMaterial("pbr", scene); pbr.baseColor = new BABYLON.Color3(1.000, 0.766, 0.336); pbr.metallic = 1.0; pbr.roughness = 0.2; pbr.environmentTexture = BABYLON.CubeTexture.CreateFromPrefilteredData("/assets/textures/", scene); var pbr2 = new BABYLON.PBRMetallicRoughnessMaterial("pbr2", scene); pbr2.baseColor = new BABYLON.Color3(1.000, 1.000, 1.000); pbr2.metallic = 1.0; pbr2.roughness = 0.2; pbr2.environmentTexture = BABYLON.CubeTexture.CreateFromPrefilteredData("/assets/textures/", scene); const importMesh = function (name, callback) { BABYLON.SceneLoader.ImportMesh( name, '/assets/stl/', name + '.stl', scene, function (meshes) { const m = meshes[0]; m.position.y = 20; m.rotation.y = Math.PI; m.rotation.x = -Math.PI/2; callback(m); } ); } importMesh('something', function (m) { m.material = pbr; }); Thanks
  6. So I loaded a STL model using STLFileLoader in to scene. The model seems flat-shaded, and I want it to be smooth-shaded. I know I can call `Mesh#convertToFlatShadedMesh()` to convert a mesh from smooth-shaded to flat-shaded, but what I want is the opposite method. Is there any solutions? Thanks for helping ...
  7. I'm reading the source code, and I'm a bit confused about the difference between mesh and submesh. So when I call `Mesh.createGround` I created a Mesh(with transform matrix, geometry and material), right? But what is submesh for? Is that when I set the parent mesh (`groundMesh.parent = sphereMesh`, eg), the groundMesh became a submesh? I'm not sure.