Jump to content

Textured skydome


markt5000
 Share

Recommended Posts

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?

 

hdri_sky_037.jpg

Link to comment
Share on other sites

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 by Dad72
replace EXPLICITE_MODE  by BABYLON.Texture.PROJECTION_MODE
Link to comment
Share on other sites

@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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...