sceneform-android icon indicating copy to clipboard operation
sceneform-android copied to clipboard

Colors are not correct

Open zewillze opened this issue 3 years ago • 6 comments

Hi, we have met a problem about the color. We get gltf file exported from Blender. But when we try to show the model in Sceneform with Android, we found that the color are not correct. Would you give us some advise ? Thanks a lot.

WX20220519-233059@2x WX20220519-233109@2x )

zewillze avatar May 19 '22 15:05 zewillze

What version of Sceneform are you using?

ThomasGorisse avatar May 19 '22 15:05 ThomasGorisse

we have used both 1.20.0 and 1.20.4. thanks.

zewillze avatar May 19 '22 15:05 zewillze

We try to load texture like:

` private Texture loadTexture(String texturePath) { Bitmap bitmap; try { bitmap = BitmapFactory.decodeStream(this.getBaseContext().getAssets().open(texturePath)); } catch (Exception e) { return null; }

    Engine engine = EngineInstance.getEngine().getFilamentEngine();
    Texture texture = new Texture.Builder()
            .width(bitmap.getWidth())
            .height(bitmap.getHeight())
            .sampler(Texture.Sampler.SAMPLER_2D)
            .format(Texture.InternalFormat.SRGB8_A8)
            .levels(0xff)
            .build(engine);
    TextureHelper.setBitmap(engine, texture, 0, bitmap);
    texture.generateMipmaps(engine);
    return texture;
}`

then set to material like:

`Texture texture = loadTexture("chair_fabric_albedo.png"); TextureSampler textureSampler = new TextureSampler();

        material.setParameter("baseColorMap", texture, textureSampler);
        material.getMaterial().isColorWriteEnabled();`

zewillze avatar May 19 '22 16:05 zewillze

See #163

ThomasGorisse avatar May 19 '22 18:05 ThomasGorisse

See #163

Still not work after trying these codes :(

zewillze avatar May 20 '22 01:05 zewillze

we are think if it relate to this: material.baseColor.rgb = inverseTonemap(material.baseColor.rgb) but we can not find a way to set it when we are using gltf file do you have any idea ?

zewillze avatar May 20 '22 12:05 zewillze

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Aug 11 '23 05:08 github-actions[bot]

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

github-actions[bot] avatar Aug 19 '23 05:08 github-actions[bot]