Jump to content

How can I use png files in a CubeTexture


Vorion
 Share

Recommended Posts

Hi,

I tried to follow the tutorial to manually create a skybox using 6 single texture files:

https://doc.babylonjs.com/babylon101/environment#skybox

There it says I can use png files for that, but when I look in the browser console, there are just error messages saying that it can't find the skybox_px.jpg etc.

Is there a way to use png files, because jpg files can look really ugly in a skybox :). Following the link to eternal coding for the standard materials, it only mentions "jpg" files for CubeTexture.

Also there seems to be a little error in the tutorial, where it says

"In that /skybox directory, we must find 6 sky textures, one for each face of our box. Each image must be named per the corresponding face: “skybox_nx.png”, “skybox_ny.png”, “skybox_nz.png”, “skybox_px.png”, “skybox_py.png”, “skybox_pz.png”."

but before it was declared as

skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("textures/skybox", scene);

When using "textures/skybox", Babylon looks for skybox_xx.jpg files directly in the textures folder, so it's a bit misleading. Maybe just change that to "textures/skybox/skybox", than the description will be ok.

Thanks

EDIT: Sorry, posted a bit prematurely, I should have used the search on the forum a bit more, found the answer here:


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