javalang Posted August 19, 2017 Share Posted August 19, 2017 Hoping for help, I'm trying to change the skybox dynamically with following code: changeSkybox = function(imageurls) { var ctex=BABYLON.CubeTexture.CreateFromImages(imageurls,scene, true); if(scene.getMeshByName("hdrSkyBox")) { scene.getMeshByName("hdrSkyBox").dispose(); } scene.createDefaultSkybox(ctex, true, 100, 0.15); } The skybox is changing only once, independently if the imageurls are from file or from datasource. If I use BABYLON.CubeTexture.CreateFromPrefilteredData ( which I cannot use in my scenario) it works as expected. so, where is the bug? Debugging shows everything fine, no errors, caching problem? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 21, 2017 Share Posted August 21, 2017 Hello as you are using a pbr skybox, you need to use a prefilteredData. If this is not an option I suggest using false as the second parameter to use a regular standard mat for the skybox. Do not forget to also dispose the previous skybox (retruned by the createDefaultSkybox function) Quote Link to comment Share on other sites More sharing options...
TheCoolScorpio Posted November 28, 2017 Share Posted November 28, 2017 Is there any way using localfilesystem api to emmit all six cube images from local file system? Any pointer to modify loader in this case would be nice.. or does it handle uri scheme automatically? and already supported? Quote Link to comment Share on other sites More sharing options...
Sebavan Posted November 28, 2017 Share Posted November 28, 2017 The browsers do not allow that for security purpose except through filesInput or DragAnd Drop. What is your use case ? Do you not have a server? Quote Link to comment Share on other sites More sharing options...
TheCoolScorpio Posted November 29, 2017 Share Posted November 29, 2017 Use case goes as following.. We are looking to give End User generated Image to be Visible as "environment" (in normal webgl terminology) just like skybox behaves. We know End User may not generate 6 cube images. or they may. we are fine if they take only one image and we may show it as environment texture. but due to mobile first and flaky network and also due to User generated Image may involve privacy issue. we may not able to push images back to server and round trip it back. we are fine even using getUserMedia API of webRTC specs and capture image byte stream. but thing which is not clear to me is how we pass raw image bytestream to environment type texture (not to 3d object). Quote Link to comment Share on other sites More sharing options...
Sebavan Posted November 29, 2017 Share Posted November 29, 2017 I am sorry, I do not understand the question. The getUserMedia is not for using local files but to access the local device camera and won t help in your case. if your user s want to use their local assets they need to rely on file input or drag and drop/copy paste Quote Link to comment Share on other sites More sharing options...
TheCoolScorpio Posted November 30, 2017 Share Posted November 30, 2017 Ok sorry to make you confuse.. Let me help rephrase use case. we wanted local images/User generate image from client device to use as environment. so first i thought to use localfilesystem API. But after your reply i search and found that localfilesystem API is not accepted or got traction as web standard yet. so I fall back to using WebRTC route with getusermedia API and I thought let user click the photo from WebRTC and lets reuse same image stream from WebRTC to inject as material. Looks like from your reply its tricky to achieve in babylon . let me explore few more high level library . I will keep posted if i found some work around. Incase you come across any workaround please let us know.. Thanks Quote Link to comment Share on other sites More sharing options...
Sebavan Posted November 30, 2017 Share Posted November 30, 2017 ok so in this case an input of type file will do. sorry again for the confusion. 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.