- make it independent on the current view's Z range
- simplify scaling code
- reverse Z handling (higher Z value == closer to "camera")
- remove unused API functions and member variables
* PointCloudLayerExporter class
* set points limit
* saveas dialog
* qickndirty task
* wip
* add pdal files
* transform context
* add getters
* try to use some subclasses
* use nested classes
* don't default layername
* limit supported formats
* error reporting
* limit formats in gui too
* format filters and source/target crs
* use default infinite extent
* set pdal crs
* add pdrf but keep 3 for now
* properly handle LAZ attributes
* catch coordinate transform exceptions
* use default destructor, fix leak, docs
* trim includes, fix typos
* use qgsspinboxes, add points limit to the gui
* fix limit exporting logic
* avoid auto
* fix builds
* don't reuse lastVectorFormat setting
* Rework layer name handling
* Rage against the elevation
* invert attribute activation logic
* use wkt for laz srs
* use original offset/scale if not reprojecting
* move created memory layer to main thread when done
* allways add memory layer to map
* oops
* properly handle existing vector files
* don't add layer if cancelled
* create the memory layer on the main thread
* remove colon
* remove duplicate code and avoid crashing on mesh and vectortiles
* fix leak
* handle case blunder
* address review
* Initial implementation
* - Add disabling of blur pass
- Change default parameter for shading factor
- fix some tests
* - Implement bilateral filtering
- Optimize textures
- Fix layout test
* rename SSAO to ambient occlusion
fix ssao settings widget margin
* Remove unused variable
* fix naming and add tooltips
* - Refactor quad entities
- Address Stefanos's suggestions
* Rework SSAO implementation
Previously we based the code on CloudCompare's implementation,
however that did not work too well for us for a couple of reasons:
- the code does not deal well with perspective projection, causing incorrect shading (CC uses orthographic projection)
- there was no range check, so we would be getting false ambient occlusion on larger depth discontinuities (silhouttes)
- banding artifacts as the sampling kernel was not getting rotated
- parameters (shading radius, distance attenuation) that are difficult to understand
The new implementation is based on John Chapman's tutorial and LearnOpenGL page (derived from the original tutorial):
https://john-chapman-graphics.blogspot.com/2013/01/ssao-tutorial.htmlhttps://learnopengl.com/Advanced-Lighting/SSAO
The general approach of the SSAO is the following:
- for each pixel, we pick a couple of random points nearby (64 samples currently)
and check with the depth buffer whether they are visible from the camera or not.
The nearby points that are occluded contribute to darkening of the pixel,
this is saved to a texture
- in the next rendering pass, we blur the texture using 4x4 box. This is because
in the first step we use 4x4 random noise pattern and it leaves a noticeable noise
pattern on the screen. This pass gets rid of that noise
- in the post-processing step, the blurred texture is blended with the rendered scene
There are few differences to J.C.'s tutorial and LearnOpenGL page:
- the approches above use normal maps (a texture with a normal vector for each pixel),
but we don't because we also want to support point clouds that do not have normals
(at least not by default)
- we use full sphere for sampling instead of hemisphere (which is possible when you
have normals), so maybe we are getting a bit lower quality / performance
- LearnOpenGL also uses a texture with positions of all pixels - we only use depth map
to get the original positions (like JC's original code does)
* Clean up ssao parameters and GUI, add intensity parameter
* Add missing Q_OBJECT macro
* Add more missing Q_OBJECT macros
* Add occlusion threshold parameter to control the darkening
With the default threshold of 50%, pixels only start to get darker
when more than half of the neighborhood samples are occluded. That
means flat surfaces should not get any darker. (What we had previously
is an equivalent of having threshold set at 0%)
The downside is that with increased threshold, more subtle occlusions get lost.
* Review from Stefanos
* More review and better defaults
* Clear button fix
Co-authored-by: NEDJIMAbelgacem <gb_nedjima@esi.dz>
QgsProviderSqlQueryBuilder provides an interface for creation of SQL queries, which
can be overridden for backend provider specific SQL syntax.
Initially add a virtual method for creation of row limited select *
queries.
This method restores the Qt 5 logic for testing for null variants,
where for core Qt types the isNull check is forwarded to the actual
data type.
E.g. on Qt 5: QVariant( QDateTime()).isNull() is true, but
on Qt 6 it's false
This breaks a LOT of assumptions made throughout QGIS. The new
helper method avoids this breakage by ensuring we follow the Qt 5
logic also on Qt 6 builds, and also gives us the option to extend
this logic for user types (e.g QVariant( QgsGeometry() ).isNull() could
return true). (That's not included here)