Commit Graph

25 Commits

Author SHA1 Message Date
nvsickle bcfe3d3878 Revert "Refresh rate driven rendering tick logic (#3375)"
This reverts commit db63dcbcd9.

Signed-off-by: nvsickle <nvsickle@amazon.com>
2021-09-21 16:47:24 -07:00
Nicholas Van Sickle db63dcbcd9 Refresh rate driven rendering tick logic (#3375)
* 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>
2021-09-13 17:57:42 -07:00
Esteban Papp a35464ca08 more fixes
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
2021-08-20 10:09:44 -07:00
Esteban Papp 90cad016de Gems/Atom
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
2021-08-16 16:05:31 -07:00
pappeste b3e895d10c fixed AtomLyIntegration
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
2021-08-16 16:03:38 -07:00
antonmic d693ee5dd3 merging latest
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
2021-07-28 17:17:49 -07:00
antonmic 72f808876c Improvements to pass statistics and SRG debugability
Signed-off-by: antonmic <56370189+antonmic@users.noreply.github.com>
2021-07-28 16:35:51 -07:00
Danilo Aimini 512fbbe6b2 Adjust debug text sizing for Vegetation Debugger in viewport. (#2183)
Signed-off-by: Danilo Aimini <82231674+AMZN-daimini@users.noreply.github.com>
2021-07-16 17:49:33 -05:00
Steve Pham 38261d0800 Shorten copyright headers by splitting into 2 lines (#2213)
* Updated all copyright headers to split the longer original copyright line into 2 shorter lines

Signed-off-by: Steve Pham <spham@amazon.com>
2021-07-16 15:25:48 -07:00
nvsickle 0b3dab1cf8 Use DPI scaling for viewport info padding
Signed-off-by: nvsickle <nvsickle@amazon.com>
2021-07-07 11:51:20 -07:00
nvsickle 21dbe8b48f Address review feedback
Signed-off-by: nvsickle <nvsickle@amazon.com>
2021-07-07 11:51:16 -07:00
nvsickle 9e4d6a1d85 Scale the viewport debug info overlay by the DPI scale factor
Signed-off-by: nvsickle <nvsickle@amazon.com>
2021-07-07 11:51:11 -07:00
Steve Pham b4a2edec6a Final update copyright headers to reference license files at the repo root (#1693)
* 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>
2021-06-30 19:51:55 -07:00
Tom Hulton-Harrop 980da1b56a Update border padding for viewport debug text (#1514) (LYN-4389) 2021-06-24 09:38:08 +01:00
Qing Tao 81c2bf54d3 ATOM-15842 Update the fps calculation for editor (#1500) 2021-06-23 11:17:45 -07:00
Steve Pham 70042fcdcd O3DE Copyright Updates for Linux Foundation (#1504) 2021-06-23 10:55:22 -07:00
Nicholas Van Sickle 087677b326 Fix several viewport issues (#1045)
* Fix some FOV calculation viewport issues:
-Avoid calculating FOV if we've got an invalid viewport
-Don't override game mode FOV, let the active camera components manage it instead

* Fix viewport font positioning

This updates code in a few places to respect an API change/fix made to AtomFont - also switched the default value of m_virtual800x600ScreenSize to false as it's really behavior you want to opt into

* Don't activate CameraComponentController when in the Editor / not in game mode
2021-06-01 12:20:15 -07:00
pappeste 8b9f5230f6 Merge branch 'main' into ly-as-sdk/LYN-2948 2021-05-28 00:16:26 -07:00
Qing Tao 85222130d4 LYN-4007 Editor crashes when entering the Game Mode with two Box Shape entities with Game View enabled (#974)
The crash was caused by using gpu query across command lists.
2021-05-27 13:56:19 -07:00
phistere 3bc5ecd9d9 Fixes a divide by zero in Atom FPS Display 2021-05-25 18:24:43 -05:00
nvsickle 1426052a5f Address a bit more review feedback
-Use aznumeric_cast for enum <-> int casts
-Short circuit logic a bit more nicely
2021-05-14 13:01:46 -07:00
nvsickle a8b29bf603 Remove memory info from the overlay for now (depended on the now-dead CryMemoryManager) 2021-05-14 12:38:46 -07:00
nvsickle 8fd5c30e13 Address some build/review feedback 2021-05-12 17:47:10 -07:00
nvsickle 84216f0479 Add API for ViewportInfoDisplayState, add some minor RHI integration 2021-05-12 15:58:28 -07:00
nvsickle 6fcd5c7817 Restore Viewport debug text
Adds the AtomViewportDisplayInfo Gem which renders debug text to the default viewport context depending on the value of r_DisplayInfo.
The gem is flagged as a dependency of AtomBridge, so all Atom projects will consume it by default.
2021-05-11 18:27:47 -07:00