Closed jacobvyn closed 6 years ago
Hi, jacobwyn- So I took a look at the R8 model and the BB8 model and this is what I found: R8 -This model is not made for real-time use. It's over 700k polys and for rendering only. This would not be efficient or work well on any platform. -There are no faces modeled in the undercarriage or interior of the car. That's why you're seeing null faces. -There are no textures assigned to the car. The ones that are included aren't being assigned and wouldn't be useful anyway. It seems the creator forgot to do this before making it public. -The reason why the car appears flat/white is you need to create scene lights. Ambient plus some directional light.
BB8 -The model does not have any of the included textures assigned to the model properly -I tried to manually assign the textures to the model but upon closer inspection of the UV's, it seems the creator uploaded some old version or a version that is not mapped to the textures correctly.
I suggest finding quality models on sites like turbosquid and following my guide here: https://blog.viromedia.com/https-blog-viromedia-com-asset-pipeline-optimizing-3d-models-ar-vr-arkit-arcore-d0fb61627aaf
I have the same problem also the default rotation is not proper.:
The fbx file I used is this: https://www.turbosquid.com/3d-models/imola-bo-concept-3ds-free/572435
Can you please check and let me know what is the problem?
Thanks
Hi, you actually successfully imported the model. I checked the chair and it does not have any textures assigned to it. If you notice, all the objects in your scene look flat. It is simply using colored shaders, so it is rendering correctly. You need to include some scene lights as well: https://docs.viromedia.com/docs/3d-scene-lighting. Try adding in some directional lights and you'll start to see some more value on the surfaces.
Apologies, if using Virocore, reference this for lighting: https://virocore.viromedia.com/docs/3d-scene-lighting
Thanks for the response. I have few queries regarding this issue
`@Override public void onRendererStart() {
mScene = new ARScene();
//add a listener to the scene so we can update 'AR Init' text.
mScene.setListener(new ARSceneListener(this, mViroView));
//add a light to the scene so our models can show up.
mScene.getRootNode().addLight(new AmbientLight(Color.WHITE, 1000f));
mViroView.setScene(mScene);
View.inflate(this, R.layout.viro_view_ar_hit_test_hud, ((ViewGroup) mViroView));
}`
Should I add some extra lights?
Thanks again.
Hi @saboteur111, thanks for response. I have conducted an experiment, made simple model of 2 spheres in Blender, then converted to fbx and vrx, and after I have tried to render it I got only message that geometry is null...I am always facing this issue with very simple model... I suspect something is going wrong while converting to vrx... Spheres model is attached balls.fbx.zip
@geetves yes, try adding a directional light also to your scene point down at the object -> https://virocore.viromedia.com/docs/3d-scene-lighting
If you are still having issues let us know
@jacobwyn thanks for the additional info. We will take a look at the models and see what the issue is.
spheres.fbx.zip Hi @jacobwyn , I checked over the spheres in Maya and they seem fine other than they are very large in scale. It seems Blender has been causing issues w/ their FBX exporter. I re-exported them as fbx. Try converting them to vrx again and see if you get the same error.
One more thing @jacobwyn, trying adding a directional light to your scene. Have the spheres positioned in front of you (you will need to scale them down a bit as mentioned above). Position the directional light at the camera origin [0,0,0] and set direction of the light pointing forward [0,0,-1]. This will illuminate the object from the view of the device.
Hi guys, thanks for the response. I have exported new spheres model to vrx and geometry is not null now but materials are null (didn't you delet it befor export to fbx?), but I do not see any sphere on the screen, I set scale, light and material
AmbientLight ambientLight = new AmbientLight();
ambientLight.setColor(Color.WHITE);
ambientLight.setIntensity(1000);
mArScene.getRootNode().addLight(ambientLight);
Object3D model = new Object3D();
Vector carPosition = new Vector(0, 0, -1);
model.setPosition(carPosition);
model.setScale(new Vector(5, 5, 5));
model.loadModel(getUri("spheres_viro.vrx"), Object3D.Type.OBJ, new AsyncObject3DListener() {
@Override
public void onObject3DLoaded(final Object3D object3D, Object3D.Type type) {
Log.e(LOG_TAG, "geometry " + object3D.getGeometry());
Material material = new Material();
Bitmap bitmap = Helper.getBitmapFromAsset(ViroARActivity.this, "steel.jpeg");
Texture steelTexture = new Texture(bitmap, Texture.Format.RGBA8, true, true);
material.setSpecularTexture(steelTexture);
material.setDiffuseColor(Color.BLUE);
material.setLightingModel(Material.LightingModel.PHYSICALLY_BASED);
object3D.getGeometry().setMaterials(Arrays.asList(material));
mArScene.getRootNode().addChildNode(object3D);
}
@Override
public void onObject3DFailed(String s) {
Log.e(LOG_TAG, s);
}
});
and have played with it in difference variations, I didn't manage to see spheres. By the way is it good practice to change material for VRX models?
I have check it with more advanced light with 3 sources of Spotlight and different colours - nothing.
There is the same issue with these simple model: https://www.turbosquid.com/3d-models/free-wine-glass-3d-model/768744 https://www.turbosquid.com/3d-models/free-legendary-soviet-table-glass-3d-model/825305 https://www.turbosquid.com/3d-models/scotch-glass-3ds-free/1125447
Maybe there is a new version of ViroFBX script? I got one from here https://virocore.viromedia.com/docs/3d-objects#section-fbx
Actually I am trying to check if Viro framework can render realistic textures such as steel and glass, so it should look like in real life with shyness and reflection or at least close to this. Is Viro able to do that?
Thanks a lot for you patience and help, in advance guys!
UPDATET From Log
Loading OBJ from file /data/user/0/com.example.virosample.arcore/cache/spheres_viro.vrx
02-26 10:47:21.102 26638-26961 I/Viro: OBJ # of vertices = 0
02-26 10:47:21.102 26638-26961 I/Viro: OBJ # of normals = 0
02-26 10:47:21.102 26638-26961 I/Viro: OBJ # of texcoords = 0
02-26 10:47:21.103 26638-26961 I/Viro: OBJ # of materials = 0
02-26 10:47:21.103 26638-26961 I/Viro: OBJ # of shapes = 0
02-26 10:47:21.103 26638-26961 I/Viro: OBJ bounding box = x(340282346638528859811704183484516925440.000000 -340282346638528859811704183484516925440.000000) y(340282346638528859811704183484516925440.000000 -340282346638528859811704183484516925440.000000) z(340282346638528859811704183484516925440.000000 -340282346638528859811704183484516925440.000000)
@jacobwyn did you try it with Directional lights at the position and direction we suggested? That should have worked as seen in the screen shot attached above.
If you are looking for realistic textures, you are probably talking about Physically Based Rendering (PBR). Yes, Viro does support that, but it is a different way of modeling and you can not just use simple models. Take a look at this blog post to understand how to create PBR models. There is also a sample model included -> https://blog.viromedia.com/asset-pipeline-exporting-pbr-textured-3d-models-for-ar-vr-arkit-arcore-c570423c68aa
No, I didn't try to render it with Directional lights but I have tried with a few Spotlights from different sides and with different colours... judging by the description SpotLight is more flexible and more advanced Directional light....Thanks for link!
Hello guys, I have few more questions:
1) I managed to render staff with PBR. In the sample, the reflection in 3d models are taken from image that I pass in Texture.loadRadianceHDRTexture(imageUri)
but what if I want 3d model to reflect a world around?
2) I do not receive any callbacks while loading this model https://www.turbosquid.com/3d-models/3d-lamborghini-aventador-model/1117798 - try to load vrx -
3) In what case I'll need API to get the bounding box of any Node ? this API is declared in new ver 1.4.0
4) What does this line of log above mean?
02-26 10:47:21.103 26638-26961 I/Viro: OBJ bounding box = x(340282346638528859811704183484516925440.000000 -340282346638528859811704183484516925440.000000) y(340282346638528859811704183484516925440.000000 -340282346638528859811704183484516925440.000000) z(340282346638528859811704183484516925440.000000 -340282346638528859811704183484516925440.000000)
5) Is there an API that allows to get current frame from camera?
Hi @jacobwyn, in response to your questions:
We don't have support for reflecting the world around you, yet, because we can only see what's through your back camera, which isn't enough to generate reflections. This is an active area of research, however.
We will look into the issue regarding that model and get back to you shortly.
The API to get a bounding box for a node just tells you how large your model is, in meters across the X, Y, and Z dimensions. Some customers wanted this information to help them place objects.
That line of log is also the bounding box: it's in this following format: (minX, maxX), (minY, maxY), (minZ, maxZ). However, the bounding box in that log is before node transformations are applied; that is, it's the raw size of the OBJ right after loading. In your particular case the OBJ looks extremely large, perhaps malformed?
We don't have this API yet. This should be coming in our next release.
Hi @jacobwyn, we've identified the problem with the Lamborghini model you were loading. It was using textures with spaces in their pathnames, which weren't being properly escaped. The issue has been fixed and you'll be able to use this model in our forthcoming release. Thanks.
thanks!
Hi guys. I'm trying to convert FBX 3D model to VRX corresponds to your guide, described here https://virocore.viromedia.com/docs/3d-objects#section-fbx I have faced (probably)2 issues - first one while converting to vrx I see next Log:
Difference warnings look very suspiciously....
After that I have loaded vrx model as usual :
I got next log:
I have received message "load success" but 3d Objects geometry was always null, and of course nothing appears on the screen (AmbientLight is added). After that I have tried to do the same with 5 difference FBX models from difference sources - I had almost the same result... Link to described above asset https://free3d.com/3d-model/bb8-35865.html
UPDATED The best result I could get, was the white 3d model (without texture), and geometry was null as well. Asset for Audi R8 https://free3d.com/3d-model/audi-r8-14024.html converting log for Audi is warningless, so iI think the issue with BB8 is in fbx model itself. The question with white texture in vrx mode is open .