Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use a transparent glass object? #350

Open
4 tasks done
knightcube opened this issue Mar 23, 2021 · 1 comment
Open
4 tasks done

How to use a transparent glass object? #350

knightcube opened this issue Mar 23, 2021 · 1 comment

Comments

@knightcube
Copy link

knightcube commented Mar 23, 2021

Environment

Please provide the following information about your environment:

  1. OS: Windows
  2. Version: ViroCore version : v1.17.0
  3. Device(s): What device(s) are you are seeing the issue on (i.e. Samsung Note 8, Pixel 2 XL, etc) - Nokia 6.2

Description

I am having trouble making a 3D model of a glass transparent. The obj is getting placed but it's not transparent. How do I do that?

WhatsApp Image 2021-03-21 at 17 50 54

Here is the code that I am using to add the materials to the object👇 Am I missing something?

object3D.loadModel(mViroView.getViroContext(), Uri.parse("file:///android_asset/wine-glass.obj"), Object3D.Type.OBJ, new AsyncObject3DListener() {
            @Override
            public void onObject3DLoaded(final Object3D object, final Object3D.Type type) {
                final List<Material> materials = object3D.getMaterials();
                for (Material material : materials) {

                    material.setShadowMode(Material.ShadowMode.TRANSPARENT);
                    material.setLightingModel(Material.LightingModel.PHYSICALLY_BASED);
                    material.setTransparencyMode(Material.TransparencyMode.A_ONE);
                }
                object3D.getGeometry().setMaterials(materials);
            }

            @Override
            public void onObject3DFailed(String s) {
                Toast.makeText(ViroActivityHelloAR2.this, "Error Loading Object", Toast.LENGTH_SHORT).show();
            }
        });

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.

@knightcube
Copy link
Author

knightcube commented Mar 31, 2021

I bought an fbx model and converted it to vrx. It looks like a glass of blood rather than wine. Here is the link to the model - https://sketchfab.com/3d-models/wine-glass-07ad17d4ac40464ca276715dc12d8efa

I have access to the materials and textures but how do I apply or tune them to match the look of wine rather than blood.
Screenshot_20210330-182533

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant