jdurrant Posted March 20, 2015 Share Posted March 20, 2015 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! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 21, 2015 Share Posted March 21, 2015 Can you sketch some lines of code to show me how you think you could use it? I appreciate having a glance at how the API could look like Quote Link to comment Share on other sites More sharing options...
jdurrant Posted March 21, 2015 Author Share Posted March 21, 2015 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. Dad72 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 21, 2015 Share Posted March 21, 2015 The idea is good. Quote Link to comment Share on other sites More sharing options...
joshcamas Posted March 21, 2015 Share Posted March 21, 2015 Looks like how skyrim does it! Very nice! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 21, 2015 Share Posted March 21, 2015 Will be part on the next commit:) Dad72 1 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.