• Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by JCPalmer

  1. I know I mentioned this before, a really long time ago. When you switch to full screen, movement of the mouse directly affects the camera as if you had a button pressed. It happens in the playground. I cannot remember if it happens in user scenes. It just popped into my head to check if still a problem. It is.
  2. JCPalmer

    Going to full screen; mouse button stuck down

    Ah, that jogged my memory. It is only a lack of control in the PG. Not sure why PG sets requestPointerLock = true. It has to be one or the other. Why would someone want this in the first place, VR? DeviceOrientationCamera works without buttons.
  3. JCPalmer

    Cancel a merge object

    Correction, after reading the code a bit more, the first mesh is not reused, so yes you can do it.
  4. JCPalmer

    Cancel a merge object

    I am assuming that cancel means reverse, and your translator failed you. Yes, you almost can. There is a disposeSource argument, which defaults to true. Set it to false, then disable all the source meshes. If you later re-enable & nuke the merged mesh, then you have almost reverse. The one problem you have take care of is the first mesh in the list to merge, gets all of the merged vertices, so you can disable the first mesh. You also will have to have a complete separate copy of the first mesh in the meshes argument.
  5. JCPalmer

    LinesMesh and createInstance

    Yes, an actual linesystem is more efficient than instances, since it is only one mesh. It closely resembles a MergedMesh. It takes more memory, but if none of your lines never move / rotate / scale, then instances are not necessary. If you have to beat up on a resource, memory is about the safest choice.
  6. JCPalmer

    LinesMesh and createInstance

    BABYLON.Mesh supports instances. If you specify your positions the way Meshbiulder.CreateLinesystem() does from the lines argument, you can use a BABYLON.Mesh. var i = 0; for (var l = 0; l < lines.length; l++) { var points = lines[l]; for (var p = 0; p < points.length; p++) { positions[i] = points[p].x; positions[i + 1] = points[p].y; positions[i + 2] = points[p].z; i += 3; } } I already mentioned that LinesMesh uses ShaderMaterial, and that does not support instances.
  7. If this is the .babylon exporter, all actions that are identified as for a given object are strung together (with gaps). See your log file for ranges. Call each by named range (beginAnimation call): skeleton = scene.getSkeletonByName("bonesCharacter"); skeleton.beginAnimation("Walk"); When there is only one object with an action assigned, nothing to do, but when you have more than one mesh being animated, you must name each action, so the exporter can figure out which belongs to what, e.g. 'meshname-myaction'. If you just wish the current action assigned to be run against all objects, check: If you are using the glTF exporter, ignore.
  8. JCPalmer

    Morphing Objects

    I do not use BJS morphing, but I know what is a problem with morphing in general, that you are at least partially experiencing. Unless you animate every frame, or have some kind of rate algorithm for every vertex, morphing is linear. This can produce some interpolated frames which are wrong for the real world. Here is an here of converting finger gestures to morph targets. Do some gestures, THEN increase the morph time. It is harder to un-see after slowing down something which looks 'fine' prior. Fingers do not actually bend like that. In this specific example, I have made the trade-off of ditching like 40 bones, but cannot do slow morphs. With drapes / cloth in general, it looks really impressive to slow things down. I cannot help you, but hope at least your question was solved.
  9. Either: edit your .blend to delete the textures missing files, or Go get the textures from where ever you got the .blend file & place them where the log file says they are supposed to be, or Delete the meshes which use the materials are from.
  10. JCPalmer

    Web Assembly

    I think I remember back when I still received github issues / PR's via email, that someone was trying to make a web assembly version to math.ts. They gave up, as I remember due to lack of improvement. One might fish through the repo communications for what they found out.
  11. JCPalmer

    Web Assembly

    Just to make it clear, WebGL WANTS Typed Arrays, See here. Typed Arrays are backed by ArrayBuffers. If you can pass the addresses of ArrayBuffers to to this thing, you can just modify the memory going to the GPU directly. Nothing to either way. const normals32F = mesh.getVerticesData(BABYLON.VertexBuffer.NormalKind); const buf = normals32F.buffer; magic(&buf); // clearly BS syntax mesh.updateVerticesData(BABYLON.VertexBuffer.NormalKind, normals32F); If this is already being done, my bad.
  12. Does not knowing what 'the albedo stuff' is mean that is not your .blend? Have you looked at your .log file?
  13. JCPalmer

    Babylon performance Issue

    The only way I can think of for doing this for es5 transpile is: that the spec for es6 says the expression after the 'of' is only evaluated once. That makes sense, you do not want code being written where something in the loop changes the number of items of the expression. If not then the es5 code is a bug, for 2 reasons: The function only runs once & es6 code runs every time As stupid as it would be to do, just calling it had some side-effect
  14. JCPalmer

    Babylon performance Issue

    So when setting to transpile to es6, would this still occur? The reason I ask is, for..of is not in es5, once transpiling for es6 there is not a reason to change anything. Seems like that was not the purpose of Typescript.
  15. JCPalmer

    Babylon performance Issue

    I am not sure how much the getGeometryByID() change would help, because I do not even see getGeometryByID(), broken out in your profile data. I assume it is somewhere in Scene.pushGeometry(). Scene.pushGeometry(), along with the 2 functions broken out inside it, have a really high % of self time to total time. Does not leave a huge amount for getGeometryById(). The doubly nested loops are usually places which merit looking at. In another lifetime, I used a language with line level profiling, APL. Function level just kind of sucks. In this case though, the number of meshes which have multimaterials is small, so the inner loop is usually only called once. Something like this might be good from a es6 standpoint, but I have my doubts it will change performance a lot. const meshes = this.getScene().meshes; for (const mesh of meshes) { ... } In the case of LineMeshes, it is using a shaderMaterial, so that would have to be changed. Changing LinesMesh to use a StandardMaterial was talked about before. I was initially sub-classing LinesMesh for Hair, but I eventually gave up in favor of Mesh due to lack of thickness control. Do not remember what was said, but searching 'Hair LinesMesh' may be helpful.
  16. First, if you are running from file://, do not use chrome unless you set up a local server. Firefox & Edge allow from file, as long as it is the form of a relative path. 2nd, normally only the base file name ends up in the .BABYLON file. The path of source is just that. That is where .blender gets it from to copy. Sometimes if the file is embedded in the .blend file, there is no directory. You add it from the exporter custom properties on the scene tab.
  17. JCPalmer

    Is there any Babylon.js Chat? If not, I'll make one!

    Time zones are also working against this.
  18. JCPalmer

    Friendly competition

    Retro game, but must it be a computer game?
  19. Also, in 5.6.2, you can specify a subdirectory for the location of textures. Not sure that is your problem, but reason to ditch 4.6.1.
  20. Also, unless it is a typo, the exporter version is a 5.6.4. If that should have been 5.6.1 not 4.6.1, probably not a big deal. My personal opinion of ImportMesh is quite low. This forum is littered with mistakes where someone accesses newMeshes[0], and it is not the mesh they think it is. Append & Load might do the same, but people less often blindly pick [0]. If a .blend has a camera and or lights which are unwanted, temp delete them prior to export to avoid ImportMesh. I can see you are not doing that, but completely ignoring the callback for accessing can illiminate many problems, & also facilitate multiple Appends which can get ugly using callbacks. getMeshByName in an ExecuteWhenReady is an answer to your access question. BABYLON.SceneLoader.Append(url, "myfile1.babylon", scene); BABYLON.SceneLoader.Append(url, "myfile2.babylon", scene); scene.executeWhenReady(function () { const mesh = scene.getMeshByName("male1"); });
  21. JCPalmer

    importing from blender

    Since you had rotation being performed on the load of meshes in your the previous topic while loading, & your screen shots shows un-applied rotation & scale, I think you are just making what is called a mess. Just try straighten things out by applying transforms in Blender, commenting all rotation in loading & make sure you BJS camera is not upside down. Parent the other 2 messes to the third, or at least make sure they share the same origin, or rotating is probably not going to work.
  22. Cannot be Blender. It does not support morph target normals.
  23. JCPalmer

    Blender export error

    An export as is: I see missing textures, not sure if you have them. I remove 'red paint', it worked. i remove '15 - default', it worked. i remove 'Deck Green', stairs now turn all yellow, but it worked. i remove '07 - Default', stairs now turn white, but it worked. i remove 'White', stairs now turn black, but it worked. i remove 'Dark Grey paint', stairs now green, but it worked. i remove 'Deck Green', & now have no materials, ut worked. Seems old that the color should change on the whole mesh though. For meshes with multiple materials, they should not be the same vertices for each material. Reloaded .blend, put mesh into edit mode, hit select button while each material selected. 'Deck Green' is used for all the vertices.
  24. JCPalmer

    Multiple Scenes Approach

    Then there would be only one GL context. Not sure about an effect to frame rate, but should be less resources. One other thing you might try is perhaps only actually render a scene, when the mouse is inside a canvas. Kind of application specific, and would not work for scenes with animation. There is only one mouse though, so could be a sneaky cheat for some.
  25. @ozRocker, I did notice this when looking at Blender 2.8 dev docs. It is not like I was going to do this, but for that. Particle "Rewrite" seems coming.