* Sped up diffing by several orders of magnitude. Also started on a different more fancy approach to diffing involving boolean operations on object maps
* Finished with boolean version of diffing. Improved the speed of both by 50% on top of the previous speed improvements
* #1690 Completely transparent objects are ignored during picking via a toggle-able flag in renderer
* After removing inserted draw ranges, materials associated with it are removed as well from the material array
* Solid color diff materials are transparent only when their opacity is lower than 1. This fixes the issue of not seeing the selected material on filly opaque diffed materials. However, for dif times <1 and > 0 the selected material will blend with the diff material. If this proves to be an issue we can look further into it
* Update clipping planes after selection
* WIP on measurements. Got some basic functionalities going
* New update for measurements. We're no showing multiple lines towards the measurement endpoint for better reference. Added dotted lines. Added text. Added measurement end and start points. Added the possibility to add multiple measurements.
* When double clicking, Input will not ignore the second click and will not send a click event. It will send the first click event, then a double click event. Implemented auto perpendicular measurement by using double click
* Added the option to have fixed sized measurement gizmos. As in, the are the same size regardless of the camera zoom. Implemented gizmo styles which lets us control and change at runtime the way the gizmos look. Currently they're only programatic, but I'll add controls for them in the sandbox next
* Implemented measurement management. Added picking, cancelling, removing and highlighting of measurements. Measurements are all now on their special ObjectLayer
* Added frame lock, so mouse events do not trigger intersection tests more than once per frame for the measurements. Added opacity options in the measurement gizmos. Made the end gizmo line transparent by default. Added preprocessor macro in the line shader which enables opacity as a uniform as opposed to attribute only like we had it before
* Point is now fixed size when style imposes it
* WIP on text aligning with the line. Still needs some things to be clarified since it can get complicated. Fixed some color issues. Added a maximum constraint to the screen space gizmo sizes. It's empirical, but seems to be workign decently for the all the various stream sizes I've trid
* Measurement gizmo now flashes red a few times if requrested to auto-lazer and no intersection was found
* Added unit conversion to measurment text, unit display and precision
* Implemented proper billboarding (fixed size and non fixed size) in the text and basic vertex programs as well as support for them in the text and basic speckle materials. Overhauled how the measurements look based on the forge reference
* Split measurements by type and added an abstract superclass. Point to point measurement has it's own implementation now
* Implemented screen space snapping for point to point measurements. Text background now gets dyanamically resized when needed
* End point gizmo is now only shown when required
* Added clamp guard to acos since dot can return outside of [-1,1] due to fp precision issues. Fixed an issue where existing measurements could be selected in the process of creating another measurement
* Added function for adding measurements programatically. Currently only start and end point make sense as measuremetn data
* Added an 100nm offset from the original point along the surface normal for auto-lazer function because sometimes it would intersect itself and report incorrect length
* Separated all measurement related rendering into a separate 'Overlay' pass. We now have better control over the rendering order of the individal elements of the measurement gizmos. This fixed the issue of having the measurement line overlap the end points
* Billboarded shaders now also work correctly with section planes
* Measurement tool no longer considers surfaces clipped by the section box
* Implemented correct raycasting for billboarded and fixed sized bibboarded objects, like the measurement's text
* Implemented zooming in to measurements when double clicking
* Big update to measurements which addresses most if not all requirements regarding UX/UI, API, and generaly functionalities. Additionally, a fix or an ancient issue in Units where kilometers were incorrectly calculated, and added automatically resolution updates to the SpeckleLineMaterial
* Added dpr factor into billboard size calculations. Fixed an issue with the round rect geometry generation function which would fail on macos. Added the billboard text background size into the text's style so it's configurable
* Text can now be updated for perpendicular measurements also when in it's complete state
* Fixed an exception which was thorwn when double clicking on another measurement while measuring
* When changing the measurement type while the measurement is still in it's dangling start state, the measurement gets cancelled and a new one with the new type gets started. If the measurement is in it's dangling end state, then it does not. This is now forge viewer does it
* Implemented screen space surface normal indicator line
* Measurements now work on visible and non-ghosted objects. Removed the surface normal indicator from the point to point measurement
* Fixed an issue with orthogrtaphic camera and NDC normal computation. Implemented fixed sized gizmo disc for orthographic camera
* Fixed an issue where the pipeline would not get properly reset after zooming in orthographic mode
* Fixed some regressions with the pre-existing application measurements functionalit and text. Fixed an issue where auto-lazer measurements were not vertically centered.
* Replaced the full blown copy method from SpeckleMesh's cached material with a faster version which *should* work just the sam
* Added optional copying of cached materials defaulting to false
* Implemented the option to insert draw ranges in batches. This is how selecting objects now works in order to avoid re-applying existing filters pointlessly. The onyl downside is that this introduces extra draw calls and overdraw, but it does not interfere with the existing draw range setting systems. We do make an attempy to minimize extra draw call count which works for most scenarios. With this change, we've removed selecting/unselecting objects from the generic setFilters approach in FilteringManager
* Apply any pre-existing selection filter after applying the rest of the filters
* Improved 'setNumericColorFilter' and 'setStringColorFilter' function performance by 10x. The culprit was calling 'indexOf' in the tree walk callback which apparently is very slow even for arrays with only a few thousand elements. By using direct indexing we eliminated the ridiculous overhead
* Performance increase of about 20x to isolating, hiding, unisolating and unhiding. Still WIP, the UI got messed up a bit
* Correct length of visibility ids
* Fixed an issue with un-isolating and un-hiding
* Did the same thing for highlight as I did for selection, where we take it out of the setFilters flow and apply direct filters on the rvs
* Removed timings
* Small fix for color filters
* Implemented inserting and removing draw ranges from the line batch
* Implemented draw range insertion and removel for the point batch
* Implemented draw range insertion and removel for TextBatch. Fixed an issue with inserting draw ranges in the batcher
* Fixed diffing colours which got screwed during this PR. Additionally made an even faster version for copying materials which has virtually no overhead
* WIP on measurements. Got some basic functionalities going
* New update for measurements. We're no showing multiple lines towards the measurement endpoint for better reference. Added dotted lines. Added text. Added measurement end and start points. Added the possibility to add multiple measurements.
* When double clicking, Input will not ignore the second click and will not send a click event. It will send the first click event, then a double click event. Implemented auto perpendicular measurement by using double click
* Added the option to have fixed sized measurement gizmos. As in, the are the same size regardless of the camera zoom. Implemented gizmo styles which lets us control and change at runtime the way the gizmos look. Currently they're only programatic, but I'll add controls for them in the sandbox next
* Implemented measurement management. Added picking, cancelling, removing and highlighting of measurements. Measurements are all now on their special ObjectLayer
* Added frame lock, so mouse events do not trigger intersection tests more than once per frame for the measurements. Added opacity options in the measurement gizmos. Made the end gizmo line transparent by default. Added preprocessor macro in the line shader which enables opacity as a uniform as opposed to attribute only like we had it before
* Point is now fixed size when style imposes it
* WIP on text aligning with the line. Still needs some things to be clarified since it can get complicated. Fixed some color issues. Added a maximum constraint to the screen space gizmo sizes. It's empirical, but seems to be workign decently for the all the various stream sizes I've trid
* Measurement gizmo now flashes red a few times if requrested to auto-lazer and no intersection was found
* Added unit conversion to measurment text, unit display and precision
* Implemented proper billboarding (fixed size and non fixed size) in the text and basic vertex programs as well as support for them in the text and basic speckle materials. Overhauled how the measurements look based on the forge reference
* Split measurements by type and added an abstract superclass. Point to point measurement has it's own implementation now
* Implemented screen space snapping for point to point measurements. Text background now gets dyanamically resized when needed
* End point gizmo is now only shown when required
* Added clamp guard to acos since dot can return outside of [-1,1] due to fp precision issues. Fixed an issue where existing measurements could be selected in the process of creating another measurement
* Added function for adding measurements programatically. Currently only start and end point make sense as measuremetn data
* Added an 100nm offset from the original point along the surface normal for auto-lazer function because sometimes it would intersect itself and report incorrect length
* Separated all measurement related rendering into a separate 'Overlay' pass. We now have better control over the rendering order of the individal elements of the measurement gizmos. This fixed the issue of having the measurement line overlap the end points
* Billboarded shaders now also work correctly with section planes
* Measurement tool no longer considers surfaces clipped by the section box
* Implemented correct raycasting for billboarded and fixed sized bibboarded objects, like the measurement's text
* Implemented zooming in to measurements when double clicking
* Big update to measurements which addresses most if not all requirements regarding UX/UI, API, and generaly functionalities. Additionally, a fix or an ancient issue in Units where kilometers were incorrectly calculated, and added automatically resolution updates to the SpeckleLineMaterial
* Added dpr factor into billboard size calculations. Fixed an issue with the round rect geometry generation function which would fail on macos. Added the billboard text background size into the text's style so it's configurable
* Text can now be updated for perpendicular measurements also when in it's complete state
* Fixed an exception which was thorwn when double clicking on another measurement while measuring
* When changing the measurement type while the measurement is still in it's dangling start state, the measurement gets cancelled and a new one with the new type gets started. If the measurement is in it's dangling end state, then it does not. This is now forge viewer does it
* Implemented screen space surface normal indicator line
* Measurements now work on visible and non-ghosted objects. Removed the surface normal indicator from the point to point measurement
* Fixed an issue with orthogrtaphic camera and NDC normal computation. Implemented fixed sized gizmo disc for orthographic camera
* Fixed an issue where the pipeline would not get properly reset after zooming in orthographic mode
* Fixed some regressions with the pre-existing application measurements functionalit and text. Fixed an issue where auto-lazer measurements were not vertically centered.
* 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
* feat(fe2): diffs wip
* 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
* feat(fe2): de-dupes diff results
* feat(fe2): wip diffs
* feat(fe2): diff transparency goes from 0 to 1
* feat(fe2): diff results display work
* feat(fe2): diff results display work
* feat(fe2): diff panel work
* feat(fe2): diff work: various display changes, coloring toggle, selection logic, selection object display wip
* feat(fe2): diff work: cleaned up old/new version, fixed minor bug in viewer diff time when swapping color mode
* feat(fe2): diff work: implements custom selection logic and selection display for modified objects (they come in pairs now)
* feat(fe2): diff minor fix in selected object display
* feat(fe2): wip; trying to fix diff order to be consistent (ordered by date)
* feat(fe2): wip, broken state right now
* feat(fe2): fixes scrollbars in viewer
* feat(fe2): fixes slider sync with diff time
* feat(fe2): WIP syncs of diffs (threads, refreshes, etc.)
* feat(fe2): diffing polish
* speckle shared fix
* speckle shared fix
* more bugfixes
* linter fixess
* more CI fixes
* fix viewerState serialization
* more linting fixess
* template fixes
* moving tailwind classes to theme package
* migrated away from diffString + simplified postSetup
* moved diff new/old version resolution to use state.resources
* cleanup
* updating url threadId & diff command correctly
* minor improvements to diff state
---------
Co-authored-by: AlexandruPopovici <alexandrupopoviciioan@gmail.com>
Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
* 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