[Add-on] Distance-based Subdivision tool

Hi Everyone,

This is my first add-on, and it’s quite a simple script but I hope you will nonetheless find it useful.

Basically it sets the subdivision level for objects in your scene based on the distance from the camera. The idea is to save render time by having low sub-d levels for objects far away, but not sacrifice quality by having high sub-d levels for close objects. I haven’t done any benchmarks as to how much it helps. You set the min and max subdivision levels for your scene, and the near and far distances to use when calculating the levels, and the script does the rest. See the readme for more details, but I hope it’s obvious how the different options work.

I was thinking it’d be really cool if someone could make it dynamically update if you move the camera, but this is my first Blender python script so I didn’t know if that’s even possible. Also, I don’t know if you can keyframe subdivision levels, but it could be a render time-saver to adjust subd levels during an animation.

The script is attached here:

dist_sub.zip (2.67 KB)

Per usual, unzip the file, and you’ll find a python script and a text file with documentation. In Blender, go to User Preferences -> Add-ons -> Install From File…, then select the dist_sub.py script. It will be under the “Object” category, so find it and check the box next to it. It should show up in the “Misc” tab of the Tools pane.

Let me know if it’s helpful or if you have any suggestions!

you are looking for LOD or tessellation

Kupoman added a LOD system for the game engine but I don’t know if it works in the viewport or rendering,

the data is reads/writes could be used for your own system potentially?

LODs usually swap out models at different distances. This is more like tesselation, adjusting the subsurf level. I would be surprised if BGE code would work for the viewport, but maybe.

I was actually thinking about this the other day! Thanks for coding it! :slight_smile:

Thank you for it! We need you and your work.

Very helpfull. Good idea. Thanks

You’re welcome!

+1 for making it dynamically, thanks for your hard work :slight_smile: