Repository navigation
Android: set a bridge material's emission and reflective channels at once - #471
Merged
Merged
Conversation
…once Material's setters are queued for the rendering thread, and ViroReact copies its materials onto nodes before that queue runs, so a channel set through them never reached the copies. setImmutableColor and setImmutableTexture set a named channel on the calling thread, as the immutable constructor does.
…al-emission # Conflicts: # CHANGELOG.md
Merged
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.
Summary
On Android, a material's emission colour, emission texture and reflective texture set from ViroReact never reached the nodes that used it.
Cause
Material's Java setters (nativeSetColor,nativeSetTexture) are queued for the rendering thread.nativeCopyMaterial) before that queue runs.Fix
New
Material.setImmutableColorandMaterial.setImmutableTexture, backed by JNInativeSetImmutableColorandnativeSetImmutableTexture. They set a named channel on the calling thread, with the thread restriction off, the same way the immutable constructor does. Onlyviro_reactuses them.Notes
fix/android-material-emissionuses these, and ships AARs built from this commit.Testing
Pixel 6 Pro, through viro's branch: emission colour, emission texture and a reflective cube map draw on the material, matching iOS.