ua4192 Posted May 18, 2017 Share Posted May 18, 2017 Dear all. Is it possible to use clones and LOD with imported meshes? With instances I have lots of problems: 1.- When I set a distance and null mesh to be loaded, then the instance is not properly positioned and rotated. 2.- Some instances are not loaded, with the same code the number of intances vary and should not. 3.- The only mesh that seems to work is the null LOD the other meshes with different qualities not. I can attach the code I am using. Is there any way to use LOD with different quality meshes with clones? Quote Link to comment Share on other sites More sharing options...
ua4192 Posted May 19, 2017 Author Share Posted May 19, 2017 It seems that the method addLODLevel when used with meshes extracted from method ImportMesh doesn't work properly or maybe the method works in async way like ImportMesh. This is what I am doing and each time I load the scene, the total number of meshes is different. First I import all GLTF into my scene but make them not active. I wait until all meshes have been loaded using a whendone() function on ImportMeshCall. This ImportMeshCall has a countdown and when it reach to zero it means that I have all meshes loaded and saved in an array of meshes. When I have all meshes loaded and saved in the array, I invoke a function (make_lod_assets) to addLODLevel, by now only one (null when distance is greater than x) After having finished to add all LODs, I invoke to another function (loadscene) which starts to build the scene. As I want to keep the same structure than CATIA, I build invisible unitary boxes for all assemblies containing the CATParts (my meshes) and I apply the transformation matrix (rotation+position) in a relative and inherited way. I am using instances because I want to use HW acceleration. When this function (loadscene) ends it returns the scene and it is rendered. My meshes (extracted from GLTF) don't have textures My problem are: - the addLODLevel seems to work in a async way -Sometimes the instances are not properly positioned My code is quite big and not possible to be integrated in PG, but I can attach it. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 29, 2017 Share Posted May 29, 2017 Hello the addLodLevel should work with clones Do you mind trying to just repro this issue. We do not need all your code Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.