Skip to content

GX: keep the other half of channel colors in GXSetChanMat/AmbColor - #310

Open
StilesCrisis wants to merge 1 commit into
encounter:mainfrom
StilesCrisis:chan-color-partial-update
Open

StilesCrisis wants to merge 1 commit into
encounter:mainfrom
StilesCrisis:chan-color-partial-update

Conversation

@StilesCrisis

Copy link
Copy Markdown

GXSetChanMatColor and GXSetChanAmbColor with GX_COLORn should only replace the register's RGB. GX_ALPHAn should only replace its alpha.

Aurora was overwriting the whole RGBA value and leaving the untouched channels as zeros, so code like this:

GXSetChanMatColor(GX_COLOR0, white);
GXSetChanMatColor(GX_ALPHA0, transparent);

Would accidentally clobber the material RGB with black instead of white.
Since the code was slightly more complex and duplicated in two places, I factored it out to a shared helper.

In the SDK, GXSetChanMatColor and GXSetChanAmbColor with a GX_COLORn id
only replace the register's RGB, and a GX_ALPHAn id only replaces its
alpha; GX_COLORnAn sets both. Aurora replaced the whole RGBA value for
every id, so a common sequence like

  GXSetChanMatColor(GX_COLOR0, white);
  GXSetChanMatColor(GX_ALPHA0, transparent);

zeroed the material RGB and lit geometry rendered black. Merge the new
bytes into the shadowed register value instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SjpWoYqNDKkH5Zpdbz3WaW
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.

2 participants