Skip to content

Rendering Issues in Replay View on Android#1

Open
cjaverliat wants to merge 6 commits into
BergLucas:improvement/add-android-supportfrom
cjaverliat:fix/broken-rendering
Open

Rendering Issues in Replay View on Android#1
cjaverliat wants to merge 6 commits into
BergLucas:improvement/add-android-supportfrom
cjaverliat:fix/broken-rendering

Conversation

@cjaverliat

@cjaverliat cjaverliat commented Apr 13, 2025

Copy link
Copy Markdown

Fix: Rendering Issues in Replay View

This pull request resolves the rendering issues identified by @BergLucas.
The problems were due to two main causes:

  1. Incorrect depth buffer configuration
  2. Improperly loaded lightmaps

image


🐛 Bug Fixes

Lightmap Loading

The replay appeared completely black due to lightmaps not being loaded correctly:

Lightmap Bug

To help debug missing assets from the bundle (in this case the lightmaps), a log message was added:

Missing Asset Log

Root cause:
The tutorial’s record1.plm and record2.plm used 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:

Depth Buffer Bug

Root cause:
The issue stemmed from a RenderTexture created using RenderTexture.GetTemporary in Player.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. 2f2a0c8

Shader/Class Stripping

The build threw runtime errors due to stripped classes and shaders:

Class Stripping

Fixes:

NullReferenceException in the loading panel

Issue:
A NullReferenceException occurred in Player.cs when bundleLoader was still null.

Fix:
Added null-coalescing to default progress to 0 when bundleLoader is not available. f417e55


🧹 Code Cleanup

  • Removed excessive debug logging from RecordAssetBundle.cs f5b8a48

  • Added warning logs for missing assets in the bundle 761008b


✅ Final Result

Rendering now works as expected:

Correct Rendering

Screenshots from a Google Pixel 6A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant