Commit Graph

689 Commits

Author SHA1 Message Date
Kristaps Fabians Geikins 1d2a594f0a chore: upgrade TS 5.2 -> 5.7.3 & ESLint to 9.20.1 (#4032)
* chore: upgrade TS 5.2 -> 5.7.3

* vite dts fix

* lint fix

* resolutions fix

* ui comp build fix

* precommit fix?

* latest eslint version

* autoloader fix

* undo unnecessary viewer change

* eslint fixes fe2 + trying disabled type linting

* lint fixes
2025-02-20 14:18:18 +02:00
Alexandru Popovici cd2fbd657e Fix(viewer-lib): Empty normals array force viewer normal calculation (#4002) 2025-02-18 12:57:40 +02:00
Alexandru Popovici e9997f1c62 feat(viewer-lib): Loader now allows unknown type for resourceData, so each loader can treat it the way it wants (#3981) 2025-02-13 17:32:25 +02:00
Alexandru Popovici 647141cca9 feat(viewer-lib): Added support for custom vertex normals. Moved nnormal computation from batch level to object level, handling WEB-596 in the process (#3944) 2025-02-12 23:25:45 +02:00
Alexandru Popovici 065c242ef5 fix(viewer-lib): Fixes two issues regarding very small scale streams (#3930)
- The orbit controller would not properly report changes in camera movement on a per frame basis becuase of a hardcoded epsilon which was not small enough for very small scenes. Now the epsilon is dynamically computed
- WASD-ing would jitter in very small scenes because of a too large normalization value sent to the position dampers. Now that value is also dynamically computed for small scenes
2025-02-04 17:10:07 +02:00
Alexandru Popovici f367a2ff02 Lines with Both displayStyle and renderMaterial Fix (#3913)
* fix(viewer-lib): Fixed the issue where v2 lines would not display properly when having both displayStyle and renderMaterial. Now displayStyle takes precedence

* chore(viewer-lib): Fixed typo
2025-02-04 13:03:22 +02:00
Alexandru Popovici b50f1fa43d fix(viewer-lib): Updates to WASD and orthographic projection: (#3922)
- Pressing WASDQE while in orthographic mode will no longer work. WASD-ing is disabled while in ortho
- Fixed an issue with toggling to ortho after dropping out of WASD caused by the origin beingvery close to the camera, making the orthographic size to be huge. Now when this happens, we get the minimum distance from the camera to the geometry and use that distance to compute the orthographic size. If no intersection is found, we just take the halfwy between min and max radius
2025-02-04 10:21:18 +02:00
Alexandru Popovici cff48b98c9 Comment Bubbles WASD Fix (#3920)
* feat(viewer-lib): Added  property to PointQueryResult which tells if the requested point is in frustum when projecting and unprojecting

* feat(frontend-2): Updated the comment bubbles screen location computation step to account for their anchor's inclusion in the camera's frustum
2025-02-03 17:10:24 +02:00
Alexandru Popovici 118807139b Billboards Position Fix (#3919)
* fix(viewer-lib): Fixed the issue where billboarded objects from measurements were not getting their position updated properly

* fix(viewer-lib): Disabled orbit sphere frustum culling
2025-01-30 19:19:44 +02:00
Alexandru Popovici a3d1e6adec Orbit WASDEQ Controls (#3875)
* Updated the fly controller to use the z up basis

* Fixed very important compiler error

* Removed the annoying delay when first holding down WASD keys before movement started

* Updated LegacyViewer to use the hybrid camera controls

* Added big baker

* Trying to figure out the essence of this

* Partly works

* Pivotal coordinates now work

* Smoothened out the math abit

* Fixed sandbox error

* Enabled the pivot sphere

* feat(viewer-lib): Fixed some issues with orbiting around cursor

* feat(viewer-lib): Updates to WEB-2313, orbiting around mouse cursor
Orbiting around mouse cursor now works correctly with an orthographic projection as well as when toggling between orthographic and perspective.
Disabled WASD navigation for now.
SmoothOrbitControls now has protected members instead of private allowing extension
Documented the important parts of the pivotal navigation code

* feat(viewer-lib): Mouse orbiting now takes clipping planes into consideration

* chore(viewer-lib): Fixed sandbox build error

* fix(viewer-lib): Handled WEB-2449 and WEB-2450
Additionally fixed an issue where changing the orbit pivot would trigger a hard render, adding the unneeded noise of AO re-convergence

* fix(viewer-lib): Fixed the issue with focusing and other camera animations caused by the introduction on the pivotal CS. Pivot sphere now shows only on orbit

* feat(viewer-lib): Updates on mouse orbiting:
- When clicking outside of the model, oribitig will switch to polar and use the last computed origin (which is still going to be based on the last pivot point)
Made the pivot sphere speckle blue
The pivot sphere now only shows when clicking on objects, when clicking outside of the model it will not show

* feat(viewer-lib): Update for WASD aka fly mode:
- Smoother combined navigation by using the immediate controler position and orientation as opposed the the goal ones
- Pivot sphere properly hides when in fly mode
- The bug where the camera would incorrectly jump when toggling between fly and oribit is now gone (or I cannot reproduce it anymore)

* fix(viewer-lib): Fixed sandbox compile error

* feat(viewer-lib): Added the hybrid fly orbit controller to the legacy viewer

* feat(viewer-lib): Added a slower movement speed to WASD navigation when camera is close to geometry

* fix(viewer-lib): Fixed the issue where opening the context menu while holding down a WASD key would make the camera move indefinetely

* Feat(viewer-lib): Update to WASD controls:
- Disabled cursor orbiting
- Added an option to allow for world space up/down with e/q keys. By default it's enabled
- Fixed the pan speed to work similar to WASD speed in two steps depending how close the camera is to geometry

* chore(viewer-lib): Tidied up a bit

* fix(viewer-lib): Fixed an ugly bug where the camera distance calculataion plane would flip, especially when WASD-ing, and mess up the min distance calculation which led the camera near plane to be way off

* chore(viewer-lib): Swapped E to up and Q to down

* Re-nabled cursor orbiting
2025-01-30 16:05:51 +02:00
Alexandru Popovici 0cd9487040 fix(viewer-lib): Fixed RTE shaders on MacOS and iOS. Hope they don't break it again (#3907) 2025-01-29 11:01:26 +02:00
Alexandru Popovici 2eaaa93adf Intel IrisXe Fix (#3877)
* fix(viewer-lib): Found a working workaround for mangled geometry on intel iris Xe integrated GPUs

* fix(viewer-lib): Added sample stream
2025-01-23 16:08:27 +02:00
Alexandru Popovici 32497eeb5a fix(viewer-lib): Handles WEB-2491. (#3856)
- Section outlines are no longer visible behind other geometry. They are depth tested now for all view modes
- Shaded mode aka BastiMode now properly updates the section planes
2025-01-21 18:20:45 +02:00
Alexandru Popovici a75b89dd67 fix(viewer-lib): Handles WEB-2475. Shaded view mode no longer eats up cpu time on large streams (#3849)
- FilteringExtension now emits the filtering state changed event when reseting the filtering state
- BasitPass no longer applies the per vertex color indices each frame
- ViewModes extension now listens for filtering state changes and have any active BasitPass reset it's color indices on a filtering reset event. Not great, not terrible but it avoids us having to double cache the per vertex color indices.
2025-01-20 14:12:14 +02:00
Alexandru Popovici b4deaded0f PassReader updates for View Modes (#3828)
* feat(viewer-lib): Updates to the PassReader extension along with underlying viewer library updates
Implemented reading framebuffer contents for framebuffers with multiple attachements. The current version of three.js that we are using does not support this. Because we still need to drag along WebGL 1.0 support, only attachement 0 can be read for now, which does not bother us.
DepthNormalPass now specifies it's MRT output target as the outputTarget
PassReader's read function is now overloaded and it can take a pass name as a string or a GPass | GPass[]
Had to add a small type augmentation since the current version of types-three library does a poor job when it comes to WebGLMultipleRenderTargets
Updated PassReader extension in frontend and updated the call to read in order to make sure depth reading works in other view modes that write depth. The only view mode that does not draw to depth is Shaded mode

* fix(viewer-lib): Fixed the classic sandbox compile error

* fix(frontend-2): Updated depth reading to work with MRT depth from our view mode pipelines
2025-01-16 13:59:13 +02:00
Alexandru Popovici 8aadfc9be9 fix(viewer-lib): Fixed an issue where mismatched vertex color counts were still attempted to batch together resulting in errors. (#3809)
Now if the number of vertex colors does not match the number of vertices we just ignore colors alltogether
2025-01-14 12:52:26 +02:00
Alexandru Popovici 58a6795b61 Enabled accurate near plane calculation (#3778) 2025-01-09 15:58:17 +02:00
Alexandru Popovici e1c83d08cf WEB-2417: Shadowcatcher updates when switching versions (#3777)
* chore(viewer-lib): Snow mode is no longer default in the sandbox

* fix(viewer-lib): Handles WEB-2417

Shadowcather now properly updates when adding/removing render trees even if the scene bounds does not change
2025-01-09 13:05:58 +02:00
Alexandru Popovici b337ae348f Measurements Units Fixes (#3741)
* Handles new measurements reverting to meters even if a different unit was previously set. Handles units not changing properly when changing the unit value

* Remove transition to fix select

* Remove unsused import

* Added back snow

---------

Co-authored-by: Mike Tasset <mike.tasset@gmail.com>
2024-12-20 22:33:42 +00:00
Alexandru Popovici 6fc7c06e9c Offline Object Loader (#3717)
* Quick hack to demo how an offline loader would work with as little complication as possible

* Further simplified yielding objects in offline mode

* Commented out the URL thing

* Implemented SpeckleOfflineLoader. JSON parsing is implemented at object-loader level, completely isolated from the rest of the implementation in order to avoid regression

* Isolated ObjectLoader creation in base SpeckleLoader class so any extended classes can overwrite the way the object loader is created and used

* Removed the big json sample file

* Updated version

* Removed unused functions from objectloader

* Restored viewer package version

* Fixed typo

* Renamed and moved the sample offline Speckle JSON

* Replaced the default JSON object sample with a much smaller one since we don't want to increase the sandbox's build size by 10 megs

* Fixed a linting error
2024-12-18 17:21:13 +02:00
andrewwallacespeckle 87221cac88 feature(fe2): View mode FE integration (#3651)
* Improve shortcuts

* WIP

* View Mode menu

* Styling updates

* split activeControls

* Reusable Menu component

* Menu updates

* Sun menu updates

* Tidyups

* CommonAlert

* Updates

* WIP change to currentViewMode

* Serialization

* defineModel

* Tidy up emits

* Remove v-model

* Force close other panels

* Remove transition

* More robust isTypingComment

* activeControl > activePanel

* View menu shortcuts

* Explode menu definemodel

* Small changes from Benjamin

* Add colors view mode

* Fix server problem in data.ts

* Fix build
2024-12-12 17:19:57 +00:00
Alexandru Popovici 60ff23d73d Toggle-able Basit Mode (#3672)
* Some updates to Basit Mode. Added it to the 6 key

* Renamed BasitMode to ColorsMode
2024-12-12 15:42:10 +02:00
Alexandru Popovici 9e0e6a9c0d SpeckleInstancedMeshes now recrete their shadow depth material whenever the instance configuration changes (#3681) 2024-12-12 14:37:39 +02:00
Alexandru Popovici e7613a60d7 Fixed TAS Shapecast (#3661)
* Fixed the issue where TAS only shapecasts were not running properly on all batch objects, missing some of them. Some small updates to BoxSelection

* Improved shapecast travesal time 4X. Only passing batch objects only once to intersectTASRange and also added the builtin CONTAINED acceleration to bounds testing.

* Some critical typescript errors

* Added missing types from export
2024-12-10 11:29:05 +02:00
Alexandru Popovici 0fd5e2b9ef WEB-1611: Zoom to Cursor Fix (#3562)
* Added FilterMaterial and related types to export list

* Handled WEB-1389

* Camera orbit controls now takes the offset position and size when computing zoom to cursor coordinates. Fixes WEB-1611
2024-11-26 20:56:49 +02:00
Alexandru Popovici 003ac46e58 WEB-1683: Selection Extension Fixes (#3559)
* Added FilterMaterial and related types to export list

* Handled WEB-1389

* Handled the issue
2024-11-26 20:56:36 +02:00
Alexandru Popovici e739ee1b27 WEB-2171: Non-Speckle Materials Fix (#3558)
* Added FilterMaterial and related types to export list

* Handled WEB-1389

* Non speckle materials no longer throw an error
2024-11-26 20:56:19 +02:00
Alexandru Popovici 68bbedcd92 WEB-1389 (#3555)
* Added FilterMaterial and related types to export list

* Handled WEB-1389
2024-11-26 20:55:53 +02:00
Dimitrie Stefanescu eab2391353 feat: adds compat for upcoming dui3 changes 2024-11-22 17:36:33 +00:00
Alexandru Popovici a48ec073a1 The bounds to check against when intersecting the scene is now being properly expanded and 0 sized component bounds are being taken care of (#3450) 2024-11-07 09:55:27 +02:00
Dimitrie Stefanescu 60e6354524 Merge pull request #3445 from specklesystems/WEB-2136
fix: adds brepx, extrusionx, subdx support in viewer for real this time
2024-11-06 13:49:06 +00:00
Dimitrie Stefanescu 96d497232d fix: adds brepx, extrusionx, subdx support in viewer for real this time 2024-11-06 13:46:16 +00:00
Alexandru Popovici 11a3a68d86 Added missing exported types (#3418) 2024-11-01 15:06:06 +02:00
Alexandru Popovici 26a103b5c5 Made sure an actual Box3 instances is passed ot the viewwer from hte legacy viewer implementation] (#3428) 2024-11-01 05:29:46 +01:00
Alexandru Popovici 5be9a27945 Fixed an issue with computing a relative offset box where the origin of the input box was not taken into account and the resulting offset box would be whack (#3419) 2024-10-31 09:36:11 +01:00
Alexandru Popovici 31a21f3a9a GeometryPass now updates the section planes automatically for any overriden materials (#3409) 2024-10-30 14:31:30 +02:00
Alexandru Popovici a5cc51040c Added batch material override support for instanced speckle meshes, aka all instances (#3411) 2024-10-29 19:14:23 +02:00
Alexandru Popovici 613614d5d0 View Modes (#3259)
* Edge drawing render pass using both depth and normal data

* Edges are now mixed with the rest of the passes in the final pass

* Set MSAA for SS edges framebuffers to maximum number of samples

* New depth gradient extraction approach. Several improvements over the old one

* Some changes to the normal gradient extraction. Using Robert's Cross works roughly the same as the older approach with 1 less texture fetch. Also implemented Canny

* Combined static AO with edges

* Implemented SMAA and static TAA. Both toggeable in realtime for better comparisons

* Added the normal pass and fixed some issues

* The pipeline is now capable of jitter individual passes if requested

* Added TAA pass. Technically it can be used to antialias anything. Right now we've disabled MSAA and using TAA for stationary as an example

* Added a TAA pipeline on the final image. Added DPR into pipeline resize calls. Struggled a *lot* with different blending results between drawing to the backbuffer and to a framebuffer then copying to the backbuffer. There are still some differences visible

* Edges pipeline

* Edges + TAA + AO + COLOR pipeline

* ShadedView mode

* Visibility is now properly reset when coming from a visibility conditioned pass to an unconditioned one

* Added another version for 'shaded' view, inspired by blender's viewport shading

* Added pen view together with a sample paper like texture for vissual background

* A form of techincal view

* Arctic view. Separate viewport pass from matcap pass

* Cleaned up the ao shader a bit. Formalized progressive ao pass options

* WIP on BasitMode

* Added pipeline switching to the sandbox. Edge pass now has an optional texture background

* Implemented BasicMode using material overrides

* Merged with latest main

* Fix merge issues

* More merge misses

* Stating stream

* Fixed an issue that took hours to debug and it turned out to be a literal typo

* Formalized the progressive pipeline concept which removed a lot of duplicated code

* Added pipeline reseting. Added pipeline passthrough to allow features like measurements to run correctly. Added jitter to depth buffer for progressive AO for much better results!

* Implemented the required stencil passes used for stencil selection as new pass formats. Added them as well as the overlay pass to all pipelines. Will need to automate their addition though

* Fixed stencil selection in pen view. Decided to only show outlines because it makes more sense

* Implemented proper pass clearing values and flags. Also made sure the minimum amount of clears are made inside the frame. Fixed an issue with progressive pass frame counts and indices.

* Formalized options for all passes that had any. Tidied up some shaders and simplified where possible

* Centralized render target creation and removed a lot of render target creation in the passes that had no need for it. Fixed an issue where the matcap material would not not update it's matcap texture properly when rendering in override mode

* Matcap and Viewport passes where merged into a single Viewport pass that can take a matcap texture in it's options. Also, changed the way the viewport shader displays colors, based on three's textureless matcap shader block.

* Updated PassReader extension to work with the latest pipeline. NNowthe pass reader accepts the pass name when reading, so it can used to read any passes

* WIP on MRT

* Implemented DepthNormal MRT pass and used in a pipeline. Working fine on WebGL2.0

* Full Support for WebGL1.0

* Fix for viewport material not updating it's texture properly

* Added an extension that enables hotkeys for view modes

* Fixed jittering for orthographic projections

* Fixed the section tool integration issues with the new pipelines

* Added MRT versions of the pipelines that need it]

* Added a wrapper ViewModes extensions that defines the existing view modes and handles the required check for MRT capabilities and selects the nonMRT/MRT pipelines accordingly

* Error fixes

* Another error

* Added shadowcatcher to arctic and shaded view since it was missing by mistake. Increased the KERNEL_SIZE for arctic mode so that the AO is more smooth

* Disabled pen view background texture

* When reseting the pipeline the jitter index is also reset in order to avoid visible jittering when switching fast between dynamic and progressive mode repeteadly (like when moving the clipping box)

* Quick solution for integrating view modes with per-object operatins like selection and filtering

* View modes now have the ability of overriding the batch's default material instead of all it;s materials. This means that per object material changes like selection and filtering will work together with view modes. Handles WEB-2080, WEB-2083, WEB-2084, WEB-2081 and WEB-2082

* Fiter applies now trigger a hard reset, which is required and fixes a preexisting bug in production. Fixed an issue where the shadowcatcher would incorrectly blend in shaded view mode

* Viewport pass can now render transparency. Arctic mode now renders transparent objects as well (was originally required)

* Forcing the multipel render targets we use for MRT to use a 32 bit depth buffer for proper precision on MacOs Chromium

* Fixed an issue where incorrect visible ranges were being perpetuated when selecting hidden objects (outlines only mode)

* PROPS are not rendered twice anymore and they've been moved to the overlay pass in all pipelines

* Reorganized passes and pipelines. Deleted old passes

* Renamed all new passes. Only the interface and base pass types have a G prepended to make it 100% clear it's different than three's Pass type

* Fixed some compiling errors

* Dont change viewmodes when inputs are being used

* Pipeline gets resized whenever it's set in the renderer. Some other smaller changes

---------

Co-authored-by: Mike Tasset <mike.tasset@gmail.com>
2024-10-29 13:30:26 +02:00
andrewwallacespeckle 678c75350c feat(fe2): Update Section Box controls to include visibility (#3333)
* Update Section Box controls to include visibility

* Update reset v-if

* Update shortcut

* Added render requests so that section box updates are made visible

* Remove comments

* Exposed SectionToolEvent in the viewer

* Only show reset when change has been made to sectionbox

* gql

* Make state reactive

* Revert "Make state reactive"

This reverts commit 1697b12cd67d1da6f79658996c8822d1eb962d3b.

* Handles WEB-2039

* Handles WEB-2035

* Changes from call with Fabs

---------

Co-authored-by: AlexandruPopovici <alexandrupopoviciioan@gmail.com>
2024-10-25 10:46:48 +01:00
Alexandru Popovici 4bce48a6d8 Handled WEB-2025 (#3329) 2024-10-17 17:02:08 +03:00
Alexandru Popovici 4b82fb24a4 Viewer now exposes the converter and the render tree. Some members of classes from the loader system are now protected instead of private in order to properly extend them (#3302) 2024-10-16 14:25:40 +03:00
Dimitrie Stefanescu 3ce8dff6da feat(fe2): re-adds syntatic sugar for new properties coming out of revit & sorts selection props alphabetically 2024-10-15 10:36:04 +01:00
Alexandru Popovici 1a2a3d27df Box Rotation (#3205)
* Added rotation to speckle box type objects

* Addded orthogonal check
2024-10-09 12:05:28 +03:00
Alexandru Popovici 4bcf3cc1d9 Highlight no longer breaks existing filtering operations (#3187)
Co-authored-by: andrewwallacespeckle <andrew@speckle.systems>
2024-10-07 16:16:30 +01:00
Alexandru Popovici 5cd9dbd0f0 Fixed le bug (#3127) 2024-09-26 10:58:30 +03:00
Alexandru Popovici 8352aaea15 Fixed an issue where the converter would fail if display valyues were not directly displayable objects (#3075) 2024-09-24 13:56:19 +03:00
Alexandru Popovici 2f8efeabc5 WEB-1799: Camera Staying in the same location across models (#2862)
* Fixed the issue with camera controller incorrect zoomToBox when switching between loaded objects. If zoomToBox is requested as non animated, now it actually is non animated. Added a default function to the camera controller extensions which moves the camera to the predefined location/orientation

* No radius is specified as default
2024-09-23 15:03:00 +03:00
Alexandru Popovici f8878b4459 Fixes diffing errors with DUI3 instances (#2869) 2024-09-04 12:00:43 +03:00
Alexandru Popovici 3d96b77340 Fixed WEB-1793 (#2854) 2024-09-03 12:01:14 +03:00
Alexandru Popovici 46bc09eac9 Color Proxy source (#2799)
* Color source implementation for a single level of instancing. I don't like it. I don't believe it's the right way to go

* Forgot this

* Rewritten the way prxy color sources are handled. Nesting instances now works for the most part

* Handled block-block situation from instance nesting

* Added sum comments for color proxy source implementation

* Disabled tonemaping for line materials
2024-08-29 14:42:27 +03:00