arek3D

Members
  • Content Count

    26
  • Joined

  • Last visited


Reputation Activity

  1. Like
    arek3D reacted to bghgary in Strange reflection on .glb files on mobiles exported from Babylon JS   
    This is a FB issue. I'm not sure what we can do about that.
    The link you posted originally has both metallicFactor and roughnessFactor of 1.0 which probably explains the difference. I don't have much experience with Modo or how it exports glTF. Both GLTF2Export and 3dsMax exporter should be able to export with metallicFactor of 1 and roughnessFactor of 1 if it is configured to do so. I can help with that if needed.
    Yes, that is true. I suggested it because it sounded like you didn't want physically-based materials. If you can share your scenario, I might be able to come up with a better solution.
  2. Like
    arek3D reacted to bghgary in Strange reflection on .glb files on mobiles exported from Babylon JS   
    It'll be difficult to modify the GLB file directly as it is a packed version of a bunch of loose files (like a zip except it's not compressed). You should unpack the GLB into loose files before modifying the glTF and then repack it into a GLB. There are some tools that can do it easily. I've written one for Windows if you're on that platform. If not on Windows, you can use glTF Tools for vscode or something similar.
  3. Like
    arek3D reacted to bghgary in Strange reflection on .glb files on mobiles exported from Babylon JS   
    Because glTF uses PBR (physically based rendering) for materials, a pure black or white material with no reflections does not really fit as they don't exist in the real world. The Modo one that you linked above also has reflections when loaded in Babylon sandbox. The inconsistencies between renderers is something the glTF working group is actively working to fix. I'm not sure why you want a material with no reflections, but I think it might be better to use the unlit extension. Facebook supports the unlit extension as does Babylon's glTF loader. There are not a lot of exporters that create glTF with unlit yet, but it's easy to add the unlit extension manually to the glTF file. I'm not sure if that will work for you scenario.
    Here is one that I modified from the glTF box exported from the playground you sent.
    scene.glb
  4. Like
    arek3D reacted to Deltakosh in Should simplify() method work with custom mesh?   
    it should work but your mesh is really simple already and furthermore there is no common vertex (all faces have independant vertex) which is not ideal for the simplifier
  5. Like
    arek3D reacted to Deltakosh in Should simplify() method work with custom mesh?   
    well, you would have to go through the vertices and find the ones that share the same positions and normals (and then update the indices to point to only one of them)
  6. Like
    arek3D reacted to JohnK in Should simplify() method work with custom mesh?   
    See if this helps http://doc.babylonjs.com/snippets/minimise_vertices
  7. Like
    arek3D reacted to Deltakosh in Babylon exporter 0.40.0 does not work with 3ds Max 2016   
    OK let's track it here:
    https://github.com/BabylonJS/Exporters/issues/115
  8. Like
    arek3D got a reaction from Deltakosh in DynamicTexture on mesh from .babylon file causes a problem.   
    Thank you @Wingnut for your workaround!! I wrote proper UV values for my meshes and it works!
    In my free time, I will try to fix that issue with the newest exporter, which I had and I will test this strange UV behavior once again. Or maybe I should change 3ds max to 2017 version
  9. Like
    arek3D got a reaction from Wingnut in DynamicTexture on mesh from .babylon file causes a problem.   
    Thank you @Wingnut for your workaround!! I wrote proper UV values for my meshes and it works!
    In my free time, I will try to fix that issue with the newest exporter, which I had and I will test this strange UV behavior once again. Or maybe I should change 3ds max to 2017 version
  10. Like
    arek3D reacted to Wingnut in DynamicTexture on mesh from .babylon file causes a problem.   
    Hi again, good troublehshooting/research, Arek! 
    I've been doing some testing:
    http://www.babylonjs-playground.com/#1CMD3G#40
    According to console, the imported plane UVs is a Float32Array [ 0, 1,   1, 1,   1, 2,   1, 2,   0, 2,   0, 1]    (two 3-point triangular facets)
    I don't think I have ever seen a UV array with 2's in it.  As far as I know, all UVs, should be 0 to 1 inclusive, and never higher than 1.  hmm.
    I created my own UVs (uvs3) in line 45, and poked it into the plane in line 46.  Then I re-query the UV data from the plane, and send it to console.  Notice it is NOT a Float32Array, but perhaps that is only because I didn't "cast" uvs3 as such.  Not sure if I CAN force a standard array... to be Float32Array.  (see update below)
    But, plane started showing the draw-text. I'll be darned.  Quite strange indeed, Arek.  Perhaps @Deltakosh (or others nearby) will be able to understand this.  I'm kind of baffled.
    Possibly, there is a problem with the 3dMax exporter, but I speculate incorrectly quite often.  I'll keep thinking and perhaps do more tests.  Others will have ideas... I know it.  We have a HUGE PILE of smart people nearby, including you, Arek!  You made a very interesting "find".  Well done.  Puzzling.
    Update:  Oh duh, Wingnut.  There's a new Float32Array right there in line 33.  (I borrowed that code from another forum post).  I should learn to pay attention to life, huh?    Thx to @JCPalmer for the Float32Array and convert-to-updatable info.  mesh.setUpdatable(true) would be "nicer", huh? 
  11. Like
    arek3D reacted to gryff in DynamicTexture on mesh from .babylon file causes a problem.   
    @Wingnut and @arek3D Here is an PG example using Wingy's code from above but using a plane created in/exported from Blender
    Plane and text
    Looks fine. It prints out the UVs in the console, but they are : "uvs":[1,0,1,1,0,1,0,0]  (from the .babylon file)
    Hope that helps in some way.
    cheers, gryff   
  12. Like
    arek3D got a reaction from Wingnut in DynamicTexture on mesh from .babylon file causes a problem.   
    I think UV channel is correct in my mesh (this is default plane from 3ds max 2016. So UV must be correct.
    Moreover, I made a PG which prove that UV is incorrect only if I use DynamicTexture (in this example textures are swapped in the loop every 60 frames)
    http://www.babylonjs-playground.com/#1CMD3G#39


     
    This is quite strange, isn't it?
  13. Like
    arek3D reacted to Wingnut in DynamicTexture on mesh from .babylon file causes a problem.   
    Hi guys!  @arek3D, I got a playground rolling for you, and am doing some dynamicTexture tests.
    I am getting same results as you so far.  Could be my mistake, though.
    http://www.babylonjs-playground.com/#1CMD3G#32
    No SceneLoader.Append in this one... I use ImportMesh instead, for this demo. 
    As you can see, a second plane... created within the scene... is rendering the drawText fine.
    SO... it is my opinion... that your imported plane has no UVs set.  I am also having troubles scaling it (line 13).  The in-scene-made plane scales correctly in line 19.  hmm.  The imported plane has a different axes-orientation or something. 
    There may be options in your modeling software for "generate UVs", or ways to "include UVs" during the export.  I don't work with modelers very often - sorry.  You COULD even set the UV's yourself, with JS, in the scene (by setting 4-8 Vector2 values on the mesh's vertexData object).  We'll talk about that later.
    First, check your modeler and perhaps view the .babylon file with wordpad or online JSON viewer... see if there is UVS data in there, or only vertices and indices.
    Keep us posted.  You should be able to use that playground above... for testing.  Make more saves, bookmark the url after each save, etc.  Have fun, you cannot damage anything in the playground... no matter how much you try.  Good luck.
  14. Like
    arek3D reacted to Deltakosh in [SOLVED] How to display an object only on a different object   
    Yep this is because the stencil parameter is for the GL context so it can only be set when creating the engine
  15. Like
    arek3D reacted to Deltakosh in [SOLVED] How to display an object only on a different object   
    Hello I think this is because you need to turn on stencil buffer (off by default) with this line:
    engine = new BABYLON.Engine(canvas, true, {preserveDrawingBuffer: true, stencil: true});
  16. Like
    arek3D got a reaction from babaorhum in Action depending on camera zoom   
    Hello, I think the simplest way is to make a condition with camera.radius and a flag (to check is it before explosion) in registerBeforeRender() function:

    http://www.babylonjs-playground.com/#2DF4PZ#1
  17. Like
    arek3D got a reaction from Deltakosh in [SOLVED] How to display an object only on a different object   
    This is exactly what I wanted to achieve.
    You are a God here. No doubt.
    Thank you sooo much!!
  18. Like
    arek3D reacted to Deltakosh in [SOLVED] How to display an object only on a different object   
    Something like that?
    http://www.babylonjs-playground.com/#2L76JS#2
    The basic idea is to render the cube with stencil buffer on: it will write the value of 1 on every convered pixel. Then we render the plane ONLY if pixel contains 1 in the stencil value
  19. Like
    arek3D got a reaction from Wingnut in Loading progress for import mesh while AssetsManager is used.   
    I was thinking about that solution before, but I have one big file and only few small textures, so it wouldn't look rightly I think. So I see two ways:
    1) make fake loading progress using setInterval() and variable with logarithmic increase.
    2) Change AssetManager to SceneLoader.
    Thank you very much @Wingnut and @Deltakosh!
  20. Like
    arek3D reacted to Deltakosh in How to improve anti-aliasing?   
    Hello
    unfortunately in the world of webGL there is no control over canvas antialiasing
    Can you share your sample on the playground?
  21. Like
    arek3D reacted to Deltakosh in Loading progress for import mesh while AssetsManager is used.   
    Hello
    I like Wingnut's idea. It is the simplest thing to do. 
    For byte-based progress, it is tough because depending on the server, you not always have the information about total bytes to load.
  22. Like
    arek3D reacted to Wingnut in Loading progress for import mesh while AssetsManager is used.   
    Hi arek3d, welcome to the forum.  Let's ping mister @Temechon and see if he'll offer advice. 
    https://github.com/BabylonJS/Babylon.js/blob/master/src/Tools/babylon.assetsManager.ts#L314
    I see no mention in here... about "progress", so, I don't think the DefaultLoadingScreen has a progress feature available.  But I'm no expert.
    You COULD build your own loading screen, and tell users how many assetsManager tasks still remain unfinished (by counting-down a global number... with each task.onSuccess() callback.)
    Each task's onSuccess function... updates the "count-down" on your custom loading screen.  *shrug*.  It's not byte-based progress.  It's "How many assetsManager tasks still remain". 
    Just an idea.  Likely not a very good one.  Hopefully, others will comment.