Skip to content

how to build a massive scene renderer using this library #6

@pixeljetstream

Description

@pixeljetstream

from another issue @mzwaal asked

A feature I would like is geometry simplification on model level, that would make a big wall for example cheaper to render. My use case is is rendering the maximum amount of models in real time. I don't use the chamfer feature for that reason. Also full support for all the official parts would be great.
Also for non transparent parts, there is a lot of stuff inside bricks that should be culled when bricks are stacked.
There are more things I can think of. What would be the best way for you to receive feedback/feature request that are not issues per se?

While this library is more of a data provider, here is some thoughts about its design features:

  • shapes were intended so one can override studs/other frequent detail bits, by something like a dedicated rendering system tuned for such low complexity meshes (think particles). This could influence the roundness etc.
  • the chamfer effect uses a separate index buffer still using the regular vertices, so it can be used for level-of-detail
  • in a deferred renderer the bevel highlights could be done in post by rasterizing the hard edge lines for closer objects and perturbating the normals (imo some level of bevel edges is important to get the highlights of plastic, makes it look nicer)

As for generally going about it and solving the obstruction/waste

  • using raytracing the studs (as shapes) could detect if they are occluded (shoot hemispherical and detect if you can escape), and then be removed from the shape list. I could imagine doing something in vulka raytracing for this. Moving the ldrawloader_viewer to vulkan, some "bake" type operations could be done there. If the models are known ahead of time, or if such baking is okay at load-time. One could do this detection for individual triangles but that will need a healthy amount of rays to be accurate enough.

  • reduced number of parts at distance? you could rasterize/raytrace the model from a few angles at lower resolutions. That could give you a list of parts that are more "important" then others. So if the model is afar you render less parts (this isn't free of visual error but could work good enough).

  • collapsing walls to larger triangles imo isn't needed, hardware is pretty good at how much triangles can be pushed (although depends on your target). It's more important to occlusion cull.

  • brute-forcing occlusion culling is pretty good on todays hardware (using HiZ depth textures etc.). Especially with lego you can build nice proxy shapes using the bboxes and evaluate a bit hierarchical. Test the bbox of the model first, then the various part instances within. Then the "special" shapes like studs... Depending on distance you might straight skip them. (I originally wrote this library in preparation of showcasing some of this using mesh-shaders, though didn't find the time yet). But https://github.com/nvpro-samples/gl_occlusion_culling might be inspiring

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions