* Font loading (hidden under a .png for now). Simple experiments with rendering text
* Added some text rendering tests. WIP on billboarding
* Added tests using troika-text-three library which uses sdf font textures instead of generating text geometry
* WIP on supporting speckle text objects
* Some more work on speckle text object integration. Worked on text materials, text batch and text object. We're now rendering basic text
* We're now rendering the text for various dimension types. Changed text to use display style first, since that's the one that contains it's color.
* Implemented text selection. Text can now be selected and works the same way every other speckle objects works when selecting
* Implemented the rest of the filtering features for text.
* Batch building can now be async. Building text batches needs to be async because that's how the troika libary works. Fixed an issue with the section box not clippin text properly
* Removed dummy text geometry data from it's RenderData. Enabled render views with metadata to count as valid. getRenderableRenderViews now returns nodes with metadata as well. Text now supports proper unit conversion. Text now is being displayed correctly(-ish) when inside blocks. Autocad text is now being displayed
* Fixed a displaying issue with blocks that contain non-direct-convertible objects.
* Revert "Fixed a displaying issue with blocks that contain non-direct-convertible objects."
This reverts commit dc44a07d79e605e42e605befde1b09fdc95429d5.
* Different approach on fixing the Base object with display values in Blocks which should not generate regression since it's restricted only to blocks and works the same way for other situations except this one
* Added 'elements' lookup as well
* Check if display values or elements exist before destructuring them
* Fixed an issue with curves doubling up on geometry and also not being selectable after the last filtering changes. Added the options to make lines transparent. Added lines to diffing
* Points now are diff-able and support proper visual diff-ing. Visual diff filters are now chosen internally by the Differ. Fixed an issue with LineBatch and transparency
* Implemented PLAIN visual diff mode, where all objects keep their original materil, but opacity is manipulated via the diff time. Added API member function to switch between the PLAIN and COLORED visual diff modes
* Diffing fixes for instances and blocks. Things seem to be working fine, but there are some caveats. Additionally, some older issues were fixed and diffing now works better on all the rest of the streams
* Fixed the diffing issues with revit instances and hosted elements and nesting, etc. SetUserMaterial now accepts an optional list of rvs to apply the filter to, instead of figuring out the rvs itself.
* Started implementing the TAS by using the same BVH library and solid bounding boxes as dummy geometry. It works great so far, we're almost at 10X faster than without it. Still needs a bit more work put int the details
* Implemented shapecasting with the TAS in a fairly efficient way. This means that our current application for shapecasting, the section outlines, are much faster to generate now.
* Implemented TAS refiting whenever batch objects change their position/rotation/scale. It's sufficiently fast. The refiting process itself is very very fast on the TAS, the thing that slows it down a bit is all the matrix multiplications. We can speed those up via micro optimisations
* Replaced default three.js box geometry construction with a bare bones one since that's all required for our TAS
* Used buffers in the occlusion query solve to avoid pointless vector creation
* Some small changes and renames
* Changed the section box helper to use Box3Helper instead of BoxHelper beacuse Box3Helper always uses vertex positions relative to world origin and stores the transformation in it's world matrix which it never uses inside the vertex program, hence no floating point imprecision. The worldView matrix which it does use, has as a result small values essentially working like RTE. It will only work for relatively small objects, though and if we have large box helpers far away from origin it, we will begin to see jitter. However, this is just a visual helper, so I'm fine with that caveat
* Reported bounding box the the TAS is it's own BVH bounds now, not te cummulated BAS bounds like before. It's much faster this way
* Limited object explode transform calculation to exclusevely 1 per frame, since UI events coming from sliders and such tend to create multiple events per frame, leading to us computing millions of transformations pointlessly.
* The TAS leafs now only have the minimum possible of 8 vertices and 12 triangles. This sped up BVH operations a bit
* Considerable speedup for ray-TAS intersection by eliminating the need to iterate over all contained batch objects to determine the intersected one by comparing the intersection result vertex index. We can simply compute the intersected one since they are built in order with a constant stride between them inside the vertex array
* WIP on naive diffing
* WIP on animating modified objects after diff
* Some more work on this
* Default building
* Removed and added now get opacity transitions as well
* Updated starting model
* Implemented two 'subpasses' in side the color pass, where opaque and transparent draw groups are rendered individually. Disabled double side depth rendering when visual diffing, to avoid AO generated by backfaces, visible through transparent diffed objects. Removed previous hacks
* Finished with cleaning up diff-ing related viewer functionality.
* Implemented UserMaterialState into filtering manager, as a 'sticky' filter which always gets applied before any other filters, until removed. Visual diff-ing and undiff-ing now go through the filtering manager so other filters can be stacked on top of it
* diff API function now checks to see if the diffing streams exist, if not, it loads them, computes the diff and applies the visual diff all in one call. Added undiff in the API which removes all the diff related sticky filters. Added setDiffTime in the API. DiffResult now holds modifiedOld and modifiedNew speckle objects in the same member as 2 item sequential arrays
* There was an unreported git conflict in one of the shaders. Fixed that
* Fixed an issue with HDRIs not generating proper PMREMs over multiple viewer instances
* WIP on makign the world tree multiple instanced
* The WorldTree is no longer static. Each viewer has it's own instance and it hands it over to whoever needs it.
* Fixed an issue with filtering and the new non-static tree. Also removed the 'root' key from the NodeData structure since it's not needed
* Added an guard when building batches for situations where all render views have invalid geometries. This generally means there is somethign wrong with the stream itself
* multi-viewer css fixes
---------
Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
* #1051 Implemented batch splitting based on a configurable mximum batch vertex count and configurable maximum batch object count. We're not splitting single objects though since that's not required right now and will do it when the need arrives
* Implemented dynamic batch object transformation using all available vertex uniforms.
* Fixed batch object index buffer size
* Added debug per object movement for debugging
* WIP on texture based object transform
* Finally fixed a bug which was making three.js use the same shader for multiple batches, and thus messing up individual obects transforms
* Integrated shadows, AO, depth, and selection material with the recent batching changes.
* Implemented per object BVH building and correct intersection testing when each object has its own transformation
* Implemented BatchObject which holds the single source of truth for individual transformations, it's BVH and some other WIP things
* Restructed how object level and batch level BVHs are constructed and used. Also added a bounds check for intersecting the batch level BVH (which is not really a bvh, just a flat list of small bvhs)
* Shapecasting now provides the intersected BatchObject inside the callbacks, so required data could be fetched from it. SectionOutlines now work correctly
* Fixed some issues regarding the shadowcatcher and the colored and ghost material uniform updates
* Fixed an issue with colored material and shadows. Restructed how speckle materials are defined and extended. This removes duplicate code as well as duplicate functionality. Implemented fro the standard material, still need to do it for the basic material
* Removed unused material and shaders
* Custom material defintion and extension MK2
* Improved the RTE and TRANSFORM_STORAGE shader blocks for minimal redundancy. Updated all shaders. Updated all materials to MK2. Still need to find a way to avoid some boilerplate code in the base materials
* Fixed an issue where three was incorrectly frustum culling objects
* Fixed the issue where depth material programs were getting ignored for batches with same object count, leading to incorrect depth
* Removed the need to have a preprocessor define for 0BJ_COUNT inside the batched shaders. This eliminates the extra startup time taken by all the program compiles. In order to do it, I had to drop using the scene override material in the depth pass. Instead we're applying the override material before the pass render on each objecti individually
* Added a generic method for overriding the batch's material, which can be used by any pass. Added a material cache for each batch so that we don't need to clone materials more than we need to. Fixed an issue in the depth mateial clone function which made three not update our uniforms (this happens so often I'm getting sick of it). Filters now use cached material so they work correctly
* Fixed a dreaded three.js bug where it would sporadically not update our custom uniforms for reasons unknown
* Finally managed to get mixins working for out material system. With this, we avoid needing to write duplicate boilerplate code for all speckle base material types. Only applied it to SpeckleStandardMaterial because I want to test more before I adopt it globally. Implemented our custom material overriding approach to the stencil and stencil mask passes.
* A lot of dead brain cells. Transforms and RTE and BVH and all them things work correctly, with the exception of transforming around a point very far from origin. That will cause jitter because we end up multiplying large floats
* Managed to get RTE working properly with individual object transforms, transforms around random pivot. Fixed an issue caused by the fact that three-mesh-bvh messes up the bounding box of objects very far away from origin. Worked around it. WIP on cleaning things up
* Solution for object transforms in a real RTE context (far from origin). First pass on cleanup. Solution will be applied to the rest of the shaders in the next commit
* Updated WebGL 1.0 transform texture sampling and matrix array transform fallback
* Updated all shaders with object transforms RTE solution
* Updated remaining materials to the new mixin'ed approach implemented a little while ago. This removes a ton of boilerplate repeated code
* Update the normals pass. Simplified and removed reduandant batch update ranges from the before/after pass callbacks
* Reorganized BatchObject so we're not wastefull with matrix and vector instantiations
* Added explode function in the viewer API
* Enabled cleaning of redundant geometry
* Some html crap
* Fixed an issue with filtering out invalid render views. Removed the red sphere of doom (forgot it in). Fixed an older issue (not related to this branch) where instance points were deleted while still being shared by other lines, yielding invalid lines
* Fixed ShowBatches
* Fixed some sandbox related issues and improved qol
* The ObjectLoader and ViewerObjectsLoaders are disposed upon loading complete.
* Added viewer parameter for keeping or discarding original geometry data. Defaults to discarding it. WIP on mesh and point cloud implementation for actual discarding it
* Geometry data from raw nodes is now disposed after building their reder views
* Removed raw geometry data from points and lines
* Removed the float64 array which was persisted pointlessly by the section plane outlines feature. Also fixed a bug for this feature regarding resizing the point buffer and RTE
* Implemented BVHs in local space, relative to world origin. This cuts down on it's redundant memory footprint by half
* Implemented SpeckleMeshBVH which completely hides the RTE-related transformations that we're making to reduce memory footprint.
* Added some clarifications to the SpeckleMeshBVH class
* Extended the ObjectLayers on a per geometry type basis. We can now restrict intersections and rendering based on geometry type (mesh, line, point)
* Disabled geometry type based filtering of opaque/transparent/stencil objects in the batcher, since we're using separate object layers for the geometry types now
* Fixed and issue with OR-ing layers
* Implemented async walk for the world tree. Implemented asyn render tree building and async batch building. Implemented progressive loading
* WIP tree walk async that actually works using a generator
* Async walking now properly works and can be interrupted
* Properly working async walk
* Added loadObjectAsync function in the API which should be used if stream loading needs to be cancelled and for 'progressive' loading. Added a priority argument to the loadObjectAsync and to walkAsync functions which makes the async-iness so to speak configurable.
* Refactored the sync and async subtree batch building to remove duplicate code. Changed some logs for better clarity
* Fixed an issue with point clouds and material creation