Kesshi

Members
  • Content count

    233
  • Joined

  • Last visited

  • Days Won

    1

Kesshi last won the day on April 20 2016

Kesshi had the most liked content!

About Kesshi

  • Rank
    Advanced Member

Recent Profile Visitors

1,303 profile views
  1. You did not devine the number of samples in your PG. I fixed it in line 64 here: https://www.babylonjs-playground.com/#HJI09Z#2 I used 16 samples.
  2. Multiply a Vector3 times a Quaternion

    Here are two versions of my "rotateVector3ToRef" function. basic version: export function rotateVector3ToRef(pV: BABYLON.Vector3, pRot: BABYLON.Quaternion, pResult: BABYLON.Vector3): void { //pResult = pRot * pV * conjugate(pRot) let tQuat = pRot.multiply(new BABYLON.Quaternion(pV.x, pV.y, pV.z, 0)); tQuat.multiplyInPlace(pRot.conjugate()); pResult.x = tQuat.x; pResult.y = tQuat.y; pResult.z = tQuat.z; } And a faster version based on this: http://blog.molecular-matters.com/2013/05/24/a-faster-quaternion-vector-multiplication/ This is the one i'm using in production. export function rotateVector3ToRef(pV: BABYLON.Vector3, pRot: BABYLON.Quaternion, pResult: BABYLON.Vector3): void { //t = 2 * cross(pRotation.xyz, pVector) //pResult = pVector + pRotation.w * t * cross(pRotation.xyz, t) let tx = 2 * (pRot.y * pV.z - pRot.z * pV.y); let ty = 2 * (pRot.z * pV.x - pRot.x * pV.z); let tz = 2 * (pRot.x * pV.y - pRot.y * pV.x); pResult.x = pV.x + pRot.w * tx + (pRot.y * tz - pRot.z * ty); pResult.y = pV.y + pRot.w * ty + (pRot.z * tx - pRot.x * tz); pResult.z = pV.z + pRot.w * tz + (pRot.x * ty - pRot.y * tx); }
  3. WebGL2 occlusion queries

    I can also reproduce it everytime in ff55. Background is always green and the sphere is invisible. WebGL 2 is available. It is working in Chrome on the same machine.
  4. Anti-aliasing problem

    I know that problem. Anti-aliasing is not working nicely for models with small rounded corners (depending on the lighting). The only way i know to solve this is super sampling (render with a higher resolution and then down sample the image). In this playground i added some post processes which realize 4x super sampling: https://www.babylonjs-playground.com/#2L35ZN#3 The only problem is that this may kill the perfomance on slow devices. The other option would be that you render multiple frames of your scene with slightly modified camera position (jittering) and combine the images. This only works if your scene is static and the camera is not moving. This is the solution i used in our product: https://box.pcon-solutions.com/ Here is also a ThreeJs example: https://threejs.org/examples/#webgl_postprocessing_taa
  5. inspector debug layer

    @Temechon I also have this issue. I posted an example some time ago already. See issue number 1 here:
  6. ok i put in on my todo list for the next days.
  7. @Deltakosh Did you had time to look at this? I could also try to create a PR if you think its ok.
  8. No. I need to be able to use different materials for each mesh.
  9. Hi, currently i have a memory issue in my app. I have a scene with many clones of some high poly meshes. So far its running fine on mobile devices but as soon as i start picking arround in the scene the memory keeps increasing until the app crashes. The reason seems to be the position array cache of the meshes. (here: https://github.com/BabylonJS/Babylon.js/blob/master/src/Mesh/babylon.mesh.ts#L1399 ) Each mesh holds its own instance of the position array. Even if all meshes share the same geometry. @Deltakosh I think this cache should be moved to the geometry class. This way the array could be shared between meshes. What do you think?
  10. IE zOffset / polygonOffset issue

    I tested it in Chrome, Firefox, Edge and IOS. There it works with and without my added line. Only in IE my added line is necessary.
  11. IE zOffset / polygonOffset issue

    It seems that IE doesn't reset the polygon offset correctly. I created a playground to demonstrate the issue: http://www.babylonjs-playground.com/#25N9HL The red plane in the PG has a zOffset. For some reason the offset is also applied to the knot under IE (see attached images). I was able to workaround this issue by modifying this code: https://github.com/BabylonJS/Babylon.js/blob/master/src/States/babylon.depthCullingState.ts#L173 I added "gl.polygonOffset(0, 0);" before "gl.disable(gl.POLYGON_OFFSET_FILL);" like this: // zOffset if (this._isZOffsetDirty) { if (this.zOffset) { gl.enable(gl.POLYGON_OFFSET_FILL); gl.polygonOffset(this.zOffset, 0); } else { gl.polygonOffset(0, 0); gl.disable(gl.POLYGON_OFFSET_FILL); } this._isZOffsetDirty = false; } How should we fix that issue? Is there a better place to add this workaround? I'm not sure if its a general IE bug. I tested it only on two systems.
  12. Hi, in this simple playground: http://www.babylonjs-playground.com/#58TGI#0 i would like that the highlight of the middle cube is rendered on top of everything. I used addExludedMesh to exclude the other two cubes. For the blue cube it works as expected: But for the red cube the result is strange: If i create cube2 before the other cubes it is working for both cases: http://www.babylonjs-playground.com/#58TGI#1 Is it somehow possible to achive this without managing the mesh order all the time? That would be very complicated in my case.
  13. This looks like a coordinate system issue to me. By default BabylonJs uses a left handed system but modeling software usally uses a right handed sytem. That means your obj is also right handed. You can try to enabled the right handed system in BabylonJs before importing the model like this: scene.useRightHandedSystem = true;
  14. No, you can just remove the AudioContext interface definition from the babylon.2.5.d.ts file here: https://github.com/BabylonJS/Babylon.js/blob/master/dist/babylon.2.5.d.ts#L501