Raitch

Members
  • Content Count

    91
  • Joined

  • Last visited

About Raitch

  • Rank
    Advanced Member

Recent Profile Visitors

660 profile views
  1. Raitch

    Making sense of dxt.ktx files

    Okay so according to the page I need BCx Names but my Linux installation couldn't do them. Tried on my windows version and had success, so I guess it's solved though I'd prefer to only work on my linux computer.
  2. So I'm trying to make sense of this page (https://doc.babylonjs.com/resources/multi-platform_compressed_textures) and generate dxt files for my windows computer. Have been trying a bunch of things in the PVRTexTool with different encodings but none seems to be working in Babylon.js. Currently I get the errors: "only compressed formats currently supported" (which I've tried compressed format) and "WebGL warning: compressedTexImage2D: Invalid internalFormat 0x84bf56a2". Trying to figure out which one of these encodings that _might_ work is a mess. Have tried the ones under the compressed category with no dice. Anyone that has knowledge on how to make this work?
  3. Okay so apparently I only have this issue on my Windows 10 computer and not on by Windows 7 computer when testing around. Not really sure why that's the case.
  4. Hello, I've been for a long time making an overlay meant for OBS streams. Before I started working too much on it I confirmed that Babylon worked in OBS. However I only tested in Ubuntu/Linux OBS and it works perfectly, but found out the hard way today that I can't really get it to work for Windows OBS. Have been googling quite a bit trying to find a solution and here's what I've come up with: Both Linux and Windows OBS uses CEF. However due to some inconsistencies in Windows, they seem to differ and have GPU disabled by default I run OBS with gpu enabled I visited HTML5Test through OBS and confirmed that both WebGL and WebGL 2 were checked Yes But when trying to simply run Playground with OBS I get "Your browser does not support WebGL" error and no 3D is shown And this is basically where I'm stuck. I'm not sure if there's some other core feature missing that HTML5Test/me am missing to run babylon.js. Has anyone had similar problems before with CEF or just know what more Babylon.js requires apart from WebGL to be run? All clues are helpful at the moment. Cheers!
  5. I've been googling around for a week trying to find the answer without much success. I basically have a blender file which I try to export with animation to Babylon.js. First I made the mesh animate in Blender which doesn't work since I use need skeletons to animate. Then I created an armature with a bone and redid all the animations. Now I binded the object/mesh to the bone and the animation looks well and all in Blender. Even when I export the .babylon file I see the `skeletons: []` being defined in the file. But upon importing there are no skeletons included. The connection between the mesh and skeleton is through "childOf: skeleton" which might not be ideal. However the only other solution I've found that might work is putting bones everywhere with automated weight and hope that all meshes gets moved in the animation; which they don't. I've also done Bake Action prior to exporting. I simply wish to get the animation from Blender into Babylon.js. There might be something obvious I'm missing so help is appreciated. controller.babylon controller.log
  6. Your solutions worked perfectly! thanks a bunch
  7. I've been trying to find a way to remove a specific color and make it alpha after scene.render(); however I've been out of luck. The reason I want to is to basically have a ugly green color changed to alpha so that I can have something behind the canvas visible. I tried doing something like this, but I have no idea what works and doesn't let framebuffer = this._gl.createFramebuffer(), texture = this._gl.createTexture(); this._gl.activeTexture(this._gl.TEXTURE0); this._gl.bindFramebuffer(this._gl.FRAMEBUFFER, framebuffer); this._gl.framebufferTexture2D(this._gl.FRAMEBUFFER, this._gl.COLOR_ATTACHMENT0, this._gl.TEXTURE_2D, texture, 0); if (this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER) == this._gl.FRAMEBUFFER_COMPLETE) { let pixels = new Uint8Array(this._gl.drawingBufferWidth * this._gl.drawingBufferHeight * 4); this._gl.readPixels(0, 0, this._gl.drawingBufferWidth, this._gl.drawingBufferHeight, this._gl.RGBA, this._gl.UNSIGNED_BYTE, pixels); for (let i = 0; i < pixels.length; i += 4) { let red = pixels[i], green = pixels[i + 1], blue = pixels[i + 2]; if (red == 0 && green == 0 && blue == 2) { pixels[i + 3] = 0; } } this._gl.bindTexture(this._gl.TEXTURE_2D, texture); this._gl.texImage2D(this._gl.TEXTURE_2D, 0, this._gl.RGBA, this._gl.RGBA, this._gl.UNSIGNED_BYTE, pixels); } this._gl.deleteFramebuffer(framebuffer); Looking around in the post process part of Babylon.js I can't really find anything similar there either. Another solution would be if it was possible to have a texture that "true" transparent in the way that it removes everything behind it as well. Anyone with any ideas?
  8. If you don't mind, do you know how I achieve this in Babylon? (https://github.com/spite/THREE.CubemapToEquirectangular/blob/master/src/CubemapToEquirectangular.js) this.quad.scale.set( this.width, this.height, 1 ); this.camera.left = this.width / - 2; this.camera.right = this.width / 2; this.camera.top = this.height / 2; this.camera.bottom = this.height / - 2; I thought setting: (http://www.babylonjs-playground.com/#8HXI0G%231) plane.scaling.x = canvas.width; plane.scaling.y = canvas.height; camera.orthoLeft = (canvas.width / - 2); camera.orthoRight = (canvas.width / 2); camera.orthoTop = (canvas.height / 2); camera.orthoBottom = (canvas.height / - 2); Would do it, but it doesn't seem to "zoom out". Is there perhaps some other nice way to make a plane cover the entire camera? Am considering to use Canvas2D but I doubt ShaderMaterial works well with it since it's a material and not texture. Nevermind; apparently `camera.mode = BABYLON.Camera.ORTHOGRAPHIC_CAMERA;` is a thing!
  9. So I'm trying to recreate this panoramic view generator from Three.js (https://github.com/spite/THREE.CubemapToEquirectangular/blob/master/src/CubemapToEquirectangular.js) that can generate a 360 view from the point. With everything I've read up on, I've so far managed to recreate most parts here: http://www.babylonjs-playground.com/#8HXI0G However applying the ShaderMaterial to my plane, it simply disappears (commenting `plane.material = myShaderMaterial` brings it back). There are *very* many reasons I can imagine to be the cause but I can't think of many ways to troubleshoot it. It uses the same vector and shader code as the Three.js one at least so I guess that shouldn't be the issue. Does anyone have a clue on where I could go from here to reach the next step on my ShaderMaterial?
  10. Raitch

    CubeCamera in Babylon

    Nice! That looks exactly like what I'm after hope I can get it to work without too much lag
  11. Raitch

    CubeCamera in Babylon

    I think we're working from 2 different ends here. I want to generate Cube Maps, not use existing.
  12. I'm trying to recreate this panoramic code (https://github.com/spite/THREE.CubemapToEquirectangular/blob/master/src/CubemapToEquirectangular.js) from Three.js into Babylon.js. Most stuff here it looks like I can replicate, like ShaderMaterial for instance. The thing I however can't wrap my head around fully is how to get the CubeCamera from Three.js to work in Babylon.js. According to the documentation (https://threejs.org/docs/#api/cameras/CubeCamera) it seems to create 6 cameras and put them in a cube map: I'm not fully sure how to best do the same thing in Babylon.js. The idea I guess is to have 6 cameras from the same point that each capture the same square, then place all of them on one texture. However I want to do this rendering each frame so I guess that's not really viable to do. Another idea I have is to use 2 canvases where one uses 6 mulitviews (https://doc.babylonjs.com/tutorials/how_to_use_multi-views) and the other canvas takes that image as a texture. Does anyone have a better idea, or know if my idea sounds unviable? Having 6 cameras run at the same time sounds potentially like a bad idea for me. If nothing else I can give it a try, but it's a lot of testing work I could avoid in case someone else have more insight than me on the subject. I really like Babylon.js and I hope I can solve this without Three.js
  13. I found the example I was looking for now: https://stackoverflow.com/questions/38896297/how-to-get-2d-snapshot-like-panoramic-of-whole-3d-three-js-scene Cool to know that it's possible at least now I will see if I can make it work in Babylon. Looking in to it, they seem to create and scale a mesh with some shader material to achieve this: https://github.com/spite/THREE.CubemapToEquirectangular/blob/master/build/CubemapToEquirectangular.js I haven't worked much with reflections etc, is there someone who could point me into the right direction?
  14. You mean to have the camera have a reflection object infront of it that might distort reflect the view for desired effect? I guess I would have to have at least 4 multi cams for that effect as well. Or did you have something else in mind?