Search the Community

Showing results for tags 'gltf'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

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

Found 61 results

  1. Hi! I'm doing a custom exporter from a source to get nice and structured glTF models as binary-glTF for my use case in BabylonJS. I modified it so that it comes equipped with the tags for MSFT_lod in place. I found I got it working to an extent with 3.1.1 version and I finally figured out that it's just simulating the loading of higher detail levels. So I checked out the latest as well. Trouble I'm seeing now after modifying the lod scheme in the loader for MSFT_lod, so that it would in fact use the addLODLevel function, is that the meshes that are part of the logical tree don't seem to hide away and I'm wondering why. I did also figure out a potential getaway card with the idea, that since I have put the submeshes to contain anything that belongs to a leaf of a node into the same subbranch of the tree, I can pretty much flip the mechanism around and just reconstruct the tree form branches and would-be-boundingboxes to form a makeshift LODding scheme. It's not what I wanted per say, as I would love to control the scheme in the exporter side. Now I am still thinking if even that will work if I cannot even make the branches disappear with addLODLevel(distance, null) calls. Help, please? Cheers!
  2. I am using Skybox in the sample below. However, it takes a considerable time to display it compared to without using Skybox. It is 4 to 5 seconds to experience. I tried it in the following two environments, but both are felt late. PC1: ThinkPad X260 + Windows 10 Version 1709 (OS Biuld 16299.371) + Intel(R) HD Graphics 520 PC2: Desktop PC + Windows 10 Version 1803 (OS Build 17133.73) + NVIDIA GeForce GTX 660 Is the usage incorrect? I will be saved if you give me advice. https://cx20.github.io/gltf-test/examples/babylonjs/index.html?model=Duck&scale=1 // Skybox var cubeTexture = new BABYLON.CubeTexture( "../../textures/cube/skybox/", scene, ["px.jpg", "py.jpg", "pz.jpg", "nx.jpg", "ny.jpg", "nz.jpg"] ); scene.createDefaultSkybox(cubeTexture, true, 10000); It seems it takes 4 to 5 seconds to display irrespective of cache with or without cache. BTW, The following is a sample of Three.js. I am using Skybox, but it takes less than 1 second to display. https://cx20.github.io/gltf-test/examples/threejs/index.html?model=Duck&scale=1
  3. Howdy friends! I'm proud to share my first production WebGL project: https://cash.me/reps (Scroll down to enter the game mode) Uses: GLTF assets Metallic Roughness Physics Camera Movements Force Touch on compatible devices Screenshots: Huge thanks to the community for helping answer my questions as I got up to speed! Especially @Deltakosh @bghgary @donmccurdy and @Wingnut
  4. We are glad to present a maintenance release of the Blender version of Verge3D – yet it contains quite a large set of new functionality. Among the most exciting features are the optimized Facebook export, support for custom fonts, extremely efficient asset compression using the LZMA algorithm, lamp energy animation and almost 3 dozen of new puzzles! Read the full article here!
  5. Hi guys! I'm relatively new to both Babylon JS and 3D world and I'm trying to understand how things work in order to use Babylon JS in my current project. So please forgive me if I'll say nonsense. What I would like to do is import assets in my scene from external files, for example from a glTF or obj file, manipulate objects and then save the final 3D scene in .babylon format in order to read it back later. I'm getting problems when I import objects from glTF files and in particular for the textures. First of all, when I import the glTF file, for each texture a new blob in memory is created and the temporary object url (created with URL.createObjectURL()) is set to the texture url, losing the original file name. Secondly and more problematic, the UV mappings does not seem to work anymore when reading the serialized babylon json file. To explain better I created a playground sample. https://playground.babylonjs.com/#KGVJR8 The sample loads objects from two files: the original avocado.gltf file (shown on the left in the scene) and the serialized baylon file (on the right). To get the babylon js file I just serialized the scene with the object obtained from the glTF file and I replaced in the resulting json the blob object urls with the file names of the textures, saved to the same path as the babylon file. As you can see, in the object on the right the texture coordinates are not mapped well anymore to the mesh vertices. However, if you look at the console, you can see that the uv data seem to be there and are the same in both cases. So what could be the problem? Am I doing something wrong? I hope I've explained myself well, Thanks, Matteo
  6. Howdy, I seem to be having some bit of difficulty in getting the vertex data from an imported gltf asset via the asset manager. The loadedMeshes don't seem to expose the underlying meshes in a way that allows me to grab the vertices. Am I doing something wrong? Any playgrounds out there that might be of use here? JPS
  7. Live demo HERE! We are excited to announce the first significant update since the 3ds Max version of Verge3D was originally released last month. This update includes important graphics developments, such as the reworked physical material system, the support for edited normals and smoothing groups, shadows and transparency, adds even more puzzles to help your code-less scripting workflow, and fixes many issues reported by early adopters. Read the full list of new features in this acticle!
  8. Hi there, I started jesting around a few days ago on babylonJS and was wondering if it was possible to get the GLTF Loader with npm to import it as it is not in the babylonjs npm package. Thanks in advance for your help. Dos.
  9. Howdy, Is there any way to customize how the blobs from textures in the GLTFLoader are treated? I'm running into an issue where the blobs are violating our content security policy because they are appended to our base url instead of the approved CDN the assets/textures are coming from. Let's say I'm pulling a GLTF asset via: let myAsset = assetsManager.addMeshTask("", "", "https://mycdn.com/static/gltf/", "my-asset.gltf"); So instead of: blob:https://myurl.me/24bde0c8-d576-4abb-a3f4-06a05b38b8f3 We get: https://mycdn.com/static/gltf/24bde0c8-d576-4abb-a3f4-06a05b38b8f3
  10. Howdy. I don't see to be able to access the materials associated with meshes in a gltf file while using the addMeshTask method. This was working as recently as yesterday. Has something changed in the last day?
  11. Anyone tested Maya exporter for gltf format on macOs ? https://github.com/BabylonJS/Exporters/tree/master/Maya I don't understant how install it, Need it to be compiled ? thanks
  12. I getting this annoying error when loading GLTF 3D models on my Apache web server on Linux system. babylon.glTFFileLoader.js:2571 Uncaught TypeError: this._errorCallback is not a function at GLTFLoader._onError (babylon.glTFFileLoader.js:2571) at babylon.glTFFileLoader.js:3265 at e.callback (babylon.glTFFileLoader.js:3168) at e.notifyObservers (babylon.js:3) at babylon.glTFFileLoader.js:3180 at XMLHttpRequest.e.onreadystatechange (babylon.js:3) The code runs like a charm locally. I mean if I have the .gltf, .bin and the textures. When uploaded to the web server connected to a back-end Omeka (a digital asset management system) where we are storing our 3D models files with metadata. The following JS code is the one used, it loads Objs and gltf. Apparently the .gltf and .bin are fetched but not the textures. Although the JSON images field in the gltf contain the right names and paths. <script> function RenderLocal(RelativePath, MeshName) { console.log("I entered RenderLocal(RelativePath, MeshName) "); console.log("RelativePath: " + RelativePath + " MeshName: " + MeshName); //Making sure there is no trailing spaces var RelativePathTrimmed = RelativePath.trim(); var MeshNameTrimmed = MeshName.trim(); //Retrieving form Canvas var canvas = document.getElementById('renderCanvas'); //Creating an instance from the Engine and assigning it to the Canvas var engine = new BABYLON.Engine(canvas, true); //Loading text is controlled using loadingUIText : engine.loadingUIText = "Please wait for the Model to load..."; var createScene = function () { console.log("NEW - Trimmed RelativePath: " + RelativePathTrimmed + " MeshName: " + MeshNameTrimmed); //Creating a BABYLON scene var scene = new BABYLON.Scene(engine); //Clear the background scene as black scene.clearColor = new BABYLON.Color3(0, 0, 0); //Adding a light //var light = new BABYLON.PointLight("Omni", new BABYLON.Vector3(20, 20, 100), scene); var light = new BABYLON.HemisphericLight("Omni", new BABYLON.Vector3(0, 1, 0), scene); light.intensity = 1; //var loader = new BABYLON.AssetsManager(scene); // This creates and positions a free camera (non-mesh) var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0, 5, -10), scene); //Adding an Arc Rotate Camera // var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0.8, 100, BABYLON.Vector3.Zero(), scene); //camera.attachControl(canvas, false); //Adding an Arc Rotate Camera // var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0.8, 100, BABYLON.Vector3.Zero(), scene); // camera.attachControl(canvas, false); var assetsManager = new BABYLON.AssetsManager(scene); var meshTask = assetsManager.addMeshTask("skull task", "", RelativePathTrimmed, MeshNameTrimmed); //BABYLON.SceneLoader.ImportMesh("", RelativePath, MeshName, scene, ready); meshTask.onSuccess = function (task) { var myMesh = task.loadedMeshes[0]; task.loadedMeshes[0].position = BABYLON.Vector3.Zero(); // Create a default arc rotate camera and light. scene.createDefaultCameraOrLight(true, true, true); // The default camera looks at the back of the asset. // Rotate the camera by 180 degrees to the front of the asset. scene.activeCamera.alpha += Math.PI; // myMesh.computeWorldMatrix(true); // myMesh.refreshBoundingInfo(); // var meshCamera = new BABYLON.ArcRotateCamera("ArcRotateCamera", -Math.PI / 2, 1.2, 140, new BABYLON.Vector3(0, 0, -10), scene); // meshCamera.attachControl(canvas, false); // scene.activeCamera = meshCamera; }; meshTask.onError = function (task, message, exception) { console.log(message, exception); }; // Move the light with the camera scene.registerBeforeRender(function () { light.position = camera.position; }); assetsManager.onProgress = function (remainingCount, totalCount, lastFinishedTask) { engine.loadingUIText = 'We are loading the scene. ' + remainingCount + ' out of ' + totalCount + ' items still need to be loaded.'; }; assetsManager.onFinish = function (tasks) { engine.runRenderLoop(function () { scene.render(); }); }; assetsManager.load(); return scene; }; var scene = createScene(); engine.runRenderLoop(function () { scene.render(); }); //$("#renderCanvas").resizeCanvas(width = "800", height = "600"); // Resize window.addEventListener("resize", function () { engine.resize(); }); } var htmlInput_PHP = <?php echo json_encode( $item ); ?>; console.log("List in htmlInput_PHP: " + htmlInput_PHP ); var htmlInput_PHP_length = htmlInput_PHP.length; var OBJRegExp = '.obj'; var GLTFRegExp = '.gltf'; var ObjFileToLoad = ''; for (var i in htmlInput_PHP) { if (htmlInput_PHP[i].endsWith(OBJRegExp)|| htmlInput_PHP[i].endsWith(GLTFRegExp)) { console.log("htmlInput_PHP[i] is: "); console.log(htmlInput_PHP[i]); ObjFileToLoad = htmlInput_PHP[i]; } } var filename = ObjFileToLoad.replace(/^.*[\\\/]/, '') console.log("FileName Extracted: " + filename); var relativePath = ObjFileToLoad.replace(filename, ""); console.log("Relative Path Extracted is: "); console.log(relativePath); RenderLocal(relativePath, filename); </script> The following injection of PHP code in JS var htmlInput_PHP = <?php echo json_encode( $item ); ?>; Attached 2 images (console of Google Chrome + an image on the Network Inspector of Google Chrome) this is to fetch a PHP array from Omeka back-end and transforming it to JS so that we have the full paths of the gltf file, .bin binary file and all textures pertaining to the item chosen by the user as you can see in the images attached the list of paths are correct so what is the problem? Actually this code worked fine with other items in the .obj format. Is it possible the .manifest thing that keeps showing in the console or Network inspector or I reckon maybe the gltf JSON 'images' field should contain some relative path I am not sure so that Apache can go and fetch the textures? I am extremely confused Please any help is appreciated...
  13. Hi, I've experienced weird problem when I try to rotate an imported gltf mesh. It turns super fast and seems not logic at all. Someone has any idea why? Or is it a bug? Here is the playground example to show this problem. Thank you. http://www.babylonjs-playground.com/#742772#3
  14. My gltf model looks transparent, the material is fine..what could have been wrong? https://www.babylonjs-playground.com/#11BH6Z#326
  15. Hey Guys, I tried all things with glTF model, I can't texture it in live programmatically, I don't see examples or documentation anywhere. The issue is that when I try to re-texture (for example change albedo) with new BABYLON.DynamicTexture I have black texture. When I try to recreate a PBR Material, the texture doesn't stick on the UVs model. Its crazy ! The only way I see is to change the JSON glTF and reload the whole glTF with the mesh model ! If anyone can show me the syntax to do texturing on a mesh with glTF PBR syntax, it's welcome. thanks
  16. Hello community We have an object ( 2 meshes ) with multi material exported with 3dsmax to GLTF format. In inspector, we saw that the exporter splitted our object to 13 meshes. One mesh for each material. Is it possible to keep the same object but with a multi material option instead ? Thanks in advance. Have a nice day .
  17. [solved] 3DsMax to GLTF : inversed normals

    Hello community We catch a bug with the last exporter version of 3dsMax ( 0.36.0 ) In fact, the normals are inversed with the stable version of babylon.js and not with alpha 3.2.0-alpha7. You can see here the result of a mesh we export today : It working on Sandbox because it run with alpha version of Babylon. @Deltakosh, about that, is it possible to add to the Sandbox an option like playground to choose the stable or latest version ? Can you fixe the exporter for the stable version ? Thanks in advance, Have a nice day
  18. Hy there!! i tried exporting my model with different animation clips seperately to gltf, it exports only the current animation. Just curious does the new gltf exporter support animation export from other clips too?
  19. i tried loading gltf models from threejs and it seems the animation is broken http://www.babylonjs-playground.com/#WGZLGJ#9
  20. Hello everyone! I'm trying to learn how emissive textures work in BJS, and through this tutorial (https://github.com/KhronosGroup/glTF-Blender-Exporter/blob/master/docs/user.md) managed to get a Blender model with an emissive texture (basically itself) loaded in BJS as a .gltf model. However, even though in Blender's Cycles Render I can see some illumination from the light on the wall, I don't get any lighting in BJS. Why is that? Also, is there a setting, in Blender and in BJS, that controls the range/brightness of the light? I'd light it bright enough to light the floor Here's the bare-bones playground: https://playground.babylonjs.com/#F2H81M
  21. I see that the babylonjs loader does not convert the glb or gltf meshes from right-handed system (their native format) to left handed system. Instead it seems it parents them with "__root__" nodes to handle them in a left handed system. Is it not possible to convert them entirely to left handed-system?
  22. GLTF loader error

    Hello everyone I have a bug when I try load a GLTF with Babylon 3.1.1 : The gltf file is working on sandbox and there is no error in network. I can't create a PG for this ... ( it's working here : http://www.babylonjs-playground.com/#WGZLGJ ) Can you help me please ? Thanks ps : I download the loader today ... Perhaps the last ts compilation created an error ...
  23. I am using Blender exporter to `.babylon` file format but lately am noticing more mentions of `.gltf` (and `.glb`) besides your support for others. What is your recommendation for my use case explained below or more generic rule of thumb on when to to use which format? My context: We make scenes in Blender with more than 100 smaller pieces with textures and expose those with BJS. We allow users to change textures and materials. We allow users to move objects. We do do not have any animations.
  24. gltf vs babylon file

    Hello everyone, First congrats for this new v1.3 babylon version. Seems there is a lot of nice improvements and new tools! I look at the gltf file format and I was wondering what was the differences with the babylon file format? For instance I have look at some gltf files and I think they are way more light from what I saw with the babylon files. So does this this mean they would be faster to load ? I guess that once the gltf model is loaded, you will have the exact same properties as in any mesh ( materials, clone, position, etc ) ? Cheers, Pichou
  25. I tried to display the glTF model with the latest version of Babylon.js (v3.1 rc-1). However, it seems that some models do not display properly. BoxTextured ... Texture is not displayed BoxAnimated ... Animation only works partially RiggedSimple, RiggedFigure, CesiumMan, Monster, BrainStem, VirtualCity ... Animation does not work https://cx20.github.io/gltf-test/examples/babylonjs/index.html?model=BoxTextured&scale=1 https://cx20.github.io/gltf-test/examples/babylonjs/index.html?model=BoxAnimated&scale=0.5 https://cx20.github.io/gltf-test/examples/babylonjs/index.html?model=RiggedSimple&scale=0.2