These viewport controls will be shared with material canvas and other tools that share a similar environment and viewport configurations.
These classes are currently duplicated between the material editor and prototype projects.
This change generalizes some things that are specific to the material editor and moves the system to a common location.
Event buses were removed and replaced with a normal interface.
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
• This change is partially to unblock physics tool prototyping. It introduces a tool ID that is passed down into systems and acts as a context for document, window, and other systems and buses.
• The document system component is no longer a component. It is just a system class that can be constructed with a tool ID. Internally, it will connect to its buses and be addressable by tool ID. More than one can be instantiated, each with a unique tool ID.
• These changes are still backward compatible because most of the buses were using broadcast for standalone applications. All of those calls have been updated but not all of the scripts, which should still work as is.
• Got rid of the window factory request bus in favor of just instantiating the main window or any other UI in the application layer.
• Fixed a couple of bugs that were discovered while making these changes.
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
Moved the class for common asset browser interactions for source files, folders, and source control to atom tools framework.
Added a function to register custom actions
Deleted unnecessary document settings class in favor of settings registry
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
Moved the performance monitor system component and metrics gathering from the material editor into atom tools framework so it can be reused and extended by other applications.
Replaced the custom performance monitor docked window in the material editor with status bar widgets that are always visible and take up no screen real estate. This could possibly be moved to the base application class or rendered on top of the viewport.
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
Moving more potentially shared code out of the material editor into atom tools framework.
This change consolidates the lighting preset browser, model preset browser, and the base dialogue that they shared into a single, grid based, asset selection dialog.
AssetGridDialog should appear as a move and rename of PresetBrowserDialog but there are probably too many differences with new variable renames and SelectableAsset struct.
Along the way I found examples showing that event bus broadcast accepted generic functions and lambdas. Used this to do a minor cleanup of the viewport settings inspector where the preset dialogs were initialized and other places that did several back to back bus calls.
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
Consolidated duplicate asset browser code from multiple tools into single class in atom tools framework
Moved creation of asset browser and Python terminal windows into base main window class
Fixed docked window orientations
Added checks to asset browser to prevent crashes if tree state saver was null
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
* improvements to editor selection in the viewport
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* fix issue with being able to select icons that are not showing for entities inside entity containers
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* update comment after review feedback
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* updates to viewport picking code to simplify the api
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* add test to replicate near clip intersection issue
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* small tidy-up changes
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* updates to how we perform world to screen and screen to world calculations, added test coverage and some tidy-up
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* add some more tests for ViewportInteractionImpl
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* minor tweaks before PR feedback
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* fix typo in fix
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* fix for manipulator test framework tests
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* updates to RPI::View and RenderPipeline after review feedback from VickyAtAZ
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* add constexpr to ScreenPoint, ScreenVector and ScreenSize initializing constructors
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* add PrintTo functions for Screen* types
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* downgrade error to warning temporarily
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* check incoming view is null
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* remove pragma optimize off
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* Implement sync interval and refresh rate API for RenderViewportWidget
Signed-off-by: nvsickle <nvsickle@amazon.com>
* Measure actual frame timings in the viewport info overlay.
Takes the median of the sum of (frame end - frame begin) to provide more a more representative view of when frames begin and end.
Note: Until VSync is internally supported by the event loop, this will produce nearly identical frame timings as the frame will spend as much time as needed synchronously waiting on a vblank.
Signed-off-by: nvsickle <nvsickle@amazon.com>
* Make frame timing per-pipeline, wire up refresh rate info to ViewportContext
Signed-off-by: nvsickle <nvsickle@amazon.com>
* POC: Frame limit pipeline rendering
Signed-off-by: nvsickle <nvsickle@amazon.com>
* Switch Editor tick to every 0ms to allow better tick accumulation behavior
Signed-off-by: nvsickle <nvsickle@amazon.com>
* Move RPISystemComponent to the tick bus, remove tick accumulation logic
Signed-off-by: nvsickle <nvsickle@amazon.com>
* Add `AddToRenderTickAtInterval` to RenderPipeline API
This allows a pipeline to update at a set cadence, instead of rendering every frame or being directly told when to tick.
Signed-off-by: nvsickle <nvsickle@amazon.com>
* Make ViewportContext enforce a target framerate
-Adds GetFpsLimit/SetFpsLimit for actively limiting FPS
-Calculates a render tick interval based on vsync and the vps limit and updates the current pipeline
Signed-off-by: nvsickle <nvsickle@amazon.com>
* Add r_fps_limit and ed_inactive_viewport_fps_limit cvars
Signed-off-by: nvsickle <nvsickle@amazon.com>
* Quick null check from a crash I bumped into
Signed-off-by: nvsickle <nvsickle@amazon.com>
* Fix off-by-one on FPS calculation (shouldn't include the not-yet-rendered frame)
Signed-off-by: nvsickle <nvsickle@amazon.com>
* Clarify frame time begin initialization
Signed-off-by: nvsickle <nvsickle@amazon.com>
* Fix TrackView export.
Signed-off-by: nvsickle <nvsickle@amazon.com>
* Address some reviewer feedback, revert RPISystem API change, fix CPU profiler.
Signed-off-by: nvsickle <nvsickle@amazon.com>
* Add g_simulation_tick_rate
Signed-off-by: nvsickle <nvsickle@amazon.com>
* Address review feedback, make frame limit updates event driven
Signed-off-by: nvsickle <nvsickle@amazon.com>
* Remove timestamp update from ComponentApplication::Tick
Signed-off-by: nvsickle <nvsickle@amazon.com>
Renamed document related buses and components to have generic names
Added a base document class with default implementation from which other application specific documents can be derived to work with the document system
Added document factory function registration to the document system request bus so that each application can specify the type of document it creates
Updated all comments and messaging to only refer to documents, not materials or material documents
Updated material editor and shader management console to conform to the new buses
This will provide a first pass of a common interface for a document management system that can be shared by multiple applications
Corrected status bar message copy and paste errors
Updated all test scripts to use the new buses
Signed-off-by: Guthrie Adams <guthadam@amazon.com>
* Final update copyright headers to reference license files at the repo root
Signed-off-by: spham <spham@amazon.com>
* Fix copyright validator unit tests to support the stale O3DE header scenario
Signed-off-by: spham <spham@amazon.com>
This replaces grid hub usage in the material editor. It allows material editor and other tools to intercommunicate on the local host. This will allow enforcing that there is only one instance of the material editor running. Opening a second instance will forward command line options to the first instance running a local server.
https://jira.agscollab.com/browse/ATOM-15439https://jira.agscollab.com/browse/ATOM-13742