GameMonetize Posted March 15, 2016 Share Posted March 15, 2016 I don't agree regarding inheritance. You may want to optimize your scene and not have all the wall used to generate shadows. As this is related to perf I prefer an opt-in approach. Water material SHOULD ( ) requires all instances as well to be added regarding your crash do you mind trying to reproduce it on the Playground? meteoritool 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 15, 2016 Share Posted March 15, 2016 I double-checked: all abstractMeshes children have a _preActivate function meteoritool 1 Quote Link to comment Share on other sites More sharing options...
meteoritool Posted March 16, 2016 Author Share Posted March 16, 2016 Ok, then it's only more convenient for my own personal case then ;-) I'll be coding the right way from now on , thank you for clearing up all that ! I think somehow there might be a problem, when, precisely, not adding instances to the shadowmap, while the original mesh is, that makes the instances not appear at all :http://playground.babylonjs.com/#1NLCOZ#4 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 16, 2016 Share Posted March 16, 2016 OK:) this should work now meteoritool 1 Quote Link to comment Share on other sites More sharing options...
meteoritool Posted March 17, 2016 Author Share Posted March 17, 2016 Grand ! Everyone reading this must KNOW that @Deltakosh RULES !!!! GameMonetize and Wingnut 2 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 17, 2016 Share Posted March 17, 2016 Watch out for "The Pancaker". That thing will ruin your relaxing walk thru the horridor. "Flat"-shading, the hard way. meteoritool and adam 2 Quote Link to comment Share on other sites More sharing options...
meteoritool Posted March 19, 2016 Author Share Posted March 19, 2016 On 17 mars 2016 at 5:16 PM, Wingnut said: Watch out for "The Pancaker". That thing will ruin your relaxing walk thru the horridor. "Flat"-shading, the hard way. I'll probably end up using this feature you know ;-) Wingnut and GameMonetize 2 Quote Link to comment Share on other sites More sharing options...
meteoritool Posted March 24, 2016 Author Share Posted March 24, 2016 Hey ! quick question : calling all meshes with "scene.meshes[ ]" does not include instances right ? I have created my Instances directly into Blender, and there are LOTS of them, how can I access those instances with javascript, in order to add some properties to them ? Thx ! Quote Link to comment Share on other sites More sharing options...
adam Posted March 24, 2016 Share Posted March 24, 2016 It looks like you can use scene.getMeshByUniqueID(myInstance.uniqueId). Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 24, 2016 Share Posted March 24, 2016 Hey instances are referenced in mesh.instances array where mesh is the source mesh. meteoritool 1 Quote Link to comment Share on other sites More sharing options...
meteoritool Posted March 24, 2016 Author Share Posted March 24, 2016 perfect thank you as usual GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
meteoritool Posted March 26, 2016 Author Share Posted March 26, 2016 Hi, getting back to you because I noticed something unexpected : All my instances where created directly within Blender, using the "Duplicate Linked" function on objects. It works well (.babylon file is still small sized in spite of the number of things). Now, trying to modify the instances, I could not reach them with mesh.instances". I did a console log on all scene.meshes.name and it appears that "duplicateLinked" objects from blender are not referenced as Instances but rather as normal meshes. This might not be a big problem, but I'm just wondering if those meshes still benefit from being "instances" of a single mesh once translated in the Babylon.js world ? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 27, 2016 Share Posted March 27, 2016 Can you check if your babylon file contains an array named "instances" ? Quote Link to comment Share on other sites More sharing options...
meteoritool Posted March 27, 2016 Author Share Posted March 27, 2016 28 minutes ago, Deltakosh said: Can you check if your babylon file contains an array named "instances" ? Yes, all instances meshes are properly referenced in arrays called "instances" ! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 27, 2016 Share Posted March 27, 2016 Can you share a (simple) babylon file? Quote Link to comment Share on other sites More sharing options...
meteoritool Posted March 27, 2016 Author Share Posted March 27, 2016 sure, here's my file : wall.babylon Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 27, 2016 Share Posted March 27, 2016 It works for me...I can see instances loaded and attached to the mesh Quote Link to comment Share on other sites More sharing options...
meteoritool Posted March 27, 2016 Author Share Posted March 27, 2016 yeah it works fine ! I just couldn't access to the "instances" with: mesh.instances But I could somehow access the "instances" with: scene.meshes I was just wondering if this is the normal behavior , but as long as everything works lol Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 27, 2016 Share Posted March 27, 2016 are you sure you are referencing the right mesh? meteoritool 1 Quote Link to comment Share on other sites More sharing options...
meteoritool Posted March 28, 2016 Author Share Posted March 28, 2016 yes I did look into the .babylon file to see what's happening, and to get the names of the meshes. In Blender, the mother mesh of all instances is the last, not the first, if I'm correct. I retried to get instances and I could do it ! It seems my problem was more javascript than Babylon, sorry 'bout that & thank you ;-) GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
meteoritool Posted March 29, 2016 Author Share Posted March 29, 2016 Hi again Getting back to the core of things : a dynamic shadowmap.renderlist : how would you do that ? It's getting a bit complicated ... My idea is to use mesh.getDistanceToCamera and refresh the shadowmap.renderlist every x seconds ... Only the meshes within a certain range will be added to the list. I'm planning to use this method for number of other things (water or mirror renderlist for example) Do you have a better suggestion ??? it seems not ideal to me, because there will still be unnecessary computation (the function would browse ALL scene meshes to check if is in range, which is maybe not ideal ??? and the x seconds parameter is not really clever in my opinion :-/ ) Quote Link to comment Share on other sites More sharing options...
Wingnut Posted March 29, 2016 Share Posted March 29, 2016 Fun challenge! Maybe, put a big, invisible sphere around your camera. Then... umm... in the render loop... for (mesh in scene.meshes) - if (mesh.intersects(myBigSphere)... then make sure it IS in (new) renderList. Else... make sure it is NOT in the renderList. I don't know. I was just trying to reverse-engineer mesh.isInFrustum(camera)... perhaps. *scratch scratch* meteoritool 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 29, 2016 Share Posted March 29, 2016 I like your idea! Did you give it a try? I guess this should work well meteoritool 1 Quote Link to comment Share on other sites More sharing options...
meteoritool Posted March 29, 2016 Author Share Posted March 29, 2016 Or maybe then creating big static invisible spheres with an Intersects action ... My brain is bubbling on this one since I wanna use the optimal laziest way >_< !!! Thank you both, I I can make a step ahead now ! #Is there a node.getDistanceToNode(otherNode) function ??? that would be convenient :-) Quote Link to comment Share on other sites More sharing options...
meteoritool Posted March 30, 2016 Author Share Posted March 30, 2016 another little question : In Blender, I created a Mesh, duplicate-linked it multiple times to create Instances. I then cloned the 'mother' mesh and applied decimate. That decimated mesh would be later referenced as the LOD mesh of the 'mother' one within the BABYLON browser environment. I struggled but finally managed to handle properties of 'mother' meshes and its instances inside the 'SceneLoader.ImportMesh' onSuccess callback function. I managed to set the .checkCollisions based upon distance to camera, every x seconds. Now I wonder how I can access the LOD mesh of each instance ? My instances receive shadows the right way but the LOD version does not :/ 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.