princeton-vl / infinigen

Infinite Photorealistic Worlds using Procedural Generation
https://infinigen.org
BSD 3-Clause "New" or "Revised" License
5.32k stars 455 forks source link

Is there any way to EASILY limit the number of polygons per object? #166

Closed MalcDuck closed 6 months ago

MalcDuck commented 11 months ago

Is there any way to EASILY limit the number of polygons per object?

For example the snake has over 5mil verts.

Is there a script parameter/etc which will limit the vert count? I assume not?

araistrick commented 11 months ago

If you set target_face_size.global_multiplier to 4 instead of 2 in base.gin it will signal to the system that faces should be an avg. of 4px across instead of 2px, and should in theory reduce the polycount to somewhere 50% or 25% depending on the asset.

In practice, not all assets will respond perfectly to this multiplier at the moment - we are still working on standardizing the API and optimizing everything.

Snakes, unfortunately, are a bit of a special case - the scales are implemented by realizing a large number of instanced individual scales, and the poly-count of each scale nor the overall number of scales can really be adjusted without ruining the effect. So if you wanted a truly lower poly snake, you'd likely need turn off this instanced scales strategy altogether (by modifying the code), or just generate the snake then decimate to your desired resolution. I hope to make the API for making changes like this (disabling sub-features, etc) more standardized and convenient in the future also.