• Content Count

  • Joined

  • Last visited

  1. Well, the issue isn't really solved. If I can't get the normal map to render correctly when using a rig, I'd be interested in knowing whether anybody else is able to use normal maps successfully with rigs or if this is specific to my rig (even though I've normalized and limited the number of influences etc.)? If it has to do with my normal map itself, should I render in Zbrush instead, and using what settings etc.? A description of a working pipeline would be great, because normal maps seem to be so poorly documented in BJS.
  2. @PatrickRyan of course! I'm using the Babylon exporter "Babylon.js ver 5.6.4" and export by simply going to File->Export and clicking on that exporter. Not many options in there though. I've also tried increasing the precision from three decimals for the various parameters to five (maximum) (these options can be found in the Scene data tab in Blender IIRC), but to no avail. Actually, even without the rig, the problem is still kind of there... it's just much more difficult to spot and probably won't be a problem when a diffuse texture is in place as well. That's correct, I don't apply any materials or textures in Blender. All textures are applied in BabylonJS in the JavaScript file. Just for the sake of trying it out, I tried applying the normal map in Blender now and then exporting, and removed the commands importing/setting the textures and materials from the JavaScript code but the problem persists. Still, I've uploaded another Blender file here with the normal map applied in Blender if you prefer that: https://drive.google.com/open?id=1tfxacZW5kMej1WYFry9Sq9DKbkMSNKx3 I also tried exporting the mesh as OBJ and rendering a new normal map with it as the low poly and then importing it to Blender again and exporting to Babylon, to make sure it's the same normals as used when making the normal map, but still got the same result.
  3. @PatrickRyan, thanks! I managed to replicate what you did and I get the same results as you do in the Sandbox with a glTF file exported from Blender. The issue with the export is weird, I don't get that myself, so maybe we're using different versions of the exporter. I don't get this rotation of the jaw either? However, in my application, no matter if I'm using StandardMaterial or PBRMaterial, I get the same issue still even after smoothing out the normals. But after some more testing, I found that the issue was the rig. By unparenting the mesh from the rig, the problem doesn't show up anymore... I don't see what the issue is with my rig - I've limited the number of weights per vertex to 4, and normalized the weights and everything... Here's a RAR with the full package, from a very minimal website to the Babylon files and textures: https://drive.google.com/open?id=1S98dLumerNHDdQ3HOpNuzo1WoZb8j4ir
  4. @PatrickRyan, sure thing! https://drive.google.com/open?id=1UkMj-BMo6ab4EaEhWGDVLA5IP2M1HYSB
  5. Nope, haven't tried GLTF at all. So from Blender using the GLTF exporter instead, and then using the same normal map on that in Babylon? Oh wow, thanks! Here's the mesh and the normal map used in those screenshots above. This normal map has some other artifact under the nose as well, but ignore that for now - it doesn't show up on new Xnormal-rendered normal maps so it might be because of some mistake on my part, but those artifacts in the OP have been persistent for all renders. The mesh: https://drive.google.com/open?id=11EFFKHfR85aTQzWwJOSHWHQHNqqpsNAp The normal map: https://drive.google.com/open?id=1miZZ8i6l30L5fQ2Q6LUlVbS1L26GKyyc Cheers!
  6. Hi, There have been numerous threads on this issue kind of, but I just can't find any answer to my problem. I'm using a PBRMaterial, and an xNormal-rendered normal map in tangent space, and I've tried all kind of swizzle coordinates but they all turn out the same it seems. It looks like the normal map causes the polygon shading to not be as smooth anymore. This can't be seen at all in the normal map itself. I've also tried using a pre-triangulated mesh in Xnormal and using that mesh all the way through the pipeline from Blender to Babylon, just in case the problem would be due to the normal map being rendered on a mesh triangulated differently from the way the Babylon-export did it, leading to the normal map and the mesh being slightly incompatible, but the problem persists. I've also tried 16-bit versions... I've attached an image of what it looks like, from the left: Without normal, with normal, and with normal map and convertToFlatShadedMesh, all at the exact same camera position etc. Any clues as to what might be the problem? Has anyone successfully used normal maps in BabylonJS without these issues, and, if so, how? Cheers!
  7. Oh, my bad, sorry! Thanks for the quick answer, since it made me rule out that there was any variable frame rate thing going on. Thanks to the animation tutorial page, I found the frame event listener. I used that to measure time earlier for the opening post, but never inserted one for frame 0, just frames 30 and 60, because I assumed the animations would start immediately (and thus started the timer there), but I was wrong. In my case, there's a 500 ms gap between the beginAnimation call and the actual start of frame 0. Now I start the audio clip at frame 0 instead and everything works as expected FYI, the time measurement is correct now also, both seconds of the animation are at ~30 fps +- 0.8 or so.
  8. Hi, I have a speech animation for a character and an audio clip for this speech. When having the animation and audio start at the same time, however, there's a delay that makes the first 30 frames of the animation (it's in 30 fps, so the first second) take 1.5 s, but the next 30 frames, i.e. the next second, take around a second. So, it's clear that the frame rate is variable. To synchronize the animation with the audio, rather than doing some hack like inserting a 0.5 s delay on the animation (which likely won't work universally since I imagine this delay will vary from machine to machine and even depending on system load), I'd like to not just set a maximum frame rate as the current API allows me to, but also a minimum one, i.e. lock it to 30 fps. If the engine can't do 30 fps in one instance because of system load etc., then it should simply skip those frames, rather than slowing the entire animation down. Is there any such feature? I can't find any audio-related examples at all... Thanks!
  9. Yeah, I was aiming to use IK to make it easier to control my character's jaw (I want to define the jaw's rotation by defining its endpoint position). I'll also need to program all animation within WebGL/BJS, so I'll need to set the IK relationship and all that within BJS. I've done that now, but the thing is that the entire skeleton is affected by the IK constraint, not just the jaw. In e.g. Blender, you can set the chain length, i.e. how many levels of bones above the bone to be affected by the IK relationship, but there's nothing in the Bone or BoneIKController classes that suggests there's such a thing in BJS. In the IK demo with the "Dude", only his arm bones are affected... why is that? It's not because of the animation anyway. How can I apply the IK relation to just one bone, and not its parents? I think I'll just use the BoneLookController in this case instead, since I only want to affect the jaw bone, but it'd still be very interesting to hear if there is a chain length property (I couldn't find one though) or equivalent, or how it could be "simulated".
  10. Thanks for the response, everybody! Wingnut, there are no export options for Babylon, really. It just says "No Properties" where, for other formats, there'd be a bunch of settings specific to that format. Yeah, but that's what I'm wondering - in Dude's case, the neck is getting stretched, while in my case, the bones are just being detached and float away. What's the difference between the Dude's skeleton and mine there? In the Dude's case, isn't his head just a child of the neck, and this is supposed to mean that when you translate the head, the neck stretches as observed in the demo there? I don't think it is? In the Babylon file and the Blender file, every ith bone is a child of the i-1th bone, right (see the attached snippet from the Babylon file)? Or am I missing something? The reason that this is all an issue for me is that I want to be able to move a bone's end/tail in all directions. This is of course the same as rotating this bone, let's call it B, but I thought it would be easier to just move B's child and thus rotate it that way (the child not affecting the mesh at all). I could of course just figure out where B's end/tail is (which would be equal to where the child is) and then calculate how to rotate B accordingly... Or I guess Inverse Kinematics is really what I'm looking for. The reason that I tried to just translate the bone's children is because I'm used to how skeletons work in 3ds Max where you can rotate a bone by simply translating its children - it is restricted to keeping its scale/length and thus is forced to rotate without deforming itself. Maybe it's some built-in IK controller, really... In Blender and BabylonJS I guess I'll need to explicitly apply IK for this to work?
  11. Hi again, After having rigged in Blender I noticed that the parents of bones don't rotate accordingly. It works in this demo from the tutorial however, where translating the head makes the neck bone adjust accordingly (you can see it by enabling debugging mode and enabling the skeleton viewer): https://www.babylonjs-playground.com/#1BZJVJ#32 I just can't tell what's wrong with my skeleton. In my case, moving or rotating a parent makes its children move just like they should, but moving a child does not rotate/scale their parents like in that demo. I tried downloading that demo and using my custom Babylon.js file and so on with it, and it works like it should. However, using my skeleton/mesh instead of the Dude in the demo creates the same behavior as mentioned above (i.e. parents still don't rotate when their children move). So there must be something wrong with how I set up my skeleton in Blender, or maybe there's something wrong with the Blender exporter? Or is there, despite getting the same problem with the demo code, something in my code that I'm missing? Of course, I ahve verified that I don't get this behavior in Blender, so I suppose it has something to do with the interface between Blender and BabylonJS? I've attached a very light weight demo of it, with the code from the tutorial demo, as well as the Blender file. Thanks in advance! sample.rar skTest1.blend
  12. Just what I was looking for, thank you! Didn't come across this despite a fair share of googling.
  13. Hi, I'm learning Babylon.js at the moment and when importing skeletons and animations it would be very helpful to be able to see the bones in the browser as well. Is there any easy way to do this, or will I have to e.g. copy the bones into meshes, skin/attach the meshes to the bones and export these dummy bones with them? Cheers!