DiV

Members
  • Content Count

    8
  • Joined

  • Last visited

About DiV

  • Rank
    Newbie

Recent Profile Visitors

320 profile views
  1. I see. Then I'll stick to embedded SFX, thank you!
  2. I think I can, but I need it to work locally, and if I use the absolute URL sound will only play on my computer, right? Would it be safe to load the sound from base64 string? My sound effect is really short, so the code wouldn't be too long.
  3. What should work fine with "../" doesn't work in my case. If I put my .ogg sound effect in a folder of higher level I can't load it anymore. Trying different sound formats and styles of the relative URL didn't help. How do I solve this? I don't wanna copy the same file into every scene folder directly D:
  4. I didn't know about "_refRexture" parameter, thank you! Works perfectly and with engine.getRenderHeight()/2 set as texture resolution I think I can finally stop worrying about the screen sizes.
  5. I partially solved this problem by using base64-encoded fractal noise from the SVG file, it's the same dataURI now, but I don't need it exactly procedural, I just want some moving ripples, so I'll either stick to updating the depth with Math.sin(looks like the character is breathing) or try to somehow shuffle the part of the string that won't cause major glitches. Here's the new version: https://www.babylonjs-playground.com/#FBW4N#2
  6. I'm using a compressed PNG for refraction postprocess, but it's just black and white noise, so I'd like to generate the texture instead. Is it possible though? I tried procedural textures from the library, but it only resulted in default checkerboard texture appearing. What am I doing wrong? And if procedural textures can't be used this way can I use my texture as a tile, so it wouldn't stretch across the screen changing the scale of the noise? var roadmaterialpt = new BABYLON.RoadProceduralTexture("customtext", 512, scene); var postProcess2 = new BABYLON.RefractionPostProcess("Refraction", roadmaterialpt, new BABYLON.Color3(1.0, 1.0, 1.0), 0.3, 2.0, 1.0, camera);
  7. DiV

    intersectsMesh not working?

    I think I found the solution. It attaches a box to my camera. May not be the best way to code it but it works, which is enough for me. Thank you! var portal = BABYLON.Mesh.CreatePlane("portal", 20, scene); portal.position = new BABYLON.Vector3(0, -5, -30); portal.rotation = new BABYLON.Vector3(0, 3.14, 0); let collider = BABYLON.MeshBuilder.CreateBox("collider", {size: 3}, scene); collider.parent = camera; collider.actionManager = new BABYLON.ActionManager(scene); let action = new BABYLON.ExecuteCodeAction( { trigger: BABYLON.ActionManager.OnIntersectionEnterTrigger, parameter: { mesh: portal } }, (evt) => { window.open("https://vk.com","_self"); } ); collider.actionManager.registerAction(action);
  8. Hello, I'm sorry for the stupid question, but how do I detect an intersection? I followed the playground example, but it doesn't work for me. Here is the code: var portal = BABYLON.Mesh.CreateBox("portal", 20, scene); portal.position = new BABYLON.Vector3(0, -5, -30); portal.rotation = new BABYLON.Vector3(0, 3.14, 0); portal.showBoundingBox = true if (ellipsoid.intersectsMesh(portal, false)) { //ellipsoid attached to the camera alert("!!!"); //Message never appears }