Raitch Posted June 15, 2017 Share Posted June 15, 2017 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? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 15, 2017 Share Posted June 15, 2017 He is back: http://www.babylonjs-playground.com/#8HXI0G#1 You have to use known matrices names to have them filled automatically (https://www.eternalcoding.com/?p=113) Raitch 1 Quote Link to comment Share on other sites More sharing options...
Raitch Posted June 16, 2017 Author Share Posted June 16, 2017 Thanks! Quote Link to comment Share on other sites More sharing options...
Raitch Posted June 16, 2017 Author Share Posted June 16, 2017 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! GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.