Commit Graph

611 Commits

Author SHA1 Message Date
Alexandru Popovici 07dff717cf Colored Points by Properties Fix (#2436)
* Fix for points not getting the gradient texture with the colors when filtering by properties

* Allowed Points to use displayStyle
2024-06-26 13:27:31 +03:00
Alexandru Popovici f844b6d22e Viewer Navigation (#2416)
* Added model-viewer's orbit camera control implementation. All the features from the old orbit controls are now functional with the new one

* Figured out the relation between radius and fov. Added zoom decelariting when getting closer to origin. This feature was present in the old controller but lacking in this one

* WIP

* Added infinite zooming

* First version of infinite zoom and zoom to cursor

* A few improvements on zoom to cursor. Inifite zoom and zoom to cursor now work together. Simplified the implementation

* Added orthographic camera functionality in the controller without hte special features

* Zoom to cursor now works with orthographic projections. Switching between perspective and orthographic while keeping all functionality correct now works

* Minor cleanup a ton more to come

* Added controls dampening in the sandbox

* Adapted frontend to the new controller plus some additional changes to the controller options in general

* Implemented setting inline and polar viewers. However mosts of the time spent was dedicated into understanding why the frontend checks for changes in the camera each frame, and if it finds one forces the camera viewer to the inline one. I haven't figured out why it's doing this and it seems very wasteful. There probably is a better way of achieving the same thing

* Orbit Controller now computes it;s cartesian value based on spherical in a function so it can be used in multiple places. Replaced getting the current camera position with the target camera position in frontend frame update callback as the old camera controller did

* Follow mode now works properly

* Sandbox fix

* Disabled debug spheres

* WIP on fly controls

* Correct basis transformations for fly controls

* Added QE up/down movement to fly controls

* Minimum radius is now dynamic and accounts for scene size

* Fixed an issue with zooming to cursor when infinetely zooming

* Fixed inconsistencies between zooming normally and infinetely for both zooming to cursors and otherwise

* Further fixing zooming to cursor when infinetely zooming

* Zoom radius modulation

* Fine tuning zooming radius and wheel modulation. I think I got to some defaults that seem good enough for all scene scales.

* Defaulted to 30ms decau time for dampers

* Added a 'tasOnly' argument in all 'intersect' variants. This will only intersect the TAS(es) and provide an intersection result. When requesting an intersection with 'firstOnly' set, onyl the first intersected TAS will be queried further and it's first intersected BAS will provide the intersection result. Conditioned zooming to cursors by needing to have any geometry under the cursor; Fixed some small issues with  functions in the acceleration structures.

* Restricted intersecting onyl when zooming

* Geometry intersection when zooming does not affect infinetely zoom anymore, only zoom to cursor

* Temporary disabled firstHitOnly

* raycastFirst now works correctly in the context of tasOnly param true or false

* Added dampers to the fly controls so we have consistency across various camera controller types.

* Added statinary function

* WIP on controls

* Debuging orbit controller issues on ipad

* More consolidation work on the interface for SpeckleControl and our current implementations for it

* Added controller toggle-ing

* Making the controllers work from immediate data

* There are no more spaces left I can transform from/to. Done them all. Works fine now essentially. Just need to clean stuff up

* SpeckleControls now provide an 'up' vector, and basis transformation is computed that way rather than requirig a mat4 directly. Fixed two issues with event locking on orbit and fly

* More cleanup, more fixes, more grind

* Controllers now have consistency in the basis they provide the position and target into. As well as the fromPositionAndTarget function. It will always be in a basis where (0,1,0) is up. This is required because certain parts of three.js assume that basis

* FlyController is now properly relative-itiez

* Sorted out options for both controls. Dampening is now done via options

* Small fixes for frontend integration

* Fixed the issue with quaternions misaligning around PI

* Added consistent orthographic resizing

* Fixed camera focusing when in orthographic mode

* Implemented disabling/enabling rotations with the new controls. Removed PolarView since it was never used. Canonical views WIP

* Made the HybridCameraController with the simplest implementation possible that seamslessly combines both camera controls. This is for testing to get an idea about how it feels. Removed zoomToCursors when not on geometry. Increased regular zoom speed

* Using constants since move speed is a modifier

* lock fix

* Removed HybridCameraController. Increased maximum zoom. Removed toggling camera controls with Space. New way to apply canonic views, this time a correct one
2024-06-25 15:21:47 +03:00
Alexandru Popovici 829a1965b3 WEB-1096: DataDog Errors (#2409)
* We're now catching possibe QuateExceeded errors from IDB in the local storage

* findId with undefined or null id now returns null

* cacheStoreObjects now returns a promise regardless
2024-06-20 12:38:33 +03:00
Alexandru Popovici 5472896fce Fixed WEB-1104 (#2370) 2024-06-14 00:26:40 +03:00
Kristaps Fabians Geikins b115a7b4c0 fix(fe2): some bugs causing errors/warnings in FE2 build (#2365) 2024-06-13 13:19:43 +03:00
Kristaps Fabians Geikins 83d8035dc2 chore: upgrade to eslint 9 (#2348)
* root + server

* frontend

* frontend-2

* dui3

* dui3

* tailwind theme

* ui-components

* preview service

* viewer

* viewer-sandbox

* fileimport-service

* webhook service

* objectloader

* shared

* ui-components-nuxt

* WIP full config

* WIP full linter

* eslint projectwide util

* minor fix

* removing redundant ci

* clean up test errors

* fixed prettier formatting

* CI improvements

* TSC lint fix

* 'buildBatch' needs to be async since some batch types (like Text) require it. Removed a disabled liniting rule from ObjLoader

* removed unnecessary void

---------

Co-authored-by: AlexandruPopovici <alexandrupopoviciioan@gmail.com>
2024-06-12 14:38:02 +03:00
Alexandru Popovici 632068768d Enabled outlines for highlight effect (#2354) 2024-06-11 15:13:09 +03:00
andrewwallacespeckle 899c0baf4e feat(fe2): Highlight objects on hover (#2322)
* WIP - Need to confirm with Benjamin & Alex

* feat(fe2): Models and Filters Highlighting

* feat(fe2): highlight object on hover of selection info

* refactor: use composable for object highlighting in Viewer components

* Remove from StringFilterItem.

* Update StringFilterItem.vue

* Fix for selection issue that happens when you select something from the tree explorer that is already being selected by it's parent and also highlighted with the mouse

---------

Co-authored-by: AlexandruPopovici <alexandrupopoviciioan@gmail.com>
2024-06-07 14:26:49 +02:00
Alexandru Popovici 8f12e0a5a8 WEB-1018: Outline Only Fix (#2314)
* Possible fix. Material visibility comes first, and is separate from colorMask when deciding the ordering of the objects inside the batch

* Reverted screenshot debug button
2024-06-06 20:36:41 +03:00
Alexandru Popovici 9cd649d067 Fixed line selection that didn't work for some lines (#2328) 2024-06-05 15:31:48 +03:00
andrewwallacespeckle d8d1173c38 fix(fe2): View menu not outputting correct names (#2298)
* fix: use view.view.name rather than view.name

* Remove headlessui from Views Menu to prevent close on click

* Fix mobile view

* Remove unused active ref

* Update SpeckleView type to include view.view.name

* Changed the SpeckleView type to no longer use the legacy structure. It's now just another SpeckleObject with some extra props which may or may not exist

* Adapted the viewer library and sandbox to the current SpeckleView model

* Use new SpeckleView. Remove old truncation method.

---------

Co-authored-by: AlexandruPopovici <alexandrupopoviciioan@gmail.com>
2024-06-03 12:04:11 +02:00
Alexandru Popovici cd5a8b9779 Flickerless Depth Texture Read (#2300)
* Added extension for readingfrom the depth framebuffer. So that when getting the depth for gendo the image doesn't flicker anymore

* Updated the fronetend to use the new PassReader extension

* Removed PassReader from sandbox. Catered to typescript
2024-05-31 11:13:27 +03:00
AlexandruPopovici e256d6766d Updated the ExtendedSelection from sandbox to latest version. InstancedBatchObject type is now being exported. Fixed an issue where instances were not having their runtime transformations updated. Fixed an issue where transparenct objects were incorrectly casting and receiving shadows 2024-05-24 19:32:20 +03:00
Alexandru Popovici ec78d316bb Viewer API Improvements (#2072)
* Fix some monstrous bugs with index buffer shuffling now that we've changed our approach a bit.~

* Finished with the new material management approach for mesh batches. SelectionExtension now uses this approach and also considers existing material opacities when setting select and hover materials

* Updated LineBatch to work with the new material management approach

* Implemented the required draw range related changes to the point batch

* Text batche now work with the new material management

* SpeckleLineMaterial and SpecklePointsMaterial are now SpeckleMaterial as well. Had to rename two properties of SpeckleMaterial due to some typescript named property clash thing, but nothing really changed

* Removed eslint-disable clauses in materials where they were no longer needed. Removed unused imports and overrides

* Added the RTE define for some materials by default. It can still be overriden if users want to

* Stencil outlines is now an toggle-able option for any SpeckleMaterial. Restricted to meshes

* Implemented setting desired material for all geometry types via RenderMaterial and DisplayStyle data. SpeckleRenderer now has three overloaded setMaterial function. One for a material instance, one for a filer material and one for RenderData&DisplayStyle. Moved material hash related functionality from NodeRendeView into Materials

* Added MaterialOptions which can be used when setting materials based on RenderMaterial/DisplayStyle to toggle various material features like stencilOutlines, pointSize. SelectionExtension now uses data material to set materials, and things are so much more simpler and nicer

* Added public method for setting seletion extension options

* After some profiling, realized three.js was doing a lot of pointless work each frame so now we're caching materials created from RenderMaterial/DisplayStyle to avoid this. Perf is nice and sharp now

* addRenderTreeAsync is now a generator. Handled automatic zooming on viewer loading. Disabled section tool by default

* Centralized RTE and shadow RTE buffer in an extended webglrenderer. This avoids re-computing rte data for each material over and over. Also, rte data is now centralized and available to materials

* SpeckleMeshes now use a cached material clone as their batch material like any other material they use

* Cleaned up Materils. Updated the debug show batches function use the new material manipulation system. So much easier now

* Real time measurement exist now as a separate extension. Existing functionality preserved, besides one or two small additions. Renamed the MEASUREMENTS object layer to OVERLAY for a more generic usage. SelectionExtension can now be enabled/disabled. Added an additional overload to the setCameraView method in ICameraController which takes a box3 as target to focus the camera on

* Removed viewer related events from input and replaced them everywhere with the proper input event types where required

* Fixed two issues with the shadowcatcher. One was a regression introduced after we centralized the RTE data. The other was a super old one one and was essentially causing the shadowcatcher to generate the contact shadows incorrectly because the correct transform textures were not bound (this is three.js being a pain)

* WIP on the filtering extension

* FilteringExtension is done. Kept the same implementation

* Added filter reset function

* Removed uniform texture and batch count binding from each material's OnBeforeRender function. Additionallit our material override function from SpeckleMesh now uses our fast copy instead of three's copy function for materials. This decreased CPU overhead each frame by 20+% and also eliminated the ugly call to SpeckleMesh's function for updating the material with the transform texture and batch object count from each material's render callback which was not supposed to be there

* Update RenderingStats to measure CPU render time per frame.

* Added early and late update functions for extensions. First gets called before the core's update, and the latter afterwards

* All speckle materials now use the centralized RTE data. Updated the fasts copy method to copy userdata defined uniforms where needed

* Added explosion extension. Additional cleanup

* Dirty transforms are marked on a per batch object basis, whenever their transforms gets changed. This automates the transform texture update execution, so we no longer need to manually mark entire batches as dirty

* Added getObjects which returns all batch objects in the scene and getObjects which takes an rv an returns only the batch object associated with that rv. Both of these methods are availale on the renderer

* Added setters for position, rotiation and scale in batch object

* Diff extension is complete. We stuck with creating material instances and using those for coloring since it ensures maximum draw call efficiency. Fixed an issue in MeshBatch where transparent draw groups were not always sorted at the end of the group list leading to incorect opauque object selection during the depth pass

* RV batch materials are obtained via the viewer-core API based on the RV itslef. This removed the need to get all batch materials for the differ

* Small cleanup

* Removed all circular dependencies besides one, like I predicted. The final one will dissapaear on it's own in the near future when we'll gracefull make DataTree obsolete. As a note, the circular dependencies were very shallow, reffering to enums/interfaces/statics declared in specific files. There was no real circular dependency on a class level

* Removed last circular dependency just for the sake of completion

* SpeckleRendere now has a clipping volume which is used internally to reject picks outside of it, and it's also exposed to the outside world to be used however

* Implemented the SpeckleLoader along with it's abstract supertype. Data loading is now done through this loader which handles tree population with raw data as well as render view data.

* Working minimal obj loader

* Added total node counting and displaying

* Viewer's load object now takes a loader of any speckle loader base class and uses that to load, instead of taking urls and tokens. This allows for any kind of loader to work with the vieweer's load function. Moved indexing of obj geometry to the obj geometry convertor. Loaders now take the target world tree instance instead of a viewer instance

* Loaders can now load from string and array buffer data where implemented. ObjLoader can now load from a string payload. Sandbox can now load obj files from the UI using a file picker

* alex/API2.0-core

* Started on #1673. Fixed an issue with walkAsync where the recursive generator would waste too much time idle.

* Solution for #1673. Replaced the old async pausing approach with a better version that has true variable wait time, and does not add additional dead wait time. Render tree building is now several times faster

* Cut down some more on load time by using a lookup table for determined speckle types. For a very large number of objects, getting the actual speckle type was quite slow. For our reference stream with 1kk objects we cut down around 2 seconds of load time

* BoxFromObjects now returns the correctly transformed aabb

* Implemented optimisations for batch building step from the loading process. Reduced the step's time by around 50%

* Implemented a NodeMap which allows us to search for nodes very very fast.

* Added a dynamic pause in the loader which stops the converter from blocking. Paramater object types are not added as nodes anymore. Callback from converter is not without arguments

* Replaced some internal walks with the newer and much faster id finding approach

* Disable object shallow cloning acrss the speckle converter

* Fixed the issues with block instances and revit instances caused by not duplicating speckle objects in the converter

* getObjectPropertis is now async and slightly improved the execution time of the flatten function which it uses

* Set caching to true by default

* Fix for display style hashing

* Implemented legacy viewer as a wrapper around the old viewer API

* Started testing FE1 with API 2.0. Fixed some legacy issues. Also the camera controller extension now exposes it's underlying controls object for the sake of not messing around with unwatend changes in FE1

* Updated FE1 with API2.0 selection changes

* Fixing selection bugs

* The viewer now ignores duplicate id nodes

* Fixes to object properties population, camera zooming and adding subtrees in core

* Fixed some filtering issues. Added UpdateFlags to the viewer's requestRender function

* Fixed an issue where section boxes were incorrectly added to the URL

* Objects with no id are not given nodes into the tree

* Updates to FE2 for API2.0. Also fixed a really really obscure bug in viewer-core where a material an incorrect material was set when reseting the batch to the default material

* We now store separate node maps for each model loaded. Each node now holds it's subtree id (as a small number for memory considerations)

* Render request after updating the visual diff

* Fixed some missing update calls on shadows

* Reverted FE1 changes and pinned the viewer library to a specific (latest) version pre-API2.0

* We're adding a viewer node for loaded models as subtree parent. This is because we're no longer spoofing ids and the model parent id needs to be preserved

* Fixed an issue where clicking on a comment bubble made the pipeline use accumulation improperly, leading to dark blight

* Null check for setMaterial. Fixed another case of dark blight. Hack required by frontend

* Fixed the issue with filtering state not propagating in the FE

* Updated selection event changes

* Fixed an issue where an undefined subtree id would yield an incorrect render tree upon requesting it

* Fixed an issue where undefined nodes were returned as valid when searching of ids

* NodeRenderView now holds it's subtree id along the speckle id. This allows for precise node matching when looking for specific nodes

* Fixed an issue with BlockInstances not instancing underlying meshes from breps

* Some fixes to diffing. Some older than API2.0, some new. Render views now have guid composed of their id and subtreeid.

* Update node render view id with guid where needed

* Unload function now checks for requested resource to unload before trying to unload it

* Check for the existence of a batch before applying draw ranges. Inthe FE, extension can temporarily keep dead rvs in their state when switching between streams leading to errors

* Fixed an issue for filtering where subtree roots would cause incorrect rv additions to the ghosted rv lists

* Unified block instance and revit instance conversion implementation

* Separted instanced from non-instanced rvs. Working on InstancedMeshBatch

* WIP on instanced types

* Implemented visual for box draging

* BoxSelection extension beautified and documented along with some small but welcomed changes to the viewer-core

* Viewer's getExtension now looks in the prototype chain before returning an undefined extension

* Added the extended Selection extension here for possible later use

* First iteration on instancing. General idea works. Still WIP on several fronts

* Fixed issues related to incorrect transform being calculated for instanced geometry. Fixed an issue with incorrect bounds being calculated

* Fixed a few issues with instanced vs non instanced render view gathering

* Disabled box selection extension

* Fixed some linter errors

* Disabled a lint 'error'

* Fixed issues with depth rendering and instanced objects and fixed draw range visibility for instanced batches in a minimalistic way

* Updated the measurements extension with the visiblity option

* Restructed a bit our implementation for the acceleration structure because now the BLAS needs to aggregate an instance of three-mesh-bvh not extend it. So that instanced batch objects can share a single bvh instance -> no redundancy

* WIP

* Revert "WIP"

This reverts commit 20d4bbf6210b0d37b956cc5b41fdb06f29845b4f.

* More WIP on trying to make instanced geometry TAS and BAS work properly

* Both Tas and Bas intersection testing seem to working fine. Now we need to implemented draw grouping for instanced mesh batches

* Added draw group management to InstancedMeshBatch. It works in the same manner as for non instanced batches, but the offset value refers to instances not triangles. I believe it could be simplified, but I'd like to get it up and working first

* Draw groups need to hold the index and count from the instanced buffer attribute

* Added array shuffling to the instanced mesh batch using the same approach we used for the non instanced one.

* Instanced batches now dynamically add InstancedMesh objects based on draw groups and a computed transform buffer

* Applying draw range updates for instanced batches now works. Still some issues to handle. It aint much, but it's honest work

* Disabled some more RTE until setting visibility for draw ranges is finished

* Moved getting opaque, transparent and stencil draw ranges out from Batcher and on to a per-batch basis. Now instanced batches correctly apply draw ranges and get their opaque, transparent and stecil ranges

* Fixed an issue with setting the visibility ranges for instanced mesh batches

* Instanced attributes for instanced meshes now no longer allocate

* Shadow depth material for instances is now set in the speckle renderer

* R-enabled RTE globally. Made instancing work with RTE. Made instancing work with both RTE and shadowmapping.

* Fixed an issue with materials building up in the mesh batch's cache incorrectly

* Implemented gradient indexs attributes for instanced batches. Thismeans, any color ramp based material like the ones we use for filtering now works

* Changed the way compound ids are created for instances, so that less memory is required. i.e chrome is not crashing anymore on particular streams

* Implemented reseting the draw ranges for instanced mesh batches. We no longer double buffer the gradient index buffer. We just create a new one when shuffling, populate it, then copy it over at the end. We're still double buffering the transforms buffer since that one is larger and we might not want to allocate it each time we shuffle

* Removed references of draw groups with ids since we're not doing that anymore. Fixed an issue with mesh batches where the material cache would keep piling materials incorrectly

* Several issues with selective transformations on instanced batches fixed.

* Added default null materials for instanced meshes both with and without vertex colors

* Got rid of the patched InstancedMesh because it was ridiculously slow. Instead we're now computing the scene box using our acceleration structures where available and three.s boundingbox where not available

* Minor, yet big regression fix

* Fixed regression

* Exported some extra types

* WIP on instanced balancing

* Instanced objects under a certain threshold now get batched together as regular mesh batches

* Forgot to update the rvs aabb

* Unified instanced and non instanced batch creation. Instances which do not qualify for instanced batching anre now mixed together with the rest of the non instanced batched objects

* Added some timing information to instanced batches

* Fixed an issue with zooming in on objects not working in the selection extension. Fixed an issue with object picking failing due to fp precision for objects right at the edge of the clipping volume.

* Removed logs

* Update stream moving via UI

* Removed the priority argument from loadObject since it's not needed anymore

* Updated LegacyViewer

* Fixed an issue with API 2.0 where the legacy form of transforms with only an array of values as the matrix would not work

* Updated FE1 viewer package to latest before API 2.0

* Disabled selection when measurement mode is on

* Updated ibl params updating

* Fixed an issue with measurement text not showing up

* Logs

* lockfile

* Made DataTree obsolete. Removed unused 'input' property from viewer

* Fixed circular dependencies

* Removed DebugViewer, other small changes

* Small changes

* Small fixes

* Added id to NodeData

* Removed unused bounds property in rendertree

* Notes to future self + ExtendedExtension is now exported

* Removed an unused function from renderer. Removed the parent argumetn from getRenderViewerForNode... since it was legacy and has no meaning anymore.

* Removed the instance type check in getRenderViewesForNode method. Should not be needed anymore and it was bad to begin with anyway

* Removed some test code

* Small changes

* Removed pointless bounds calculation. Added note

* Added return types

* Ingestigating large group operations

* Nested nodes from TreeNode are now optional. Small update to node render view.

* #1818 Remove the concept of speckle data existing behind a 'data' field

* Removed unneeded property

* made arguments options in transformTRS

* getBoundingBox from acceleration structures have an optional argument now

* Several Batch methods no longer take variable numbe of arguments, but arrays now

* Added note

* Note

* Removed unused things

* Note and made the raycaster protected in intersections

* Added some typings

* Replaceds some functions with accessors. Added typings. Renamed stuff

* Removed some unused properties.

* Typings for measurements

* Small typing changes

* Fixed some more compile errors

* Sources from 'batching' folder are now strict compile compliant

* Sources from 'materials' folder are now strict compile compliant

* Sources from 'extensions' folder are now strict compile compliant

* Sources from 'tree' folder are now strict compile compliant

* Viewer interface, implementation, legacy implementation and the exports now comply with the strict compilation flag. Also added the new tsconfig

* Sources from 'objects' folder now comply to the strict compilation rules

* Sources from 'pipeline' now satisfy the requirements for strict compilation

* Sources from 'loaders' folder are now compiling with strict. That was so much fun

* Sources from 'query' folder are now compiling with strict

* Another round of correction triggered by previous changes

* Update the declaration file in the object loader to contain a member that needs to be public

* SpeckleRenderer along with the rest of the surces from the root 'modules' folder are not compiled with strict

* Completely deprecated DataTree. Updated the dependencies with @types/underscore. Fixed remaining compilation issues

* Fixed a failing build on the CI regarding a timeout id

* Fixed compile errors from sandbox

* Another fix

* All EventEmiter child classes now have mapped event handler argument types, so that when attaching to a specific event, the provided handler has the correct types for it's arguments. Implicitly, got rid of the the unknown types in all event handlers.

* Disabled verbatimModuleSyntax because it was messing things up. Fixed an issue with an improper import

* Fixed frontend-2 linting errors. Also added all the event payload maps to the viewer export

* Some good additions but mostly typescript catering

* Some more typescript catering, but also something useful. The intersect function is now overloaded so that when you specify only the ObjectLayers.STREAM_CONTENT_MESH object layer in it's layers argument it will always return a ExtendedMeshIntersection which guarantees to have a batchObject, face and it's object is of type SpeckleMesh | SpeckleInstancedMesh. Generally you mostly raycast against meshes and getting a three.js intersection object which has all it's fileds optional led to some very useless defined checks. With this we can avoid all of them

* Continued from yesterday, finished with the changes in intersections. Added MeshIntersection which is returned by all bvh intersections. This eliminates the need to check for face, faceIndex or index on intersection results from intersection meshes. Groups from MeshBatch and InstancedMeshBatch are now always DrawRanges(they always were)

* Mostly catering to typescript

* Removed underscore and all unused dependancies. Fixed remaining lint and build errors

* Minor changes

* Added the no-non-null assertion rule to the sandbox

* getExtension never returns null, but rather throws an exception if requested extension does not exist. Added hasExtension for (theoretical) situations where you want to check for extension existence but don't want to go by try/catch with getExtension. Fixed remaining lint/build errors

* getBatches now returns explicit batch types based on the geometry type that you provide

* Adding the lockfile

* undoing unnecessary FE2 changes

* Merged viewer/fe SpeckleObject types

* Fixed two small issues

* Minor linting issues

---------

Co-authored-by: Kristaps Fabians Geikins <fabians@speckle.systems>
2024-05-07 15:18:38 +03:00
Alexandru Popovici d82fbb48cf AEC Aesthetics Post-Feedback (#2239)
* Addede a bunch of abstract hdris as well as the option to cycle cle though them at runtime

* Added an extended PMREMGenerator that allows for the rotation of the hdri image.Now our IBL sources are finally straight not tilded 90 deg anymore. Added artificial shininess to all objects configurable in real time from the sandbox.

* Added color grading operations to our standard shader and material. Updated the sandbox to reflect the required AEC Aesthetics properties

* Restored the sandbox parameters to their original locations. Saturation, contrast and shininess are now in the 'post' folder and the hdri dropdown in the 'indirect light' folder. Cleaned up and renamed the available hdris to their descriptive names. The 'Mild' hdri is not set as the default one at library level

* Disabled color grading from the speckle standard material shader. Implemented the artificial shininess as a real thing that the user can control
2024-05-02 16:00:02 +03:00
Alexandru Popovici af8c3e1a14 New URL formats in URLHelper (#2229)
* URLHelper now supports both old and new speckle URLs. Moved URLHelper to the viewer library so users can use it to transform speckle urls in loadable object urls. Disabled object-loader from reading the local storage for auth tokens.

* Added URI decoding

* Error checking. URLHelper is not a class anymore

* Queries are not run in parallel
2024-04-26 11:02:14 +03:00
Alexandru Popovici ab56bc1abc WEB-770 (#2227)
* WIP on computing a general purpose relative offset

* Implemented a size-invariant way of getting relative offsets that relies on the world size for the offset value

* Relative offset is now calculated based on relative size instead if world bounds. This makes it work correctly for streams with small far away from origin objects
2024-04-25 15:48:18 +03:00
Alexandru Popovici 1010c9d23a AEC Aesthetics (#2225)
* Addede a bunch of abstract hdris as well as the option to cycle cle though them at runtime

* Added an extended PMREMGenerator that allows for the rotation of the hdri image.Now our IBL sources are finally straight not tilded 90 deg anymore. Added artificial shininess to all objects configurable in real time from the sandbox.

* Added color grading operations to our standard shader and material. Updated the sandbox to reflect the required AEC Aesthetics properties
2024-04-23 09:56:05 +03:00
Alexandru Popovici d51f460c67 DiffExtension no longer re-focuses the camera on the scene when diffing by itself (#2214) 2024-04-18 16:20:43 +03:00
Kristaps Fabians Geikins 57a7d2206b fix(viewer): broken import to dep (#2196) 2024-04-08 11:14:36 +03:00
Alexandru Popovici d7f0325192 Extension Access Changes (#2193)
* Removed the concept of Providers entirely. Now extentions specify explicity extention types or archypes in their inject lists. Removed the concept of core-extensions entirely. All extensions are now equal. The concept of CameraProvider was replaced by SpeckleCamera which the SpeckleRenderer now uses and relie on the default camera controller extension to seed it.

* Fixed some compile errors

* Fixed compile errors. Had to make Extension concrete, but meh, it's fine I guess

* fix viewer types

* Removed generic arguments since they're no longer needed

---------

Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2024-04-05 18:07:02 +03:00
Alexandru Popovici 79cd985cc7 Textures of all types can now only be loaded by providing an Asset type. Asset now has a mandatory string id. Assets no longer caches the IBL PMREM texture, but the HDRI textures themselves because the PMREMs were only stored in video memory and when read from cache with a different viewer instance they would fail resulting in null IBL (#2192) 2024-04-04 15:16:32 +03:00
Alexandru Popovici 4ee8a3f8f6 Fixed an issue with material indices edges were not being computed correctly. Added test (#2188) 2024-04-03 11:50:55 +03:00
Alexandru Popovici 9c481a20f5 WEB-695 Batching Maintenance (#2182)
* Starting to tackle WBX-397 by taking a different approach on computing draw ranges

* WIP

* Range computation is more or less done. Material indices still need a more robust approach

* Range material indices figured out mostly by trating them as edges in a graph. Also some profiling to max out pergf

* Added forward and backwards material index edges in order to be able to directly look them up rather than searching for them in an array

* Extended the new draw range integration approach to instanced batches

* Added vitest and wrote a first test for the DrawRange integration approach. Fixed some cicular dependencie which were messing up vitest runtime.

* A bunch of more tests

* Removed unused dep

* ci(viewer): test the viewer in CircleCI

* Include test-viewer as a dependency of later jobs

* Small updates

* Removed old range integration from all three batches

* Working on making the range update integration work on an array at a time

* Update range integration now works on entire arrays at a time. Almost twice as fast this way. Updates tests

* DrawRanges now also flattens the computed draw ranges, so we got rid of the old ugly way of flattening the ranges. Update MeshBatch, PointBatch and InstancedMeshBatch

* More adjustment to point batch

* Implemented a common PrimitiveBatch which can be used for any typical primitive based rendering (triangles, lines, points) as abstract. Our Mesh and Point batch will use most of the common implementation. Updated MeshBatch to extend PrimitiveBatch

* Updated PointBatch to extend PrimitiveBatch

* Tried making the instaned mesh batch extend the primitive batch but there was no point, they too different to make sense. Got rid of the pointless circular dependency between the instaned batch and mesh

* fixed viewer build

* Removed unused code and execution time measurements

---------

Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2024-04-02 15:48:01 +03:00
AlexandruPopovici d25416d44a Fixed WEB-745 2024-04-01 13:15:17 +03:00
Alexandru Popovici aeaf43bd6d Fix for #WBX-435 (#2148) 2024-03-25 15:45:05 +02:00
Alexandru Popovici 37a94faa6c Measurements fixes (#2141)
* TAS does not only test for intersections on front facing triangles anymore

* Raycasting against a billboard speckle text before it's first frame is rejected

* Handled WBX-353. Fixed an issue where measurement gizmos were given incorrect screen sizes. Possible fix for incorrect NDC normal calculation for perpendicular measurement normal indicator. Needs more mafs

* When computing the perp measurement's normal line indicator we don't apply the perspective divide anymore after computing the normal in clip space. This fixes the issue where -Y normal direction was almost never correctly reported

* Removed log
2024-03-19 14:03:17 +02:00
Alexandru Popovici 5374b5fb98 Hidden Object Outlines (#2140)
* WIP on WBX-383

* Implemented stencil outline only material as an option in MaterialOptions. The depth pass now uses explicit depth only visibility lists instead of the opaque ones.
2024-03-19 13:41:30 +02:00
Alexandru Popovici 74ffb45428 Draw range error fix (#2138)
* Fix for draw range issues for more complex combination of filters. Don't like the current state, rework overdue

* Added a rebar model
2024-03-19 12:41:18 +02:00
Alexandru Popovici 0bc423c71f Measurements extension now has accessors for active and selected measurements (#2110) 2024-03-14 10:32:36 +02:00
Alexandru Popovici 9b21f95498 Fixed a possible source of hardlocking (#2126) 2024-03-13 19:21:45 +02:00
Alexandru Popovici 92d9dbd948 Selection state is now preserved after other filtering operations are applied (#2114) 2024-03-13 13:10:14 +02:00
Alexandru Popovici 3476fb651a Viewer lib Material fixes (#2095)
* Fixed WBX-341

* Fixed WBX-342

* Fix for WBX-343. Unused materials no longer pile up in MeshBatch materials

* Unused materials no longer pile up in InstancedMeshBatch materials

* Moved material cleaning at the begining of draw groups flatening for both instanced and non instances batches. Added a cached material lookup table for both instanced and non instanced speckle meshes. This fixes the issues with setMaterial and material instances we were seeing when diffing

* Handled WBX-356 and WBX-357. Most important change here, is adding behavior for when a new draw groups is set which engulfs other existing draw groups. The previous lack of implementation for this particular case made filtering (for example) assign materials incorrectly

* Fix for WBX-358. Line batch materials were not setting their opacity

* WIP on fixing some issues with selection + coloring
2024-03-12 11:04:50 +02:00
Alexandru Popovici 3860bf4737 WBX-135 Camera Planes (#2043)
* Handled WBX-55

* Fix for WBX-53

* Fixed WBX-160

* Fixed an issue with section box comments where an unwated margin was applied. Fixed an issue where objects were not sliced when opening a URL that had a comment + section box. Fixed an issue where the object with a comment attached would not select when opening it directly from a comment URL in FE2

* Fixed WBX-132

* Added wo methods for computing camera planes. One is implemented in the CamerPlanes extension, it's dynamic and it's scene geometry aware. The other one is empiric and only takes a box3 volume into account
2024-02-28 09:21:44 +02:00
Alexandru Popovici 0a078a3fc7 WBX-8 Viewer fixes (#2083)
* Fixed WBX-341

* Fixed WBX-342
2024-02-27 17:32:31 +02:00
Alexandru Popovici d5c2479ef9 Coloring issue (#2048)
* Potential filter material options are now preserved after flattening draw ranges

* Default stream
2024-02-17 12:08:51 +00:00
Alexandru Popovici fef908f5ee LegacyViewer now supports highlighting objects like the old API would (#2045) 2024-02-15 14:40:44 +02:00
Alexandru Popovici 0454b39cfc WBX-8 Viewer-lib bugfixes (#2041)
* Handled WBX-55

* Fix for WBX-53

* Fixed WBX-160

* Fixed an issue with section box comments where an unwated margin was applied. Fixed an issue where objects were not sliced when opening a URL that had a comment + section box. Fixed an issue where the object with a comment attached would not select when opening it directly from a comment URL in FE2

* Fixed WBX-132
2024-02-14 20:33:15 +02:00
Alexandru Popovici f2f278d09c Added clearMeasurements functionality to the measurements extension (#2028) 2024-02-09 20:33:02 +02:00
Alexandru Popovici 549da1516c Added a check to make sure entire instance sets are considered for hw instancing, and also a check for each instance transform (#2026) 2024-02-08 10:27:28 +02:00
Alexandru Popovici 334f6a4239 Improved insolation speed considerablyby using newer methods for looking up nodes and ids (#2008) 2024-02-07 23:30:53 +02:00
Alexandru Popovici 6a5f7bb031 Added a default null text material to Materials. TextBatch now returns correct bounds (#2016) 2024-02-07 23:29:05 +02:00
Alexandru Popovici 666aa2d736 Fixed compile errors in sandbox (#2023)
* Fixed compile errors in sandbox

* updated viewer readme
2024-02-07 15:39:40 +02:00
andrewwallacespeckle ff6433128a FE2 - Embedding (#1979)
* Add Dialog

* Add options to embed dialog

* Min Height of Clipboard Input multiline to 3 lines

* Check for visibility

* Link to change access of project

* Rename to guided mode

* Change icon when user clicks copy button

* Update Menu styles based on agi feedback

* Update graphql.ts

* Embed Options as hashState

* Auto grow Clipboard Input

* embed state and more options

* Tidyups

* Footer only shows when !embedOptions.isTransparent

* Add auto/manual Load

* Add Pre setup component

* WIP Button Group mobile

* Updates around manual load

* Viewer Share nav

* Add embed dialog to project page

* Minor fixes

* Check for federated

* Responsive Tidyups

* Responsive Fixes. Fix console issues

* Add Alert to Version Embed

* Disable Zoom

* GQL updates

* Comment Slideshow

* GraphQl changes

* Fix visibility

* Build fix

* Revert "Build fix"

This reverts commit 0e706cbd9fde78204032bb1ec4421b1742d023ac.

* remove unneeded change, revert yarn.lock

* Test Commit

* Remove commit test

* Fix build

* Update Tailwind. Add base url env

* fix for portal scope issue

* useLogger

* useLogger

* chore(fe2): include NUXT_PUBLIC_BASE_URL in deployment manifests

* lazy load optimization

* lint fixes

* Updates

* Re-add guided open Dialog sections

* Prevent login popup on embed

* Tidy up mobile combined button group

* Tidy up embed Dialogs

* Small styling issues

* Update scrolling in embed dialog

* Move selection info when embed

* Testing fixes

* Discuss in Speckle

* Responsive Dialog Changes

* Fix bug

* WIP Manual Load

* Fix nuxt errors

* Fix nuxt logger issue

* Fix embed dialog overflows

* New Dialog layout

* Responsive Breakpoint change

* Preview Image

* Fix bug with dialogSection

* Hide selection info on mobile when thread is open

* Footer Model Name

* Overflow on ClipboardInput

* Style fixes

* Tidy ups

* Responsive updates

* Responsive fixes

* Update button

* Changes from testing

* Fix embed height with footer

* Fix Dialog Section

* Fixes from testing

* Move "reset filters" on embed

* Small fixes

* Updates from CR 1

* CR Comments 2

* Updates from CR

* Add deserializeEmbedOptions helper

* DialogSection changes

* Revert changes in TextArea

* Updates from CR

* Only check for noscroll in watch

* Update useRoute

* Comment Slideshow mode

* Changes from testing

* Fix mobile share button

* onMounted warn fixes

* Updates from testing

* Remove nesting of ManualLoad

* Keep Speckle text on mobile

* minor cleanup & bugfixes

* Add target prop to Logo

* navbar flash fix + more cleanup

* Fix urls

* Footer Logo changes

* Remove viewer-transparent from layout

* Add Reply in Speckle

* Remove Anchored Points from embed

* Final changes pre CR

* Fix Anchored Points

* Update packages/frontend-2/components/project/model-page/dialog/embed/Embed.vue

Co-authored-by: Kristaps Fabians Geikins <fabians@speckle.systems>

* Fixes from CR

* Updates from cr

* Changes WIP

* Fix for dialog opening

* Changes from PR

* Updates to check embed in activity

* fix(fe2): project settings dialog error

* Make Team open section on click of "Manage"

* Fixes from merge

* Changes from cr

* Compare old to new in watch

* Fix logo in footer of embed

* Fixes from merge

* Fix build. Fix lazy load

* Updates from Benjamin

* Fix transparent bg

---------

Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
Co-authored-by: Kristaps Fabians Geikins <fabians@speckle.systems>
2024-02-06 10:38:22 +00:00
Alexandru Popovici ae7ff59d09 Object Operations Performance Improvements (#2002)
* Implemented shuffling for point batches

* Points are now drawn indexed. This is needed in order to implement shuffling for point batches, to allow for best runtime performance in scenarios where the baches are split into multiple non-flat-able draw groups

* Implemented draw range flattening before sending over to be set in batches. This reduces execution time significantly especially in scenarios where a lot of objects need to change material at once. Implemented batching of draw ranges in SelectionExtension when reseting a selection. This makes un-selecting significatly faster when a lot of objects are involved

* Added a note
2024-01-31 16:38:46 +02:00
Alexandru Popovici 2d13f737a8 Added a fix for aabb calculation for non-mesh objects (#1992) 2024-01-25 14:35:20 +02:00
Alexandru Popovici 1406465ff1 preview-service<-> viewer API2.0 (#1967)
* Pinned the viewer version for the preview-service to the last viewer version before the API 2.0 merge as a temporary solution until the preview service is updated to use API 2.0

* updated lock

* Fixed the issues with the preview-service and the new viewer version. Went with using a LegacyViewer, since it was the easiest. preview-service is weird
2024-01-12 15:23:59 +01:00
AlexandruPopovici c5a971f9de LegacyViewer now uses an adhoc extended SelectionExtension which has it's object clicked handler disabled 2024-01-11 11:44:22 +02:00
AlexandruPopovici 72b4c4cdf3 Added an 'unselectObjects' method to SelectionExtension which can selectively unselect (lol) objects 2024-01-11 07:53:54 +02:00
AlexandruPopovici 988fa767c7 Updated how MathUtils is imported 2024-01-10 16:37:51 +02:00