Can't import dds, jpg, env nor hdr Ubuntu 16.04 (babylon 4.2.0)

Hi, I can’t import files using babylon. I have read that there is an issue with reading dds files in linux using nvidia. I tried to read a jpg by copying an example but it is not reading it. The following example is not working for me, but If I put the url pointing to https://raw.githubusercontent.com/BabylonJS/Babylon.js/master/Playground/textures/360photo.jpg it works. Anybody has any idea what is happening?

var scene = new BABYLON.Scene(engine);
var camera = new BABYLON.ArcRotateCamera("Camera", -Math.PI / 2,  Math.PI / 2, 5, BABYLON.Vector3.Zero(), scene);
camera.attachControl(canvas, true);
camera.inputs.attached.mousewheel.detachControl(canvas);

var dome = new BABYLON.PhotoDome(
    "testdome",
    "./textures/360photo.jpg", (I made sure I had the file)
    {
        resolution: 32,
        size: 1000
    },
    scene
);

for jpg it doesn’t say anything
for env it says “not an env file”
for dds Invalid magic number in DDS header
for hdr Bad HDR Format.

My bad, It wasn’t reading files because I was using react: The code should have been as follows:

var scene = new BABYLON.Scene(engine);
var camera = new BABYLON.ArcRotateCamera("Camera", -Math.PI / 2,  Math.PI / 2, 5, BABYLON.Vector3.Zero(), scene);
camera.attachControl(canvas, true);
camera.inputs.attached.mousewheel.detachControl(canvas);
import image from './textures/360photo.jpg';

var dome = new BABYLON.PhotoDome(
    "testdome",
    image, 
    {
        resolution: 32,
        size: 1000
    },
    scene
);
2 Likes