• Content Count

  • Joined

  • Last visited

  1. Hi guys, I come back with a new problem... I have a scene with imported mesh, i try to test different kind of light and shading. When i use this function : mesh.convertToFlatShadedMesh();If i move the camera, the mesh disappears partially or completely. Is it a problem related to my model? Thanks for your help, hope you enjoyed the WE !
  2. Hi AlexB, I am very interested by your tutorial ! Thanks for that. Do you have a sample scene you could show using this technique?
  3. I recommend you this one, I have been able to create a "half" shader with it. If you have success to create the cell shading shader i am interested ! I can't make the light appear on a sphere so if you can let me know !!
  4. I understand. So The position could be considered like the start position then the direction is the point which is looked by the le light. By default, the position is 0, 0, 0 ? EDIT : I misunderstood, in the doc it is said that the light comes from the infinite, in the direction define by the vector. but the infinite come from where ?? in a 3D world the infinite can come from anywhere ?
  5. With the new direction it works. But there is a point i'm missing, a direction it's a start and a end so i need X,Y,Z for the start point and X,Y,Z for the end point, obviously this is not the case here can you explain to me what mean exactly new BABYLON.Vector3(0, -2, 20)? You can access my scene here :
  6. I have changed the code like this : /* Build camera */var camera = new BABYLON.FreeCamera("FreeCamera", new BABYLON.Vector3(0, 2, 0), scene);scene.activeCamera = camera;camera.applyGravity = true;camera.checkCollisions = true;camera.speed = 1;camera.attachControl(canvas, false);camera.keysUp.push(90);camera.keysLeft.push(81);camera.keysRight.push(68);camera.keysDown.push(83);/* Build sun light */var LightDirectional = [];LightDirectional[0] = new BABYLON.DirectionalLight("Sun", new BABYLON.Vector3(0, 2, 20), scene, true); LightDirectional[0].diffuse = new BABYLON.Color3(0.80, 0.80, 0.80); LightDirectional[0].specular = new BABYLON.Color3(0, 0, 0); LightDirectional[0].intensity = 5;So my camera is set to : X : 0, Y : 2, Z : 0 I load my tree at : X : 0, Y : 0, Z : 20 My light "look" at X : 0, Y : 2, Z : 20 So, now the tree get light but the ground don't !
  7. I added my scene in the playground, but i don't know where i can load my tree.babylon file to make it useable in the playground.
  8. Thanks Dad72, still the same problem, below is a screenshot....
  9. Ok, so with your help i made some progress. Below is a screenshot of my scene. I used the worldmonger example to create my scene. The black shadow is supposed to be a pine tree but as you can see there is almost no light on it ? i don't understand how lighting works. I have a point light called sun : var sun = new BABYLON.PointLight("Omni", new BABYLON.Vector3(20, 100, 2), scene);The lighting on the ground is ok : var ground = BABYLON.Mesh.CreateGround("ground", 30, 30, 30, scene, sun);ground.material = new BABYLON.StandardMaterial("ground", scene);ground.material.diffuseColor = BABYLON.Color3.FromInts(193, 181, 151);ground.material.specularColor = BABYLON.Color3.Black();ground.receiveShadows = true;ground.checkCollisions = true;But the lighting on the tree doesn't work : BABYLON.SceneLoader.ImportMesh("", "asset/3D/", "tree.babylon", scene, function (newTree) { setup(newTree[0]);}); function setup(mesh) { mesh.position.y = 5; mesh.scaling.x = mesh.scaling.y = mesh.scaling.z = 2; mesh.checkCollisions = true;}I don't understand what i'am doing wrong.
  10. Thats exactly what i wanna do ! Sources are downloadable ? there is some example somewhere?
  11. Ok, i see ... so if i understand well i can't create an external lighting ? Even without shader ?
  12. I understand that shadow map are extremly expensive in ressources but on there is a scene called "The train". How can i reproduce such exterior lighting? it would be perfect for me !
  13. Ok so i found the solution. I used blender to convert my .obj to .babylon, first, i didn't noticed my tree is composed of many mesh, if i merge all the mesh in one it works !
  14. I have tried with the skull model, and ... it works !! I don't understand why my model doesn't work.
  15. Yes Deltakosh, i just did : But i don't know where i can load my 3D model in the playground?