Jump to content

Dynamic DDS files


Recommended Posts

Hey all,


I am trying to use a dds file as a cube texture. it works fine if i link to it in the usual way, but i am trying to instead load a file into my html5 page of which would then be turned into a cube texture as so - 

new BABYLON.CubeTexture(reader.result, scene);


i have got this working with a normal texture as so - 

new BABYLON.Texture(reader.result, scene);


so im wondering, is it the base64 encoding that is messing up the dds file? if so does anyone know a better way of doing this? 

the dds file im using is from the playground textures


many thanks!

Link to comment
Share on other sites

Can you try something like that:

new BABYLON.CubeTexture(reader.result, scene, null, false, null, null, null, BABYLON.Engine.TEXTUREFORMAT_RGBA, false, ".dds");

This will force the system to use the DDS code path

Link to comment
Share on other sites

thanks for the link it was interesting indeed however - 

I would assume seeing as the .dds file i am using is included in many of the babylon examples that its the best .dds format i could get with regards to compatability? ? 

also the .dds file does work when used "normally" but when i want to insert it dynamically, this is where my issue is. so i would then assume my problem is how I am passing the data from reader to babylon as i dont have much experience with reader


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.

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.


  • Recently Browsing   0 members

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