viromedia / virocore

ViroCore cross-platform AR/VR renderer
MIT License
370 stars 108 forks source link

Strange background and shadow color #230

Open yjoo9317 opened 6 years ago

yjoo9317 commented 6 years ago

Environment

Please provide the following information about your environment:

  1. OS: Mac,
  2. Version: ViroCore 11.1
  3. Device(s): Pixel

Description

(*Android 5, 6 and 7 work fine.) I am using Sceneform without using Arcore and simply rendering 3d models on the view. There are strange background and shadow colors going on on Android 8 & 9. If I run straight with activity_main.xml, then it renders OK. But if I put the view in one layout and then put that layout into another layout, it renders white background color as light gray color (Android 8 & 9) and black shadow at the bottom (png texture) is being rendered in white(Android 9 only).

Reproducible Demo

Let us know how to reproduce the issue. Include a code sample, screen capture, video recording. The more information you provide, the better we can support you.

VikAdvani commented 6 years ago

Hi @yjoo9317, Try the following to see if any these fix the issue you are experiencing: 1) Upgrade your ViroCore to 1.12. We fixed some bugs related to discoloration which might also fix the issue you are seeing.

2) Make sure you disable the following on your ViroView to ensure these properties aren't causing the issue:

        mViroView.setBloomEnabled(false);
        mViroView.setPBREnabled(false);
        mViroView.setHDREnabled(false);

Let us know if any of the above work for you!

yjoo9317 commented 6 years ago

Thanks.. I quickly tried... It is worse. Now it makes the background rendered in BLACK. I disabled those properties above you mentioned.

On Fri, Nov 30, 2018 at 3:37 PM VikAdvani notifications@github.com wrote:

Hi @yjoo9317 https://github.com/yjoo9317, Try the following to see if any these fix the issue you are experiencing:

1.

Upgrade your ViroCore to 1.12. We fixed some bugs related to discoloration which might also fix the issue you are seeing. 2.

Make sure you disable the following on your ViroView to ensure these properties aren't causing the issue:

    mViroView.setBloomEnabled(false);
    mViroView.setPBREnabled(false);
    mViroView.setHDREnabled(false);

Let us know if any of the above work for you!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/viromedia/virocore/issues/230#issuecomment-443372384, or mute the thread https://github.com/notifications/unsubscribe-auth/AUCtoaYEkSY8vAWBNzAlEH3b0kGNoQW4ks5u0cFCgaJpZM4Y2fI0 .

yjoo9317 commented 5 years ago

@VikAdvani Thanks for the update. Here is my update on that issue. mViroView.setBloomEnabled(false); mViroView.setPBREnabled(false); mViroView.setHDREnabled(false); I disabled these properties with Version 1.12, and it did make the background black. Since I didn't disabled these properties before, I tried with Version 1.11 with the properties disabled. Now it works with Version 1.11, NOT with 1.12. Any idea on that? Thanks~

VikAdvani commented 5 years ago

Hi @yjoo9317, Strange that it worked with 1.11 and not 1.12. Can you provide more code detailing your scene here(lights you are using, model, etc) so we can try reproducing here?

Also, do you need to use 1.12 or does using 1.11 unblock you?

yjoo9317 commented 5 years ago

Having those properties disabled, I need to use 1.11 now. My setup here, in terms of overall layout, is too complicated to express with code snipet. Simply put, creating the viroscene and put it layout (its params are pretty much "match_parent"). That layout containing the scene will be placed into the actual mainlayout which is a linearlayout.

Inside scene, I am adding model, `model = new Object3D();

model.loadModel(view.getViroContext(), Uri.parse("file://"+pathToModel), Object3D.Type.OBJ, new AsyncObject3DListener() { @Override public void onObject3DLoaded(Object3D object3D, Object3D.Type type) { SLog.i(LOG_TAG, "3d model loaded.."); model.setPosition(new Vector(0, 0, 0)); scene.getRootNode().addChildNode(model); }

        @Override
        public void onObject3DFailed(String s) {
            SLog.i(LOG_TAG, "Failed to load 3d model");
        }

    });`

I am adding camera, `Camera camera = new Camera();

Node node = new Node(); node.setName(name); node.setCamera(camera);

scene.getRootNode().addChildNode(node); view.setPointOfView(node);`

I am adding ambient light, `if (ambientLight == null) {

ambientLight = new AmbientLight(Color.WHITE, 900.0f);
scene.getRootNode().addLight(ambientLight);

}`

Thanks.

On Mon, Dec 3, 2018 at 5:08 PM VikAdvani notifications@github.com wrote:

Hi @yjoo9317 https://github.com/yjoo9317, Strange that it worked with 1.11 and not 1.12. Can you provide more code detailing your scene here(lights you are using, model, etc) so we can try reproducing here?

Also, do you need to use 1.12 or does using 1.11 unblock you?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/viromedia/virocore/issues/230#issuecomment-443931119, or mute the thread https://github.com/notifications/unsubscribe-auth/AUCtodTAqkU82aeGo9ZZ-HUB_FQqoPydks5u1cskgaJpZM4Y2fI0 .

yjoo9317 commented 5 years ago

@VikAdvani Here are the screenshots with version 1.12.(top) and with version 1.11 (bottom) For the test purpose, I didn't load anything. Just create the view and set the view's background color as white. Ver 1.12 renders it black and Ver 1.11 renders it white. With Ver 1.12 view_with_version_1 12

With Ver 1.11 view_with_version_1 11

yjoo9317 commented 5 years ago

Here is the part of log from Viro. It shows that it'd been created with these properties on and disabled after then.

2018-12-04 10:00:01.393 1646-1889/com.yjoo I/Viro: [MRT supported: 1] 2018-12-04 10:00:01.393 1646-1889/com.yjoor I/Viro: [Shadows enabled: 1] 2018-12-04 10:00:01.393 1646-1889/com.yjoo I/Viro: [HDR supported: 1, HDR enabled: 1] 2018-12-04 10:00:01.393 1646-1889/com.yjoo I/Viro: [PBR supported: 1, PBR enabled: 1] 2018-12-04 10:00:01.393 1646-1889/com.yjoo I/Viro: [Bloom supported: 1, Bloom enabled: 0] 2018-12-04 10:00:01.402 1646-1889/com.yjoo I/Viro: No gamma correction enabled in tone-mapper 2018-12-04 10:00:01.443 1646-1889/com.yjoo I/Viro: Creating render targets with configuration: 2018-12-04 10:00:01.443 1646-1889/com.yjoo I/Viro: [MRT supported: 1] 2018-12-04 10:00:01.443 1646-1889/com.yjoo I/Viro: [Shadows enabled: 1] 2018-12-04 10:00:01.443 1646-1889/com.yjoo I/Viro: [HDR supported: 1, HDR enabled: 0] 2018-12-04 10:00:01.443 1646-1889/com.yjoo I/Viro: [PBR supported: 1, PBR enabled: 0] 2018-12-04 10:00:01.443 1646-1889/com.yjoo I/Viro: [Bloom supported: 1, Bloom enabled: 0]