I use '.dds' to set skybox,but the clarity is reduced

fuzzy

In Editor,skybox is clear and normal(picture clear),I downloaded this DDS file from Editor,then I set it up as a sky box in my other project without Editor,the code is here:

var cubemapAsset = new pc.Asset('New Cubemap.dds', 'cubemap', {
            url: "../FYPlaycanvas/Cubemap/32569764/New Cubemap.dds"
        }, {
            // type: pc.TEXTURETYPE_RGBM
            // type: pc.TEXTURETYPE_SWIZZLEGGGR
            // type:pc.TEXTURETYPE_RGBE
            type: pc.TEXTURETYPE_DEFAULT,
        });
        app.assets.add(cubemapAsset);
        app.assets.load(cubemapAsset);
        cubemapAsset.ready(function () {
            app.scene.setSkybox(cubemapAsset.resources);
        });

but it become fuzzy(picture fuzzy).
I want it always clear,any suggestions?thank you!

1 Like

IIRC, if you want it to be always clear, you will need the original 6 face files. @slimbuck has been working on this recently and may be able to help further. :slight_smile:

2 Likes

Hi @fengyu,

It might just be the skybox mip level that is different. Try setting app.scene.skyboxMip to match the setting in the editor.

Thanks!

1 Like

In Playcanvas Editor,my setting is here:


I set skyboxMip as you said:
app.scene.setSkybox(cubemapAsset.resources);
app.scene.skyboxMip = 1
it is truely changed something,but just like add a layer of mist,It dose not achieve the effect we wanted,so I tried keep the properties to be same as the setting in the editor.,like this:

var cubemapAsset = new pc.Asset('New Cubemap.dds', 'cubemap', {
            url: "../FYPlaycanvas/Cubemap/32569764/New Cubemap.dds"
        }, {
        });

        app.assets.add(cubemapAsset);
        app.assets.load(cubemapAsset);
        cubemapAsset.ready(function () {
            app.scene.setSkybox(cubemapAsset.resources);
            app.scene.skyboxIntensity = 0.18
            app.scene.skyboxMip = 1;
            app.scene.toneMapping = pc.TONEMAP_FILMIC;
            app.scene.exposure = 8;
            app.scene.gammaCorrection = 2.2
            app.scene.fog = pc.FOG_NONE

            app.scene.lightmapSizeMultiplier = 16
            app.scene.lightmapMode = pc.BAKE_COLORDIR
        });

but it dose not achieve the effect we wanted too,could you help me?

Hi @fengyu,

Pls can you provide the cubemap then I can take a look? In the meantime try setting skyboxMip=0, which matches the editor value of 1.

Thanks!

sorry,I did not find a way to send a file with ‘.dds’,I can send it to you by email,or you know what other way to send it to you.
BTW, the original 6 face files to generate the DDS file are all JPG files,like this:


Does this affect the clarity of DDS files?