4
$\begingroup$

This is pretty complex, and I am fairly sure it is impossible to create, but I will ask around anyway.

Basically, I am looking for a way to linearly decimate a mesh relative to an object’s distance from the camera. (see attached drawing)

Preferably, this would be best done with geometry nodes, although I’d use a drivers solution if that is most optimal.

enter image description here

Fig. A: Mesh’s average polygon size increases as it gets farther away from the camera.

Fig. B: To the viewer, every mesh’s subdivision/average polygon size looks the same (appears to be the same size)

Fig. C: But in reality, the average polygon sizes are different sizes, saving memory

PS. Sorry for the crude drawing; I think better drawing things out! ;)

$\endgroup$

2 Answers 2

3
$\begingroup$

If we had a Decimate node this would be trivial, but unfortunately it's not here yet. I drew a blank on implementing a setup with more than two levels, but if that's enough, we could take advantage of the fact that subsequent modifiers on the stack can act only on realized geometry, by only realizing instances that are sufficiently far away from the camera:

enter image description here

A more flexible method would be to implement a LOD system, with progressively simpler pre-made variations of an object getting instanced as the distance increases:

enter image description here

Update: Here's a setup with a simpler index selection method. It snaps the camera distance to multiples of a certain number (our threshold), then divides those by themselves so we get a ladder of $0,1,2,3...$ for consecutive patches of equal distance, which corresponds to the indicies of the LODs, clamped at their max index so they don't loop. Simply put, it switches to the next index/simpler LOD every n-th meters from the camera, but it stops at the simplest LOD, dynamically. You just need to make sure your LODs are listed alphabetically in the collection.

enter image description here

$\endgroup$
8
  • $\begingroup$ That second one has a smoother transition of decimated/simplified geometry; I like that. I'll try this setup to see if I can realize my goal with it. I'll keep you posted. If this works I'll approve the answer. $\endgroup$ Commented Nov 16, 2022 at 19:16
  • 1
    $\begingroup$ @BlenderMaster15 Updated the answer with a simpler and more robust index selection method. $\endgroup$
    – Kuboå
    Commented Nov 16, 2022 at 20:22
  • $\begingroup$ Is there any way to use this so that there is only one mesh, and it changes LODs based on the distance from the camera? $\endgroup$ Commented Nov 16, 2022 at 20:44
  • 1
    $\begingroup$ Like I said, I think we'd need a Decimate node for that; unless you want to make your own fake-decimate node like this or something similar: blenderartists.org/t/geometry-nodes-decimate/1387248/3 If you wanna do that, you could just use the setup from the first screenshot, separate by distance and "decimate" your instances inside GN. $\endgroup$
    – Kuboå
    Commented Nov 16, 2022 at 20:50
  • $\begingroup$ Ah! That makes sense. $\endgroup$ Commented Nov 16, 2022 at 21:14
2
$\begingroup$

Wouldn't this be a wonderful case for the node Map Range?

This could translate a certain distance of a given range into another, which corresponds to the number of instances in a collection.

Something like this:

enter image description here


(Blender 3.3+)

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .