Popular Content

Showing content with the highest reputation since 11/15/2018 in all areas

  1. 9 points

    Deltakosh out for 2 weeks

    Hey team! I'll be out for two weeks going to some needed vacations Do not expect any answers from me during this timeframe See you all in 2 weeks!!
  2. 6 points

    draw font inside of shader

  3. 5 points

    GUI ScrollViewer

    ScrollViewer now available and enhanced by DK
  4. 5 points
    I made a progress bar using two rectangles, a container and a text block, here I thought I would share because I am very proud of myself ! You can find the code to run it just here: https://playground.babylonjs.com/ts.html#P3XLK9
  5. 4 points

    Introducing Dark Matter CCG

    Hey all, So I'm finally starting to promote my babylon based project a bit now, that I have an actual site together at www.darkmatter.game - The game itself isn't hosted there or anything (it will be a PC+Mac release), but I have been putting out a ton of playtest / demo sessions I've recorded on YT and posting on site (and will be throughout the next week). So anyways, if you're into digital CCGs or CCGs in general, you should def check it out as it's quite unique. I would also love any feedback, and am happy to answer any questions you might have! Also, should say thank you to anyone on these forums who has helped me in any way up to this point! I mean, these forums are seriously great, and filled with helpful people. (Should my project make it into the big leagues you can be sure I'll do a forum search and you can expect your name in the credits )
  6. 4 points

    Error on loading .OBJ files

    @Madclaws - Firstly, your file names don't match, so unless you have edited the OBJ and MTL files yourself, the loader is looking for the same name MTL file. Start by opening your OBJ file in any text editor, and verify the name of the .mtl file the .obj file is looking for. This will be in one of the first few lines of the OBJ file. As it appears the OBJ file is looking for a different MTL file name, this is not normal. It;s always best to keep your OBJ, MTL, and JPG (texture file) the same name as every exporter I've ever used writes these as the same name; and looks for the same name files on import - definitely the Babylon OBJ file importer. And your OBJ manifest file and MTL file are of different names. So I might assume your other files are not matching the names precisely. Upper case and lower case must match also. You don't need a manifest file... however, if you want to get rid of the 404 error for the manifest file, simply create an empty file with the same name as your OBJ file, and give it the extension .manifest. Example 'obj_name.babylon.manifest'. However, this is not important as others have already stated. If you're loading multiple OBJ files, then I recommend editing your OBJ file and remove the reference to the .manifest file. Then it won't look for the file. As for the .mtl file, this must also have the same name as the obj file. Example 'obj_name.mtl'. This is your material file with all your material attributes (settings.) This will work the same way if your mesh has a texture which will also have the same name as your obj file with an extension for the texture such as 'obj_name,jpg'. I work with OBJ files every day, and almost always edit the OBJ and MTL files as they are self explanatory once you open in a text editor. If you don't want a MTL file on your mesh, then simply remove the reference to the MTL file in your OBJ file. Then it will simply use a default material or none at all depending on your OBJ file edit. However, I find that different applications such as Blender often write odd values to the MTL file which is completely dependent on the user who has set up the material and texture. So I almost always edit my OBJ and MTL files as I can get the desired material editing the ambient, diffuse, specular values, etc. directly in the ascii files themselves. It's so very easy to read and edit. 2 minutes experimenting with no prior knowledge is more time than anyone needs to learn everything there is to know about the OBJ format - including editing normals, vertices, etc. It's simple for a single OBJ file, but if you work with real time scans producing hundreds of unique OBJ files to load in real time, then I write simple scripts to edit each OBJ file as needed. The .babylon format has many attributes which is far more advanced if you want to export scenes. However, if you are only importing meshes, the the OBJ format is by far the most reliable format and provides a level of flexibility in being able to edit the ascii files directly. Once you open the OBJ and MTL files and spend a couple minutes editing these and learning what values represent the different attributes, this will become your format of choice for meshes. I can't imagine otherwise, as there is little to nothing which will cause you problems once you understand the format. Remember that you can always apply Babylon materials and textures (and other attributes such as shaders) after import - which I do often. I hope this info helps, as you're definitely on the right path to the ease of importing OBJ files. If you read this and follow the advice to test a few edits to the files, I can't imagine you won't have a firm grasp of the OBJ format. However, if you still have issues, then post an OBJ, MTL, and JPG file all with the same name before the extension, and I'll be happy to walk you through the key lines to edit to gain full control over the resulting mesh(s) import. FYI - I introduced the other software engineers at Sony Electronics to the OBJ format, and it is now the format of choice for practically all mesh content due to it's simplicity and flexibility. This is after they spent several months working will every other format and exporter. No need to over complicate simple tasks - which often happens due to the OBJ format being decades old now; so people assume newer formats are better. But there's a reason why the OBJ format continues to be the most widely used in export/import between most applications. Cheers, DB
  7. 3 points

    [WIP] Space Invaders Cubed on Android

    Oops, posted this in the general demos and projects forum.. I've been developing this game over the past few months.... It's been Alpha tested and I think it is now ready for Beta testing...! Screenshot attached. Its been developed using Basic4Android, which creates the WebView for the game and the Menus. The rest is HTML5, using BabylonJS and JS to create the gameplay mechanics.
  8. 3 points

    Dynamic bodyshape demo

    I've been experimenting with a tool for shoppers so they can create their bodyshape in realtime and see which clothes fit them (whether that's a viable platform or not depends on the what the shoppers think) Here is the LIVE demo: https://punkoffice.com/bodyshape There was a bit of stuffing around to make this work. I had to separate the body-parts into polygroups. To do this I needed to add code to the Blender exporter so it would export vertex groups. Then I added code to the Babylon.js library to be able to parse the vertex groups from the exported JSON file. I've got a base model and an overweight model and I'm basically morphing polygroups from base to overweight. The girl was a housemate that I scanned but her bodyshape is a female from MakeHuman http://www.makehumancommunity.org/. The overweight morph target was also made in MakeHuman. I use Wrap from these guys https://www.russian3dscanner.com/ so I can change the topology of my scans to another topology (in this case, the MakeHuman avatar). This is all done via the CPU. Maybe a better coder than me can get it working on the GPU.
  9. 3 points
    https://ljzc002.github.io/CardSimulate2/HTML/TEST4optimize.html I'm trying to make a battle chess game framework.By now,I have completed the following functions: Use wasd,Shift,space to fly around the scene. Press alt to display hand cards. Click to chose one card or use Shift/Ctrl to select multiple cards and use 1-5 to team them up. When close to a hand card,you can click the button '落子'(Drop the pawn),then the sight change to orange,click the chessboard with the orange sight,the hand card will became a chess pieces. Select a unit on chessboard will display the range of movement by blue masks and the skill table by a DOM node,then you can move the unit by click the mask or click the DOM node to select a skill(up to now,only 'nattack' and 'test5' can work),click other grid or the unit itself will deselect the unit. Use skills to an target will trigger a series of animations,if the unit's hp falls below zero it will turn gray and go up to hand cards. After a round of action,you can click '下一回合'(Next round) button in the hand cards view,the unit on the chessboard will be waiting for move again. I don't have much experience in making battle chess games.I am eager to get to get some suggestions on how to optimize the ui and the operation mode. Next,I plan to use some 3D model to represent units on the chessboard,add some sound effects into the scene,and try to make a websocket interconnection.
  10. 3 points
    Here is a version that gets close. Its in Javascript rather than typescript but might help you spot any issue with your PG. Doesn't deal with non-letters and letters are applied to all sides. Also I made the cuboids immovable but this can be removed. https://www.babylonjs-playground.com/#UIIK1W And here is one using an second SPS of labels in front of the cuboid https://www.babylonjs-playground.com/#UIIK1W#1
  11. 3 points

    Pixi.js Showcase

    Hello guys, as an old fashion ActionSript programmer I simply love this engine. I created simple floor planning app for temporary walls company - app is responsive and should work across mobiles too. (antialiasing disabled for maximum speed on mobiles). Thanks for this wonderful library. Links: http://www.roomdividersny.com/floorplanner_js/ its a JS version of application created originally in flash years ago, which is still available here: http://www.roomdividersny.com/floorplanner.php P.S.: This is a real app, so please, if you will play with it, dont save (Submit) your work (plan).
  12. 3 points
    @nogalo, what you are describing is a common organizational issue in games. There are a couple of things you can do depending on your assets to load only three meshes total for all of your needs. If your characters are similar in form, say all humanoid bipeds, and share some animations you will want to use animation retargeting to reduce your mesh load. What this means is that all of your meshes need to share the same skeletal structure, both in heirarchy and naming, and you can pass an animation from one skeleton to another. That means you only need to include the animations in one of your incoming characters and then pass the animation clips to any other skeleton and the rotational information from the skeleton will work. You could even import a default character with all the animations that never is rendered on screen but allows you to add more character styles independently of your animation rig. Each individual character carries their own skin weighting so the joints on target models can even be in a different proportion than the default model so long as the animations take this variance into account (say one model has a longer torso or shorter legs). This is the most forward thinking path because it separates your animation pipeline from your character pipeline. The key to this is that you need to pack all of your animations in one timeline for export. I would leave blank frames in between each clip to eliminate interpolation errors, maybe 10 unkeyed frames between clips, in any order that makes sense to you. Once you have your timeline filled with all animations you will need (51 in your case if none are similar like walk or idle) export the file as normal. If you are using Maya, you can author your clips on export with the clip tool in Maya which you can find under the Babylon Menu: Create a new clip for each animation, giving it a name and start/end frame. If you then drop your model into the Babylon.js sandbox, you will see the first animation in the list playing and have the ability to change to any animation with the drop down on the footer bar. If you aren't using Maya, you can manually create your clips as variables in your code which can be found in our animation docs. The best example of this is the animation blending example: https://www.babylonjs-playground.com/#BCU1XR#0 The other way to do this if you don't have shared animations is to keep each character's animation in their own file. This is the best path if you don't share character structure, as in one is a biped and another is a quadruped. This makes each character file individually larger as you carry the curve information in each file so you have a trade off for download of the characters. This makes the shared animation method more desireable if you can swing it, even if there is one more default mesh that holds all animations as your characters are more flexible and lighter on download. This method is also useful if you want to vary up animations and have multiple idle animations that randomly sequence. Containing all clips in one file and randomly choosing one to play when the character idles will make your game feel more dynamic. I hope this helps point you in a direction that allows you to get the most flexibility out of your characters and still not have to load more meshes than you need. Please let us know if you have more questions or want us to take a look at a sandbox for you. Take care!
  13. 3 points

    Changing few vertex position in a mesh

    You could just update the 16 wanted vertices and still pass the whole modified buffer (verticesData).. The bottleneck isn't usually in the size of the buffer to be passed to the GPU but rather in the user logic. Have you profiled your code to check where the time was spent and what was responsible for this time consumption ? BJS provides a feature that could fit your need, called the Solid Particle System (SPS), with many optimizations already set : https://doc.babylonjs.com/how_to/solid_particle_system and the ability to update only some parts of the system (mesh) and to use a single texture too.
  14. 3 points

    Dynamic Terrain

    New feature for the DynamicTerrain : per object color and texture. The previous feature added the ability to set objects in an object map, as many as wanted, by setting their positions, rotations and scalings in the map. A SPS was used to render these objects in the terrain with a reduced pool of recycled solid particles. This new feature allows now to pass also to the terrain data about object colors and textures (uvs actually) in the same way than object settings. Example of randomly population of objects in the map with random colors and uvs : if (Math.random() > 0.8) { let xp = x; let yp = y; let zp = z; let ry = Math.random() * 3.6; let sx = 0.5 + Math.random(); let sy = 0.5 + Math.random(); let sz = 0.5 + Math.random(); let r = Math.abs(xp) / mapSubX + 0.5; let g = Math.abs(zp) / mapSubZ + 0.5; let b = Math.abs(yp) / elevationScale + 0.1; let u = 0.9 * Math.random(); let v = 0.9 * Math.random(); let type = index % 3; SPmapData[type].push(xp, yp, zp, 0, ry, 0, sx, sy, sz); SPcolorData[type].push(r, g, b, 1.0); SPuvData[type].push(u, v, u + 0.1, v + 0.1); } then the terrain creation with the new parameters SPcolorData and SPuvData : var terrainSub = 100; // terrain subdivisions var terrainOptions = { terrainSub: terrainSub, mapData: mapData, mapSubX: mapSubX, mapSubZ: mapSubZ, mapColors: mapColors, SPmapData: SPmapData, sps: sps, SPcolorData: SPcolorData, SPuvData: SPuvData }; var terrain = new BABYLON.DynamicTerrain("dt", terrainOptions, scene); terrain.mesh.material = terrainMaterial; That's all ... now each recycled solid particle will be ever given the right settings, colors and uvs when rendering the related object in the terrain. Documentation to come. Live example : http://jerome.bousquie.fr/BJS/test/terrainSP.html
  15. 3 points
    UPDATE: Facebook gaming platform is massive.... with "GameRoom" sdk, for native. NOTE: Temechon did an awesome technical on this: https://doc.babylonjs.com/resources/babylonjs_and_instant_games The relatively new market on FaceBook in 2018, is called "Instant Games". Giving that a try! https://developers.facebook.com/docs/games/instant-games UPDATE: new security hurdles - fyi. Good News (if you've not seen): BABYLONJS is at the TOP of compatible games!!! In an alphabetical list... still - great to see BABYLONJS at the TOP! https://developers.facebook.com/docs/games/instant-games/compatible-engines : )
  16. 2 points
    I've just finished the morphing demo that I've been working on. Thanks everyone for your input! (especially @NasimiAsl who is the grandmaster of shaders) What I'm trying to demonstrate here is morphing not just vertices, but textures as well. I got this idea from Wrap3 which has this feature. This is important with faces because redness and wrinkles will sometimes appear when you tense your face. Unfortunately there is no built-in feature to do this but we were able to pull it off with some extra shader code. I would've loved to add some specularity to the skin but I couldn't figure out how to do that with the custom material. I know this is extreme detail but its a good test. If the player is in the distance then it wouldn't be necessary. I added a "Powered by Babylon.js" sticker so everyone knows that Babylon.js can do cooler stuff than Three.js hehe Feel free to use the source code. http://punkoffice.com/facial
  17. 2 points

    [SOLVED] polygroups?

    I finally got off my lazy ass and implemented a solution. You can see the result here: preview.punkoffice.com/bodyparts I altered the mesh.py file of the Blender exporter to parse the vertex groups. If anyone wants to see the code changes I've attached my version of mesh.py. The bits I added have # _NEW_ before the code. I'm not great at Python so maybe it can be improved. @JCPalmer this might be of use to you if you want to incorporate vertex groups. So the extra JSON in the .babylon file looks like this: "vertexGroups":[{"name":"waist","id":"waist","indices":[4053,4054,4055,405, etc....]}] In the Babylon.js code in the Mesh.parse function I added this ( @Deltakosh if you want to incorporate vertex groups you can use this) // Vertex groups if (parsedMesh.vertexGroups) { mesh.vertexGroups = parsedMesh.vertexGroups; } I also had to add a new function to find the vertex group: BABYLON.Mesh.prototype.getVertexGroupByName = function(vgName) { for (var i=0; i<this.vertexGroups.length; i++) { if (this.vertexGroups[i].name == vgName) return this.vertexGroups[i]; } return null; } I'm not sure if this is the best way so feel free to ignore if its not efficient, but it works for my needs. mesh.py
  18. 2 points

    Sample code of bones

    You define the names with skeleton.createAnimationRange("walk", 0, 40);
  19. 2 points
    The flashing is because of z-fighting with the textures. You prevent this by separating the meshes (line 210). Having stopped the rotation the direction of separation has to change from z to y https://www.babylonjs-playground.com/#W8L8IP#2 As you want the shape too be in XoZ plane and to rotate, then sprites will not work as they always face the camera. You can achieve the same idea with a transparent image on the ground plane ( the image used would need improving but shows the idea) https://www.babylonjs-playground.com/#8UZ3JD
  20. 2 points
    IT is because the private fields have been replaced by public properties: https://www.babylonjs-playground.com/#UZGNA#6
  21. 2 points

    About planepanel's local working

    @Buzul it is because the playground register for scene ready but it is not by default. you need to use registerWhenReady instead: https://www.babylonjs-playground.com/#113717#3
  22. 2 points

    Demo with Ammo.js Physics Engine

    Thank goodness 😄
  23. 2 points

    PhysicsHelper updraft does not work

    I modified the helper to be more resilient Thanks a lot @ssaket for the help! (again ;))
  24. 2 points

    Classic Space Adventure

    Usually I look at the errors in the browser console, made on the Unity WebGL unit, all the info is transferred there. But in your game the console is empty. How to pass your game? I got into the dungeon in the first part, and fell into the second part. Is it considered that I passed the first part? Or should I still return to her?
  25. 2 points

    Problems with Keyboard events.

    I figured it out. It was the evernote web clipper chrome plugin messing with keyboard input. I realized it might be a chrome issue when I tested in firefox and it worked fine. (someone else posted a similar issue here)...