Search the Community
Showing results for tags 'groundmaterial'.
-
Hello guys ! i was working with groundmaterial several weeks already , but i recently noticed that "DirectionalLight" is not a good friend of "WORLDMONGER.GroundMaterial" i hope i am wrong , but i was experimenting with endless landscapes and i noticed that when i go far from the point 0 , 0 , 0 of my scene the diarectionallight doesn't iluminate with the same intensity when i go far away from point 0 , 0, 0 when i use the GroundMaterial i set the directional light this way : var light = new BABYLON.DirectionalLight("dir01", new BABYLON.Vector3(0, -1, 0), scene); light.intensity = 1.0; and i am using the groundmaterial as : var groundMaterial = new WORLDMONGER.GroundMaterial("groundMaterials", scene, scene.getLightByName("dir01"); ----------------------------------------------------------------------------------------------------------------- Now when i use a the StandardMaterial : var groundMaterial = new BABYLON.StandardMaterial("ground0", scene); groundMaterial.diffuseTexture = new BABYLON.Texture("shaders/Ground/grass.png", scene); and i move far from the point 0, 0, 0 it works perfect and iluminates with the same intensity for example if i were some kilometers far away from the point 0,0 as it would be on the point 0,0 is this really something related to groundmaterial? , or i should use some trick to have kilometers of my scene with the same intensity in light using directionallight and groundmaterial? i have already tried using the scene.registerBeforeRender(function() to have the directionallight follow the camera but i don't think it is a good solution , i guess the DirectionalLight should iluminate the same ortogonal way even if i am far away from the initial location point of the directionallight.