eljuko

Members
  • Content count

    39
  • Joined

  • Last visited

About eljuko

  • Rank
    Advanced Member

Profile Information

  • Gender
    Male
  • Location
    Finland

Recent Profile Visitors

471 profile views
  1. Shadows in never ending world

    Ok, so i think i found the solution from light.shadowFrustumSize = X and moving the light with camera. All this time i was trying to find the solution from shadowGenerator and forgot to experiment with the light itself :')
  2. Hey all, Sorry to bother you with yet another shadow related question, but i'v ran into trouble. I'm doing some tests with dynamic world creation and shadows. So i'm using directional light to cast shadows, but for every mesh i import the shadows get more and more "crispy". This is fine as long as i keep light.autoUpdateExtends as false.., BUT i ran into another issue; the "shadow projection" from the light is very slim and parallel with light angle, i simply don't know how to enlarge the shadow projection so it would fit with camera view. Any ideas? - eljuko EDIT: added image. As u can see, the shadows from the rocks doesn't fit in the projection.
  3. Hey, sorry for a bit late reply. The "world" or should i say game board / area is rather small and almost fully dynamic depending on some random factors. User can almost see the whole game area in first view. Nosey, perhaps but i don't mind. You actually put me think once again and i sure can clamp environmental meshes with subjects like desert, city, jungle and the list goes on. Originally i was planning to import each individual tree and rock for example which is a bit pointless. But there are the random and userselect factor that kinda demand either that every single mesh will be loaded in 1 import or import as needed = multiple imports which may raise to rather large numbers, but i think it will pay off; maybe not in the beginning but later on.
  4. Thanks again for mindblowing set. I'll definitely look into that source once i have the time for it. Maybe after this project. About hundreds of scenes from blender: my plan was to create something from multiple exports on the fly. And when i speak about a scene from blender it basically means 1-5 rather lowpoly meshes, but not sure if i should dump every single mesh in one scene though. Can't tell if i can take over the world with javascript but if i'm ever gonna do it; i'm going to do it with JS :] Anyhow, finally got the time to start working on my game which has been in my head for really long now. I'm super excited about this project and hopefully will make announcement here a bit later this year. Till i feel dumb again!
  5. Nice demo, you definitely made something i couldn't With http://www.babylonjs-playground.com/#1CMD3G#23 that setup it actually starts to look pretty good! What if i had like hundreds of imported scenes from blender, do i have to make different shadowGen and light for each of them? I'm still breaking everything in my project but at least your demos gave me hope. I'v been working on this projects backend now, and to be honest i'v been trying avoid this 3d part for far too long So pardon me if i present stupid questions.
  6. Hey Wingnut! Nice to see you again too! Will test it tomorrow, i'll let you know how it turns out. Cheers!
  7. Hello! How receive shadow actually works? i'v been trying to get it work on imported meshes without success. the weird part is that it works on plain plane just well :S I'v been trying something like this for hours and just can't get it work. EDIT: the plan was to get the mesh to receive shadows from itself. var light = new BABYLON.DirectionalLight("dir01", new BABYLON.Vector3(-1, -2, -1), scene); light.position = new BABYLON.Vector3(20, 40, 20); light.intensity = 1; var shadowGenerator = new BABYLON.ShadowGenerator(2048, light); shadowGenerator.useVarianceShadowMap = true; shadowGenerator.usePoissonSampling = true; shadowGenerator.bias = 0.01; BABYLON.SceneLoader.ImportMesh("", "assets/models/sample/", "house1.babylon", scene, function (newMesh){ newMesh[0].material.specularPower = 0; newMesh[0].material.specularColor = new BABYLON.Color3(0, 0, 0); newMesh[0].material.diffuseColor = new BABYLON.Color3(1, 1, 1); newMesh[0].material.emissiveColor = new BABYLON.Color3(1, 1, 1); newMesh[0].position.x = -4; newMesh[0].position.z = 6; newMesh[0].position.y = -0.05; newMesh[0].rotation.y = Math.random()*(2*Math.PI); shadowGenerator.getShadowMap().renderList.push(newMesh[0]); newMesh[0].receiveShadows = true; }); var material1 = new BABYLON.StandardMaterial("texture1", scene); material1.emissiveColor = new BABYLON.Color3(0,0,0) material1.diffuseTexture = new BABYLON.Texture("assets/models/sample/sand.png", scene); material1.diffuseTexture.uScale = 500.0; material1.diffuseTexture.vScale = 500.0; var plane = BABYLON.Mesh.CreatePlane("plane", 1000.0, scene); plane.rotation.x += Math.PI / 2; plane.material = material1; plane.receiveShadows = true; Anyone knows what i'm doing wrong? - regards, eljuko
  8. Hard time with attachToBone

    Thanks Dad, definetly going forward now. executeWhenReady did the trick and the awkward part was that i never ran across with it earlier u learn something new everyday!
  9. Hard time with attachToBone

    No one? Ok, lets put it this way, is there something wrong in the workflow or in import snippet? now i get error that HEAD is undefined :E Please note this is really simplified. Maybe i'm missing something important. var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); var createScene = function () { var scene = new BABYLON.Scene(engine); scene.clearColor = new BABYLON.Color3( 23 / 255, 20 / 255, 14/255); scene.fogMode = BABYLON.Scene.FOGMODE_LINEAR;; scene.fogColor = new BABYLON.Color3( 23 / 255, 20 / 255, 14/255); scene.fogDensity = 1; scene.fogStart = 5.0; scene.fogEnd = 30.0; var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(2, 3, -9), scene); camera.setTarget(new BABYLON.Vector3(0,3,0)); var light = new BABYLON.DirectionalLight("dir1", new BABYLON.Vector3(-1, -2, -1), scene); light.position = new BABYLON.Vector3(20, 40, 20); light.intensity = 1; var light2 = new BABYLON.SpotLight("spot1", new BABYLON.Vector3(30, 40, 20), new BABYLON.Vector3(-1, -2, -1), 1.1, 16, scene); light2.intensity = 0.5; var shadowGenerator = new BABYLON.ShadowGenerator(2048, light); var TORSO; var HEAD; var SKELETOR; BABYLON.SceneLoader.ImportMesh("", "assets/models/sample/", "TORSO_INDUSTRIAL.babylon", scene, function (newMeshes, particleSystems, skeletons){ TORSO = newMeshes; SKELETOR = skeletons[0]; for(i = 0; i < TORSO.length; i++){ TORSO[i].material.specularPower = 0; TORSO[i].material.specularColor = new BABYLON.Color3(0, 0, 0); TORSO[i].material.diffuseColor = new BABYLON.Color3(1, 1, 1); TORSO[i].material.emissiveColor = new BABYLON.Color3(1, 1, 1); shadowGenerator.getShadowMap().renderList.push(TORSO[i]); TORSO[i].material.wireframe = true; } }); BABYLON.SceneLoader.ImportMesh("", "assets/models/sample/", "HEAD_INDUSTRIAL.babylon", scene, function (newMesh){ HEAD = newMesh[0]; HEAD.material.specularPower = 0; HEAD.material.specularColor = new BABYLON.Color3(0, 0, 0); HEAD.material.diffuseColor = new BABYLON.Color3(1, 1, 1); HEAD.material.emissiveColor = new BABYLON.Color3(1, 1, 1); shadowGenerator.getShadowMap().renderList.push(HEAD); }); HEAD.attachToBone(SKELETOR.bones[2]); shadowGenerator.useVarianceShadowMap = true; var material1 = new BABYLON.StandardMaterial("texture1", scene); material1.diffuseTexture = new BABYLON.Texture("assets/models/sample/sand.png", scene); material1.diffuseTexture.uScale = 500.0; material1.diffuseTexture.vScale = 500.0; var plane = BABYLON.Mesh.CreatePlane("plane", 1000.0, scene); plane.rotation.x += Math.PI / 2; plane.material = material1; plane.receiveShadows = true; return scene; }; var scene = createScene(); engine.runRenderLoop(function(){ //Do stuff scene.render(); }); window.addEventListener("resize", function () { engine.resize(); });
  10. Hard time with attachToBone

    Thanks for the answer, i doubt that's the issue quite yet. I'm currently at the state where i'v just imported the models and i just want to know how to attach the meshes to bones in right locations without errors optimization will become handy a bit later, and this is much more clear to me thanks to you
  11. Hello everyone, long time no see! So i'v ran to an issue where i'm trying to attach meshes to bones from another import. I'v this torso which is built from 2 meshes and this torso assembly holds the skeleton. Then i'v another model and when i'm trying to place the import directly to head bone for example the model flips around Z axis and goes somewhere it doesn't really belong. I'v attached an image which hopefully explains more than my english does What i'm doing wrong? any ideas? - best regards, eljuko
  12. Problem with opacityTexture

    Thank you both for wasting ur time trying to resolve my issues
  13. Problem with opacityTexture

    Added img. Atm this is the way to go i think. Just need to do some work with the image now [badHairDay2.png]
  14. Problem with opacityTexture

    Thanks for the examples! Looks like the example2 has the same issue than mine does. Is it a bug or? Anyhow, gonna pass the lame gradient transparency and make the front part of the hair from strips somewhat like u or just material.diffuseTexture.hasAlpha = true. Thank u! [badHairDay.png]
  15. Problem with opacityTexture

    Hey gryff! 1. nope, there is no overlapping strips. 2. well it should atleast (attached image from blender) edit: 3. removed the line and transparent areas from image turn black. also the gradient transparency is gone.