iTwin / itwinjs-core

Monorepo for iTwin.js Library
https://www.itwinjs.org
MIT License
615 stars 210 forks source link

Create API that can suggest AO settings based on project extents, etc. #3997

Closed markschlosseratbentley closed 9 months ago

markschlosseratbentley commented 2 years ago

This draft PR will change AO to make the effect more pleasing in views where geometry is more distant from the camera than other geometry.

We should also consider adding some kind of API that could suggest AO settings which would work well for a particular iModel based on its project extents, etc. For example, and most easily done, AO maxDistance could be suggested based on project extents. Other parameters like texelStepSize, intensity could potentially be derived by some rules of thumb as well.

API could look like something like this: suggestAOSettings(imodel): AmbientOcclusion.Settings

markschlosseratbentley commented 2 years ago

I experimented with some initial algorithms. Basing maxDistance on projectExtents could be problematic when you zoom out such that you begin viewing an area larger than the initial project extents.

markschlosseratbentley commented 2 years ago

Needs further investigation - does not seem super feasible at the moment without more extensive research.