hcmetal

Members
  • Content Count

    45
  • Joined

  • Last visited

About hcmetal

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. @Sebavan, thanks for your help! This idea seems very promising. Will try it out.
  2. hcmetal

    How to occlude glow effect

    Welcome! I have the same 'Damn, so close...' feeling all the time. Sometimes as I am typing up a question to submit on the forum or making a PG, I suddenly figure out how to solve the problem myself.
  3. hcmetal

    How to occlude glow effect

    @Myjestic, As shown in PG: https://playground.babylonjs.com/#QLBNSV#2 1. Include sphere1 in the glow layer, and set its material's emmissiveColor to black. Then sphere1 will occlude sphere2's glow effect. If you want both spheres to glow, consider setting their emmissiveColor to different colors or intensities. Don't over-blow the exposure so you can see the "occluded" effect. PG: https://playground.babylonjs.com/#QLBNSV#3 2. You can use the sphere materials' emmissiveColor to control the glow color, or use "gl.customEmissiveColorSelector" on the glow layer. Doc: https://doc.babylonjs.com/how_to/glow_layer#controlling-glow-color-per-mesh Hope this solves your problems. Please let me know if there are any further questions. Cheers!
  4. Hello everyone, Consider using a meshTask to load a .babylon file with the assetsManager: assetsManager.addMeshTask("load meshes", "", "/assets/", "hotel.babylon"); When the meshes are loaded, the textures related with the scene are also automatically loaded. Notice no textureTasks have been manually added. However, when counting the tasks with: assetsManager.onProgress = function(remainingCount, totalCount) { // ... counting logic ... }; Only one task (the meshTask) is been counted. I am trying to figure out how to make the assetsManager manage (count) the texture loading associated with the .babylon scene. Do I have to manually add textureTasks on every texture? This seems like a bad idea, doing the same thing twice. Hope someone can point me to the right direction. Thanks alot!
  5. @Deltakosh, thanks for your help. I have experimented with some combinations of options and here are the results: Since we are scrutinizing the pixel details it might not be easy to spot the difference from the image above because it is heavily optimized and downgraded by the forum automatically.Please check the attached file for a clearer image. And please notice we might be looking at these screenshots on a common HD monitor. It is very obvious on a high dpi device (like retina screen) that lowering hardwareScalingLevel leads to the best quality, as shown on the right. However the fps is terrible because mobile device cannot handle the rendering. Setting the renderScale to a higher value actually results in poor antialiazing and reduce the quality of the GUI, as shown in the middle. In all three cases the px sizes (including font size) of the icons and texts are adjusted accordingly to maintain the same proportional size on the screen. Is it possible to have the GUI rendering quality similar to the third (right) screenshot, while keeping a lower resolution rendering of the 3D assets, so both quality and performance can be achieved? Edit: Link to the original screenshot: https://github.com/hcmetal/misc/blob/master/gui-resolution.jpg
  6. Hello everyone, This might be a common question but I am having a bit trouble figuring it out. On mobile devices babylon scene content are rendered on relatively lower resolutions, as the hardware has limited capabilities this is expected and acceptable. However, I am wondering if it is possible to make the GUI layer render at a higher resolution, similar to "engine.setHardwareScalingLevel(number < 1.0)"? Obviously, setting a lower scaling level on everything (GUI and 3D scene content) is not a viable option since mobile device cannot handle the rendering task. So is it possible to make just the GUI render at a lower hardware scaling level and leave the other contents as they are? Or maybe there is some other way to make the GUI look "sharper" (render at a higher resolution and utilize the high dpi display on mobile devices) and I am just not reading the docs carefully enough? Hope someone can point me to the right direction. Thanks alot! Edit: I am trying to use advancedTexture.renderScale = 2.0 But it is not making the GUI appear sharper, just smaller... Anyway, I might not be using this right.
  7. Thanks for your help! I wondered what "rotation quaternion" is all about when reading the doc on rotation. This clears things up for me.
  8. Hello everyone, I am wondering if the "mesh.roation" attribute work differently on built-in mesh and imported mesh? As shown in this PG: https://playground.babylonjs.com/#WQGZB5 As I set the same rotation attribute: scene.registerBeforeRender(function() { rotationtest.rotation.y = 0.02; box.rotation.y = 0.02; }); The imported mesh rotates with a constant speed while the built-in box stays put. It apears as if the imported mesh rotates incrementally by local axis and the built-in box rotates by directly setting the rotation vector. What's happening under the hood? Can I make the imported mesh rotate like the built-in mesh (which makes much more sense to me)? Hope someone can point me to the right direction. Thanks alot!
  9. @kcoley, just tried it out. It is working great, thanks!
  10. @kcoley, thanks for making it clear. I am wondering, assetsManager aside, is there a more "wholesome" way to cover all the various loading scenarios? For example, we need to load multiple .babylon files and additional texture files (not included in the .babylon files but later used in the scene, such as ao and lightmaps). Is creating tasks for every single asset and counting the number of tasks the best we can do, or with some combination of techniques, a more idea way of calculating loading progress can be achieved. By "idea" I mean evaluate loaded file size and show progress based on it. (for the sake of convenience let's suppose the total file size is known before hand) From the users' perspective, most of the loading time is spent on networking (downloading various files from a remote-server). Maybe this is an issue beyond Babylon and should be solved with some network magic (code) ?
  11. Hello, everyone, I am trying to make a custom loading screen without using the built-in loading UI. So I set up an assetsManager: const assetsManager = new BABYLON.AssetsManager(scene); assetsManager.useDefaultLoadingScreen = false; const meshTask = assetsManager.addMeshTask( "load meshes", "", "/assets/", "hotel.babylon" ); and try to use: assetsManager.onProgress = function(remainingCount, totalCount) { // Some calculation logic and sent the result to other UI components... }; It works but there are two problems: 1. The counting does not take the texture (related to the exported materials in the .babylon file) loading into consideration, so the loading process is not fully covered. Do I need to set up textureTask for every single texture and re-assign them to the respective materials? I cannot wrap my mind around it... The built-in loading UI seems to take texture loading into account and disappears after all the textures are loaded. 2. The counting is based on file number rather than file size. I know in SceneLoader call back function there is an eval object that can calculate file size. Is it possible to do something similar with assetsManager? Hope someone can point me to the right direction. Thanks alot!
  12. @kcoley, thanks! Looking forward to it. or now I just write some code to set the appropriate transparencyMode for each material once they are loaded into the scene.
  13. hcmetal

    How to occlude glow effect

    Ah, silly me. It is unnecessary to use addIncludedOnlyMesh method in this particular case. The glow layer only affects emmisive materials.
  14. Hello everyone, I am trying to find a way to properly occlude the glow effect. Consider: from the other side: The glow effects are not occluded by the walls and other opaque objects. Related code: const lamps = scene.getMeshByName("hotel_lower_lamp"); const glow = new BABYLON.GlowLayer("glow", scene); glow.addIncludedOnlyMesh(lamps); Just to be sure, I have also set opaque materials: material.transparencyMode = 0; Hope someone can point me to the right direction. Thanks alot!
  15. @Deltakosh, thanks a lot for the tip. Seperating the leaves from the stems and setting different material attributes has given me the best of two worlds.