Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the update condition of cookie atlas and added doc for render texture cookies update. #1527

Merged
merged 4 commits into from Aug 25, 2020

Conversation

JulienIgnace-Unity
Copy link
Collaborator

@JulienIgnace-Unity JulienIgnace-Unity commented Aug 5, 2020

Purpose of this PR

Fixed an issue with cookie texture atlas that would cause realtime textures to always update in the atlas in editor even when the content did not change.
Also added to the light documentation a section explaining what needs to be done for real time render texture cookies to update in the atlas.

This doc update is in response to this case: https://fogbugz.unity3d.com/f/cases/1259997/


Testing status

Tested with the provided scene script (after removing recreation of render texture everyframe) and added a bool property to make sure that not calling IncrementUpdateCount would indeed stoped the atlas from updating, which was not the case before the fix. This also fixed the inconsistent behavior in the editor where texture would update every frame.

Manual Tests: What did you do?

  • Opened test project + Run graphic tests locally
  • Built a player
  • Checked new UI names with UX convention
  • Tested UI multi-edition + Undo/Redo + Prefab overrides + Alignment in Preset
  • C# and shader warnings (supress shader cache to see them)
  • Checked new resources path for the reloader (in developer mode, you have a button at end of resources that check the paths)

@github-actions
Copy link

github-actions bot commented Aug 5, 2020

It appears that you made a non-draft PR!
Please convert your PR to draft (button on the right side of the page)
and cancel any jobs that started on Yamato.
See the PR template for more information.
Thank you!

@sebastienlagarde sebastienlagarde requested review from skhiat and removed request for alelievr August 5, 2020 13:36
@JulienIgnace-Unity JulienIgnace-Unity requested review from skhiat and removed request for skhiat August 5, 2020 13:37
Copy link
Contributor

@JordanL8 JordanL8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some doc suggestions


#### Real-time light cookies:

Users can set **RenderTexture** that they update themselves as light cookies. However for performance reasons, the cookie atlas is not updated every frame for every light cookie. For this reasons, users need to explicitly call **IncrementUpdateCount()** on the **RenderTexture** to notify the system that the content has changed and needs to be uploaded to the atlas otherwise the cookie will not be updated over time.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HDRP allows you to use a RenderTexture as a light cookie. However, for the sake of performance, if you make any changes to the RenderTexture, HDRP does not automatically update the cookie atlas. To notify the system that the RenderTexture content has changed and thus make the system upload the change to the cookie atlas, call IncrementUpdateCount() on the RenderTexture. If you do not do this, the system does not update the cookie.

@JulienIgnace-Unity JulienIgnace-Unity merged commit 9ced869 into HDRP/staging Aug 25, 2020
@JulienIgnace-Unity JulienIgnace-Unity deleted the HDRP/fix-cookie-update-and-doc branch August 25, 2020 11:58
JulienIgnace-Unity added a commit that referenced this pull request Aug 25, 2020
@sebastienlagarde sebastienlagarde mentioned this pull request Sep 3, 2020
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants