Search the Community

Showing results for tags 'solved'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 376 results

  1. Mobile canvas resolution

    Hi everyone, I'm currently makind VR apps with BabylonJS, and try to solve the issue of the canvas resolution. I've already found some discussions about this topic, oddly none seems to concern the same issue as I do (it's not about anti-aliasing, as far as I understand, it's more about hardware pixel and css pixel) If I open this playground in my phone : (not VR, the question is the same for mobile VR and mobile non-VR applications) The pixels are too large. When watching the phone through Google Cardboard it's even worse. This playground is much better, with hardwareScaling set to 0.25 It's fairly logical, because my phone has 4 hardware pixels per "layout pixel". 1) I'm using a ZTE Axon 7 phone, with 2500*1080 screen. A full screen canvas has width = 900px, height=450px in my browser. Do you encounter the same issues with your phone ? 2) Is there already an automatic built-in way to set the canvas resolution ? Like with the <meta> or something ? (ie : without adding resizing code in the app) 3) If no, should not we add some code to recognize the screen dpi an set the hardwareScaling accordingly ? So it work "out of the box" on mobile. Or is it to CPU-intensive to enforce x16 resolution ? Thanks a lot for you inputs ! Have a nice week-end PS : I've also tried the scenes from @davrous -interesting- article here : , I'm 90% sure I have the same issues with the examples like Sponza scene, also the fact there are some textures ad lightning make it less obvious.
  2. Hello, I cannot figure out how the get an updated Bounding Box after the rotation, position or scaling of a mesh. Here the playground: Thanks in advance for the help
  3. Hi, This is probably a misunderstanding on my part, but how can I get the light to shine on either of the objects in the PG? Meshes work just like I thought, I can display either of them by changing the bitmask.
  4. Lighting and OBJ

    Sorry to revisit this topic again so soon, but I really wanted to clarify some things. While perhaps the basic texture lightness is again, a possible issue, further testing has made me think that my files are not to blame here. Or at least, I'm turning to the forum to ask if that is indeed the case. Below is a comparison of Blender's viewport (left) and Babylon sandbox (right) of the same model/texture. The blender version has a default hemi-light for better viewing purposes. We can ignore the specular highlight for now; I assume it's not part of the problem. As is shown above, Babylon's lighting (I'm assuming what would be considered a normal intensity light) doesn't illuminate the object as well as blender. Compared to the default Babylon sphere, it's definitely at least the same shade whereas it should be pretty white, assuming the default Babylon sphere is grey. This results in a disparity between my expected Blender render and what happens in Babylon. Rather than brightening my lights accordingly (and rendering any Babylon generated objects into a white blob) I want to understand where the problem lies. This is just an example file; other models are showing the same result (even .babylon files). Here are the model files: 4.obj 4.mtl
  5. Hi there, I have some questions about this function: _mustRebind( ... ), (which was executed inside the 'bindForSubMesh(...)' for both StandardMaterial and PBRMaterial, and was defined in the 'PushMaterial' class ) 1. I don't understand the purpose of using this function because it always returns true. Please prove me if I'm wrong: it finally execute a comparison like: 'scene._cachedVisibility !== mesh.visibility' , which is always true, because the scene._cachedVisibility has never been used and would always be null... right? is this a mistake? 2. The '_mustRebind' directly returns the 'scene.isCachedMaterialValid', look into the latter function, I guess it actually did a kind of 'Invalid' check, isn't it ? If so, is it better naming it as "isCachedMaterialInvalid"? Thank you!
  6. Create Box in Function

    Hello! I am trying to create a multiplayer node game and I need to create a box in a function. How can I do this? Thanks!
  7. #renderCanvas { width: 100%; height: 100%; position: absolute; } #overlayUI { width: 100%; height: 100%; z-index:2; position: absolute; } <div id = "overlayUI"></div> <canvas id = "renderCanvas"></canvas> Using this The UI is blocking input on Canvas! How to use the UI without blocking events!
  8. I am building an application that has a lot of requirement of the user to understand the world coordinate system, so I want to add in the bottom left corner of the screen a widget that shows the world axes and their rotations. I've succeeded in attaching the axes lines to the camera however as expected the parenting caused the axes' rotation to be bound to the camera's local rotation, not the world coordinate system. So my question is how to I attach the axes to the camera, BUT make sure their rotation is locked to the world coordinate system? Demo here:
  9. camera.detachControl

    Hello, When the mouse is released following the event "pointerup", the camera is attached to the pointer of mouse. Seems to be related to changes added by Camera.ForceAttachControlToAlwaysPreventDefault() (I suppose). The camera.detachControl() is not working as expected now. Thanks
  10. I am beating my head into the wall trying to get a white container block next to the text in this example... Maybe I'm just doing it wrong... Never mind... It was because I did not have a defined width on the first element... sorry for the wasted thread... Guess it pays to actually read the documentation and not skim through >_<
  11. draw "on top"

    Hi, I need to make a custom transform gizmo. Building the gizmo itself is pretty simple, but is there a way to make it draw on top of everything else in the scene? For example, if I have a sphere and turn on the transform gizmo, the gizmo itself is obscured by the sphere. I need the gizmo to be attached to the object (move with it in 3d space) but be visible no matter what geometry is around it.
  12. After experimenting with u/v scales and offsets (I want to use planes for sprites in my project), I notices that you cannot use any alpha on your emissive textures, the background will be black: Quick Demo, swap the emissiveTexture to diffuse Texture and the Alpha works: According to the documentation this should work however ?
  13. [SOLVED] Forward Vector

    Why is the forward Vector Depending on Z position of Box in the example below? Change box.position.z to 10 & then -10 The forward Vectors are different! Forward Vector Shouldn't depend on Position. It only depends on orientation!
  14. RTSP stream

    Hi Is it possible to make videoTexture with rtsp stream on it or shader that can show rtsp stream?
  15. Hello. I apologies for multiple threads around the same issue, but I honestly feel very frustrated. I am waiting for the NPM package of Babylon and Babylon.gui to be refactored to support moduler importing. Until then does anyone have a working example showing how to correctly reference Babylon and Babylon.GUI in a TypeScript project so it compiles and references correctly in the front end? I don't mind if it using CDN/Local Files/NPM anything, I will just adjust my code to match. I have been stalled for around 3 weeks on this issue, and mostly am frustrated at myself for not having the technical skills to assist. TypeScript and Babylon are an excellent combination, however this technical area is still a 'black art' to me. Any push in the right direction is very welcome.
  16. Spector PBR Demo is broken

    Hi, just wanted to share that demo on spector.js homepage is broken PBR Demo spector.bundle.js:1 TypeError: BABYLON.CubeTexture.CreateFromPrefilteredData is not a function at CreatePBRTestScene (pbr.js:11) at loaderCustoms.js:41 at spector.bundle.js:1 Array(0) t.error @ spector.bundle.js:1 spector.bundle.js:1 Uncaught TypeError: BABYLON.CubeTexture.CreateFromPrefilteredData is not a function at CreatePBRTestScene (pbr.js:11) at loaderCustoms.js:41 at spector.bundle.js:1
  17. Hi everybody: I need to know about what is the preferred approach to handle the mouse/touch events (for example onclick): (1) via the canvas by means of myCanvas.addEventListener("pointerdown", function (evt) { ... var pickInfo=myScene.pick(myScene.pointerX,myScene.pointerY,function(mesh){ return (mesh===myMesh); }); if(pickInfo.hit){ alert("Mesh picked"); } }); (2) via the mesh using the powerful ActionManager functionality myMesh.actionManager.registerAction(new BABYLON.ExecuteCodeAction(BABYLON.ActionManager.OnPickDownTrigger,function(evt){ alert("Mesh picked"); })); Thank you for your time.
  18. How to create Empty Mesh/Node for Parenting? The Empty Node must have Position, & other Transform data!
  19. Sprite Manager

    Hello! I am looking at around 40 sprites which are actually being replaced with HD Images, I was wandering if there are ways to animate or any alternative solution as i'm struggling to find a solution to the lag and drop in frames currently which makes it look bad, I will insert a playground here with my current working version, but the main issue being the playground doesn't lag as it won't be loading my images and the size and scale of my images is far higher than the can't load texture issue. Secondarily, if anyone could tell me how to add a small amount of movement to look up and down but I want to prevent the camera looking more than 10/20 degrees above or below the mid point to keep it focused. The example mouse movement camera rotation and general project i'm using as inspiration can be found here:
  20. PBR Alpha Map

    Does the PBR material have an Alpha Map Texture?
  21. I just want to know how to set it so my camera rotation wont look all the way up and down id like it to look about 10% above and below where my content is, there is a link to the playground at the end. I have tried setting beta/radius/alpha limits, I have tried inertia, I have tried the height map stuff, I have tried everything I can think of or find in the documents.
  22. RayCasting

    My project is ocean based. I want to measure the water depth as a vessel travels the water surface. The seabed is undulating, so I would expect the point at which the ray intersects the 'seabed' mesh to change as the vessel moves through the water. I understand the ray interacts with the bounding box of the mesh it is intersecting. My problem appears to be that the bounding box of the seabed is effectively a rectangle and currently as the vessel moves the water depth is remaining constant. My code (pinched from examples in the PG) is : var ray = new BABYLON.Ray(new BABYLON.Vector3(0, nSeaBed.getBoundingInfo().boundingBox.maximumWorld.y, 0), new BABYLON.Vector3(0, -1, 0)); var worldInverse = new BABYLON.Matrix(); nSeaBed.getWorldMatrix().invertToRef(worldInverse); ray = BABYLON.Ray.Transform(ray, worldInverse); var pickInfoW = nSeaBed.intersects(ray); waterDepth = (pickInfoW.pickedPoint.y); 1. It seems to me that the ray should be intersecting with the actual mesh rather than the bounding box. Is this possible? 2. Also. I have to admit I don't understand the code - would someone be kind enough to comment each line to briefly explain what the code is doing, particularly 'invertToRef'. Thanks Richard C
  23. Do anybody know if its possible to create a class Like InstancedMesh BUT use a separate skeleton... So I can either clone or build up a skeleton for each instancedMesh to use... that way each instanced mesh could play a separate animation... Don't know if its possible with the current InstancedMesh class but maybe can be re-write a class of subclass that can handle using a seperate skeleton... Maybe just wishful thinking Yo @Deltakosh do you think would be possible at all ???
  24. Hi guys, I'm trying to make 2D-shapes / 2D-sprites in my Canvas2D (ScreenSpaceCanvas) follow some sprites which are placed in my 3d world. For this, I'm using the BABYLON.Vector3.Project function as followed: However, this is the result: I've checked each of the arguments and they all contain valid values at the time of being called. I've also stumbled across this topic, which uses another 4th argument in the call, but I've had no luck trying it with that one either. Any ideas? Thanks in advance!
  25. Hi, When using several camera, the water material is not displayed.