Jump to content

LOD request


Recommended Posts

Forgive me if this isn't the right place to put this. I just wanted to put in a request for better control over LOD. Specifically, it would be great if there were a callback function (with distance as one of its parameters) that would allow me to have greater control over what is and isn't displayed at a given distance. For example:


1) Rather than switching suddenly between levels of detail, I could use the distance to implement a fading transition (i.e., one level would fade in as the other was fading out). This would allow for LOD changes to occur much closer to the camera, without bothering the user as much. Also, it would allow for greater mesh simplification, because differences in meshes wouldn't be as noticeable. Could be particularly helpful for the null to not-null transition a lot of people use as the farthest level of detail. 


2) LOD shadows are another example of how an LOD callback function could be helpful. I could assign an object to different shadow generators (with different shadow-map resolutions) based on distance.


Looking at the code, I don't think it wouldn't be too hard to implement. The Mesh.prototype.getLOD function seems to be the right place, after distanceToCamera is defined. 


Anyway, I know the developers are working on a million things right now, and I'm amazed at how quickly the engine is improving. Thought I'd just throw in my two cents in case it's helpful. Thanks!

Link to comment
Share on other sites

Here's a working example of what I mean: http://www.babylonjs-playground.com/#1S5TZL


I made just a few changes to babylon.js, implementing an LOD callback function. I then use that to "smooth" the transitions between different LOD levels using fade transitions. It makes the LOD transitions easier on the eye, I think. There are many other things that could be done with a callback function, though. This LOD fading is just an example.


Note that my implementation here is not very elegant! I'm sure there's a better way that's more user friendly. But at least it works. :) Thanks for the attention.

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.

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.


  • Recently Browsing   0 members

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