markt5000 Posted July 25, 2016 Share Posted July 25, 2016 A long time ago I remember coming across a post that used a skydome (sphere) instead of the skybox. The sphere is much easier since only one texture has to be wrapped. Does anyone know how I can start from a hdri image and wrap it on a sphere to simulate a sky? Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted July 25, 2016 Share Posted July 25, 2016 Blender unwrapper powaa (.blend) ! Nabroski 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 25, 2016 Share Posted July 25, 2016 (edited) Simply create a sphere and apply a texture. Something like this should work: var skySphere = BABYLON.Mesh.CreateSphere("skySphere", 16, 100, scene); skySphere.isPickable = false; skySphere.position = BABYLON.Vector3.Zero(); var skySphereMaterial = new BABYLON.StandardMaterial("skySphereMaterial", scene); skySphereMaterial.backFaceCulling = false; skySphereMaterial.reflectionTexture = new BABYLON.Texture("path/yourTexture.jpg", scene); skySphereMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.PROJECTION_MODE; skySphereMaterial.diffuseColor = BABYLON.Color3.Black(); skySphereMaterial.specularColor = BABYLON.Color3.Black(); skySphere.material = skySphereMaterial; Edited July 25, 2016 by Dad72 replace EXPLICITE_MODE by BABYLON.Texture.PROJECTION_MODE Nabroski 1 Quote Link to comment Share on other sites More sharing options...
markt5000 Posted July 25, 2016 Author Share Posted July 25, 2016 @Dad72 why would coordinatesMode be set to explicit_mode as opposed to spherical mode? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted July 25, 2016 Share Posted July 25, 2016 @markt5000 Hi! I used the term 'skydome' in a couple posts in The Wingnut Chronicles, but they don't apply here. One was a "star dome" that used a particleSystem (with custom update and startPosition funcs, and two web-stolen math funcs) to place non-flying particles in a sphere-shape. No cloud texture involved there. The other skydome I mentioned... was when I "borrowed" the mesh shape used in the BJS super-demo called Assassin's Creed - Pirates. It has a strange shape, and I never tried to place a texture on it. But have at it. I doubt that the shape is copyrighted, but who knows? Check with @Deltakosh before using commercially, I'd suggest. There is SOME reason why Assassin's Creed - Pirates used that skydome mesh shape (as opposed to a classic skybox), so I thought I better steal it and experiment. Feel free to take it further. The skies in that demo.... look pretty nice. These demos (the posts they were presented-in) might be where you heard the term skydome, here on the forum. Just thought I would quench any thirsty curiosities. Now back to markt5000's question, which I don't have an answer-for. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 25, 2016 Share Posted July 25, 2016 I put it to chance. Can be: PROJECTION_MODE I'm not even sure that coordinatesMode is useful Quote Link to comment Share on other sites More sharing options...
jerome Posted July 25, 2016 Share Posted July 25, 2016 Remember there is also the icosphere that has maybe a better way to wrap the rectangular texture than the classical sphere : http://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter#icosphere Dad72 and adam 2 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.