• Content count

  • Joined

  • Last visited

About gamefan

  • Rank
    Advanced Member

Recent Profile Visitors

630 profile views
  1. Or is it? Hi again, Today I finally decided to question this error that firefox has been bugging. There is no rendering glitch or run time error. Everything runs as expected but ff spams the console with this: Error: WebGL warning: drawElements: This operation requires zeroing texture data. This is slow. Error: WebGL: No further warnings will be reported for this WebGL context. (already reported 32 warnings) I narrowed it down, seems its related to creating reflection probes. (Or may be any render target cube texture). Of what I could amass from the internets is that this occurs when an "out-of-viewport" pixel is read and rendered - This question in pixi.js subforum - but I couldn't figure where and what method is accessing out-of-viewport pixels. If this is just a browser thing, can this be safely ignored? because chrome does not log these errors. Thanks
  2. Yes, Just got lazy there ๐Ÿ˜…, but yeah its unsafe to use non public variables Yes, can have something like Mesh.prototype.isVisiblyBlocking = function(targetMesh, fastcheck, camera) fastcheck true uses bounding box, otherwise mesh vertices. Happy to make PR if need be. ๐Ÿ˜‰
  3. @Dad72 Nevertheless an interesting feature. Today is good. ๐Ÿ˜€ So if I understand it right, the engine will automatically discard meshes outside the camera frustum in the render cycle. But has to draw everything that is inside because it cannot decide before hand about the depth? We can thus use occlusion queries to disable render of a mesh hidden by an opaque mesh. This is neat, wondering why its not internally used in the engine. Perhaps because its asynchronous or slow?
  4. Great Idea. I made rays from bounding box corners to camera's position. Something like this: var boundingInfo = activeObject.getBoundingInfo().boundingBox.vectorsWorld; for (var i = 0; i < boundingInfo.length; i++) { var ray = pickingRays[i];//pre defined rays for reuse ray.origin = boundingInfo[i]; scene.activeCamera.position.subtractToRef(ray.origin, ray.direction); ray.direction.normalize(); ray.length = BABYLON.Vector3.Distance(scene.activeCamera.position, ray.origin); for (var j = 0; j < scene.activeCamera._activeMeshes.length; j++) { var mesh =[j]; if (ray.intersectsMesh(mesh, true).hit) { mesh.visibility = 0.5; } } } I never knew there was a multiPick, its there as scene.multiPick and scene.multiPickWithRay. This helped in other areas. So double thanks for the bonus ๐Ÿ˜‰ The above solution works just right, but I would love to see if there were a better/efficient solution.
  5. Hi everyone, I was wondering if there is a way to show a mesh hidden behind another mesh other than by setting its renderingGroupId. I want to always show a highlighted mesh which is being interacted by user even if its blocked by other meshes. Drawing it over everything using renderingGroupId sort of confuses depth perception. Is there a best of both worlds? Perhaps by setting some transparency to the blocking meshes, but how to get the list of meshes blocking a mesh's visibility? Thanks
  6. @JCPalmer I think I will get my hands on the doc repo.
  7. @JCPalmer Got CubeTextures to work with a small change. Interestingly they do not require y flipping.
  8. No!!!! Thank you, sir. Wow, ๐ŸคฉUncontainable happiness. Feels so nice.
  9. @JCPalmer @Deltakosh I made a PR ๐Ÿ˜Š. Fixed 1 and 2 with as little change as possible. Tested both cases, I hope this addresses the issues correctly.
  10. @JCPalmer 1.) Yes, createFromBase64String not usable while compressed Textures being enabled. I will see if I can make a PR, will be my first. ๐Ÿ˜€Exciting. 2.) Even when onload from original call is passed, onLoad is not added to the loaded observable in case of a fallback. But I am guessing allowing this is not straightforward, and could affect other cases. 3.) Will try the pvrTextTool. Actually I have the gulp task run through all my folders to make these compressed textures. This treated the cubeTextures the same way it treated other images. @Deltakosh I have 1 and 2 working with some changes (not sure if they are fool proof).
  11. Hi, Started using compressed textures in our projects. Came across three possible bugs, not sure about the last one. PG: 1 and 2 are demonstrated in the above PG. Comment line #5 to compare results when not using compressed textures. 1.) Incorrect texture returned when Engine is set to use a ktx format texture and Texture is made via Texture.CreateFromBase64String. Possibe fix: bypass textureFormatInUse when buffer is available in Engine.CreateTexture 2.) Callback passed to Texture is not fired when CreateTexture falls back to url passed on not finding its ktx counterparts. Need this to finish a "change texture" flow. Possible fix: Ignore fallback argument and create onLoadObserver in Engine.CreateTexture 3.) When engine is set to use ktx format , CubeTexture looks for one ktx file instead of 6. I don't know if the cubeTextures in ktx formats are to be composited into a single file. I use this gulp task to create compressed textures. Got a work around for 1 and 2 but 3 is beyond me. Want this to support 360 tours on low spec devices.
  12. gamefan

    Disable Render Targets and clear frame

    My head says no, but it probably is ๐Ÿ˜…. I am fine with your solution but wonder why no one else came across this? ๐Ÿค”
  13. gamefan

    Disable Render Targets and clear frame

    Man!! I was afraid of this ๐Ÿ˜…. Any chances this will be incorporated in a future release?
  14. gamefan

    Disable Render Targets and clear frame

    Reflections made by MirrorTexture and ReflectionProbe. We want something like what material.reflectionTexture = null would do. (As disabling render targets won't update the reflection texture in the next render frames) StandardMaterial.ReflectionTexturesEnabled = false is the right thing to do but I don't want to disable reflection textures that aren't using render targets. I think scene.renderTargetsEnabled should render/hide the render target texture. What affect this has now is equivalent to (an imaginary) scene.pauseRenderTargets.
  15. gamefan

    Disable Render Targets and clear frame

    Hi Deltakosh, Thank you for your reply but this is not what I want. I want the render targets textures to disappear after renderTargets optimization is done. The scene looks awkward when the render target textures just stay there at their last rendered frame. It looks awkward even for renders at intermittent frames with the use of refreshRate. I want a result similar to what "StandardMaterial.ReflectionTextureEnabled = false" does. Thanks