You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
o3de/Gems/Atom/RPI/Code
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
..
External/MaskedOcclusionCulling Added Masked Occlusion Culling external files 5 years ago
Include/Atom Merge pull request #4426 from aws-lumberyard-dev/Atom/santorac/FixSceneSrgTime 4 years ago
Source Merge pull request #4426 from aws-lumberyard-dev/Atom/santorac/FixSceneSrgTime 4 years ago
Tests Merge branch 'stabilization/2110' into Atom/santorac/MoveDoubleSided 4 years ago
Tests.Builders Add preliminary budget tracking system and remove driller integration 4 years ago
Tests.Editor Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
CMakeLists.txt Undo artifacts for JsonUtils sojourn into AzToolsFramework 4 years ago
atom_rpi_builders_files.cmake Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
atom_rpi_builders_shared_files.cmake Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
atom_rpi_builders_stub_files.cmake Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
atom_rpi_builders_tests_files.cmake Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
atom_rpi_edit_files.cmake Added backward-compatible support for the old "id" key in material type files, which is being renamed to "name". 4 years ago
atom_rpi_editor_files.cmake Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
atom_rpi_editor_tests_files.cmake Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
atom_rpi_masked_occlusion_files.cmake Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
atom_rpi_private_files.cmake Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
atom_rpi_private_shared_files.cmake Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
atom_rpi_public_files.cmake Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
atom_rpi_reflect_files.cmake Enable material version updates. 4 years ago
atom_rpi_tests_files.cmake Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago
rpi_shared_files.cmake Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago