Commit Graph

20 Commits (dcbcab68d22bceadd8ed32a3fca50b752b28793d)

Author SHA1 Message Date
santorac c5cb90ddb7 Merge pull request #4426 from aws-lumberyard-dev/Atom/santorac/FixSceneSrgTime
Fixed potential render scene time precision issues.

The timestamp was simply converted from GetTimeAtCurrentTick to a float. Since this value is backed by QueryPerformanceCounter which is 0 at boot, you could see broken animations on the GPU when your system has been on for a long time. So I simplified the RPI's time API (removed unused code), and subtracted the application start time each frame before converting the time value to a float.

Also moved FindShaderInputConstantIndex("m_time") to be called only once, instead of every frame.

Testing:
Originally: I had a local material shader that did vertex animation and it wasn't working at all before, and now it works.
More recently, I made local changes to StandardPBR to add a simple sin wave animation. I also modified GetTimeNowMicroSecond() to artificially add 30 days to the clock. This showed choppy animation before my changes, and smooth animation after.
AtomSampleViewer passed dx12 and vulkan (other than pre-existing issues)

Signed-off-by: santorac <55155825+santorac@users.noreply.github.com>
4 years ago
Adi Bar-Lev 05767f2d2b
Atom Timer fix - changed milliseconds to seconds (#4631)
* Atom Timer fix - changed milliseconds to seconds

- Tested on both fog and EyeAdaptation animations - both are the only affected and were broken before
- This is a small fix for pull #3969 that replaced the timer mechanism: https://github.com/o3de/o3de/pull/3969

Signed-off-by: Adi-Amazon <barlev@amazon.com>

* Atom Timer fix - using seconds to begin with and removing obsolete variable

Signed-off-by: Adi-Amazon <barlev@amazon.com>
4 years ago
nvsickle bcfe3d3878 Revert "Refresh rate driven rendering tick logic (#3375)"
This reverts commit db63dcbcd9.

Signed-off-by: nvsickle <nvsickle@amazon.com>
4 years ago
Scott Romero 36bcf5849a
[development] Migrated Atom CPU profiler to utilize new AzCore Profiler interface and related macros (#4160)
- Added new interface type AZ::Debug::Profiler to externally register profiler systems
 - Modified the Atom CPU profiler to register as an AzCore profiler
 -- This allows full engine markers to be visualized in the associated ImGui tool
 - Converted all AZ_ATOM_PROFILE_* macros to use AZ_PROFILE_* macros instead

Signed-off-by: AMZN-ScottR 24445312+AMZN-ScottR@users.noreply.github.com
4 years ago
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>
4 years ago
Jeremy Ong 07a14bdce1 Add AZ_BUDGET_DEFINE/AZ_BUDGET_DECLARE and remove driller
NOTE: The memory driller is still intact for now to avoid needing to
modify allocators, but the frame/cpu portions of driller and the
standalone executable are now gone.

Signed-off-by: Jeremy Ong <jcong@amazon.com>
4 years ago
Jeremy Ong df9b4d4a2f Deprecate profiler categories based on global enum
(to be supplanted by registered budgets in the future)

Signed-off-by: Jeremy Ong <jcong@amazon.com>
4 years ago
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>
4 years ago
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>
5 years ago
Steve Pham 70042fcdcd
O3DE Copyright Updates for Linux Foundation (#1504) 5 years ago
antonmic 2a40010089 Pass changes: fixed reflection probe bake 5 years ago
antonmic 2a982fa4b2 Pass changes: Addressing PR feedback 5 years ago
antonmic 1ddb94ada1 Pass changes: final cleanup 5 years ago
antonmic c996b34835 Pass changes WIP: small optimization 5 years ago
antonmic 702356007c Pass changes WIP: standardized usage of new pass initialization functions 5 years ago
antonmic 6973d9c7a3 Pass changes WIP: moved child pass creation to Build phase 5 years ago
antonmic 0f90ccc0b4 initial changes compiling 5 years ago
qingtao 12f528d744 ATOM-6088 Unified approach to send draws to a single viewport
- Created a template class TagRegistery which implements the previous DrawListTagRegistry. The template is used for both DrawListTagRegistry and DrawFilterTagRegistry
- Added DrawFilterTag to DrawItemKeyPair
- Added DrawFilterMask support in DrawPacket and DrawPacketBuilder
- Added CreateDynamicContext for render pipeline which allows draw to selected render pipeline.
- Updated RasterPass's BuildCommandListInternal function to filter draw items for its owner RenderPipeline.
- Updated RHI unit tests.
5 years ago
alexpete 1044dc3da1 Integrating github/staging through commit ab87ed9 5 years ago
alexpete a10351f38d Initial commit 5 years ago