Rendering Issues in Replay View on Android#1
Open
cjaverliat wants to merge 6 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Rendering Issues in Replay View
This pull request resolves the rendering issues identified by @BergLucas.
The problems were due to two main causes:
🐛 Bug Fixes
Lightmap Loading
The replay appeared completely black due to lightmaps not being loaded correctly:
To help debug missing assets from the bundle (in this case the lightmaps), a log message was added:
Root cause:
The tutorial’s
record1.plmandrecord2.plmused lightmaps generated by the Bakery plugin, which was later removed due to licensing restrictions.Fix:
Recording new record using the current tutorial project (with Unity’s built-in lightmaps) results in correct reference to the new lightmaps and thus a correct loading in the viewer.
Depth Buffer
Even with valid lightmaps, depth rendering was incorrect — meshes were layered improperly:
Root cause:
The issue stemmed from a
RenderTexturecreated usingRenderTexture.GetTemporaryinPlayer.cs#L73.This method reuses textures from a pool and, without explicitly set depth parameters, the reused texture had an incorrect depth buffer.
Fix:
A dedicated render texture asset (
PreviewTexture.renderTexture) was created and used consistently across the codebase. 2f2a0c8Shader/Class Stripping
The build threw runtime errors due to stripped classes and shaders:
Fixes:
Disabled
PlayerSettings.stripEngineCodeto prevent class stripping 7cedc0cDisabled shader stripping in URP settings
57e04bd0293741f7611cfeeea8417de21b086f10NullReferenceException in the loading panel
Issue:
A
NullReferenceExceptionoccurred inPlayer.cswhenbundleLoaderwas still null.Fix:
Added null-coalescing to default progress to
0whenbundleLoaderis not available. f417e55🧹 Code Cleanup
Removed excessive debug logging from
RecordAssetBundle.csf5b8a48Added warning logs for missing assets in the bundle 761008b
✅ Final Result
Rendering now works as expected:
Screenshots from a Google Pixel 6A