Jump to content

Lights for my horror corridor


meteoritool
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 !

Link to comment
Share on other sites

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 ?

 

Link to comment
Share on other sites

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 ;-)

Link to comment
Share on other sites

:)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 :-/ )

Link to comment
Share on other sites

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*

Link to comment
Share on other sites

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 :-)

Link to comment
Share on other sites

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 :/

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...