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
Fixed the update condition of cookie atlas and added doc for render texture cookies update. #1527
Conversation
…exture cookies update.
It appears that you made a non-draft PR! |
There was a problem hiding this 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. |
There was a problem hiding this comment.
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.
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?