gexzor Posted November 21, 2017 Share Posted November 21, 2017 Is there any way to load custom skyboxes in the playground? I am trying to get a nebula skybox to play around with, but when linking to external files I keep getting CORS errors. Hope you guys can help Quote Link to comment Share on other sites More sharing options...
Wingnut Posted November 21, 2017 Share Posted November 21, 2017 Hiya gexzor, welcome to the forum. I like using a free Github account... which you could also open/use. Models, textures, drag'n'drop from desktop into Github folders... pretty nice. Others will have ideas, too... stay tuned. PS: There is a package of about 32 skyboxes with displayer... at http://urbanproductions.com/wingy/babylon/skyboxes/skybox_tour.zip (if you might need such). It is the same as the "Skybox Tour" from BJS main website. Caution, it contains an older version of BJS. Skybox images are from http://3delyvisions.co/skf1.htm . It might be cool to give them some credits if you use one of their skyboxes for a commercial project. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 21, 2017 Share Posted November 21, 2017 If you host your content on github you can rely on cdn.rawgit.com to get a link to it that you can use in the PG Quote Link to comment Share on other sites More sharing options...
gexzor Posted November 22, 2017 Author Share Posted November 22, 2017 Thanks a lot guys. Will check it out immediately Quote Link to comment Share on other sites More sharing options...
gexzor Posted November 22, 2017 Author Share Posted November 22, 2017 Hi again I am still having the same issues with the CORS-policy. When linking to the folder containing the skybox files I get the following error: skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("https://github.com/gexzor/bjs-skybox/tree/master/skybox/nebula", scene); "Redirect from 'https://github.com/gexzor/bjs-skybox/tree/master/skybox/nebula_py.jpg' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.babylonjs-playground.com' is therefore not allowed access." What am I missing? Quote Link to comment Share on other sites More sharing options...
Raggar Posted November 22, 2017 Share Posted November 22, 2017 You have to use the "raw.githubusercontent.com" link. Click on one of your images to open it on Github. Then right-click the image and click "view image". Now you have the proper URL: https://raw.githubusercontent.com/BabylonJS/Website/master/Assets/skybox/nebula_*.jpg https://www.babylonjs-playground.com/#AJ08FD Arte 1 Quote Link to comment Share on other sites More sharing options...
gexzor Posted November 22, 2017 Author Share Posted November 22, 2017 7 minutes ago, Raggar said: You have to use the "raw.githubusercontent.com" link. Doh of course! Now it works! Thanks a lot 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.