webGLmmk Posted July 28, 2016 Share Posted July 28, 2016 Can't exactly use the playground for this I dont think. I'm getting the dreaded red checkers and I really can't see what I"m doing wrong. Although in the documentation, the pictures show that its supposed to be "jpg"...the paragraph specifies .png so....jpg or png? That's just my excuse for having trouble with this. I tried both locally anyway. Its probably path related. this is the directory where my images are. https://github.com/3dwebgs/miscWebGLpages/tree/gh-pages/textures/skybox This is the file itself: https://github.com/3dwebgs/miscWebGLpages/blob/gh-pages/starfield.html // Skybox var skybox = BABYLON.Mesh.CreateBox("skyBox", 500.0, scene); var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", scene); skyboxMaterial.backFaceCulling = false; skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("textures/skybox", scene); skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE; skyboxMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0); skyboxMaterial.specularColor = new BABYLON.Color3(0, 0, 0); skyboxMaterial.disableLighting = true; skybox.material = skyboxMaterial; loaded page: http://3dwebgs.github.io/miscWebGLpages/starfield.html and yeah you DO seem to have to refresh the page to get it to load. I saw that in a previous thread somewhere....if only a star field looked like a checkerboard. Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted July 28, 2016 Share Posted July 28, 2016 Hi @webGLmmk the skybox texture needs path + name of the skyboxes, babylon only adds "_py.jpg" etc, to your path to allow several different skyboxes to be stored and easily switched between by changing the last name so atm, babylon is looking at "textures/skybox_py.jpg" all you gotta do is change skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("textures/skybox", scene); into skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("textures/skybox/skybox", scene); to get the last folder included and it should work webGLmmk 1 Quote Link to comment Share on other sites More sharing options...
webGLmmk Posted July 28, 2016 Author Share Posted July 28, 2016 50 minutes ago, aWeirdo said: Hi @webGLmmk the skybox texture needs path + name of the skyboxes, babylon only adds "_py.jpg" etc, to your path to allow several different skyboxes to be stored and easily switched between by changing the last name so atm, babylon is looking at "textures/skybox_py.jpg" all you gotta do is change skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("textures/skybox", scene); into skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("textures/skybox/skybox", scene); to get the last folder included and it should work bingo, this community is the best. 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.