Skip to content

feat(render): preserve native DFF material surface properties and use game light properties on activation - #284

Merged
user-grinch merged 1 commit into
user-grinch:mainfrom
CanerKaraca23:feat-render-dynamic-surfaceprops
Aug 30, 2026
Merged

feat(render): preserve native DFF material surface properties and use game light properties on activation#284
user-grinch merged 1 commit into
user-grinch:mainfrom
CanerKaraca23:feat-render-dynamic-surfaceprops

Conversation

@CanerKaraca23

Copy link
Copy Markdown
Collaborator

Summary

Preserves the vehicle's native DFF model material surface properties (ambient, diffuse, specular) when lights are off, preventing glass, lenses, and textures from looking unnaturally dark or flat. When lights are activated, temporarily applies GTA SA's native ms_lightSurfProps (0x8A645C) and restores the original material properties on render reset (ResetEditableMaterials).

Changes

  • Track and restore original material->surfaceProps via m_SurfPropsRestoreEntries on ResetEditableMaterials.
  • Apply GTA SA's native *(RwSurfaceProperties *)0x8A645C when lights are ON.
  • Leave material->surfaceProps untouched when lights are OFF so model materials retain their natural illumination.
  • Remove obsolete hardcoded MaterialAmbientOff and MaterialAmbientOn configuration options.

@CanerKaraca23
CanerKaraca23 force-pushed the feat-render-dynamic-surfaceprops branch from b58e892 to 9bbd5fe Compare August 30, 2026 00:39
@CanerKaraca23
CanerKaraca23 force-pushed the feat-render-dynamic-surfaceprops branch from 9bbd5fe to 2cb4012 Compare August 30, 2026 00:41
… game light properties on activation

# Conflicts:
#	resource/dist/ModelExtras.ini
#	src/features/plate.cpp
#	src/utils/modelinfomgr.cpp

# Conflicts:
#	resource/dist/ModelExtras.ini
#	src/utils/modelinfomgr.cpp
@CanerKaraca23 CanerKaraca23 reopened this Aug 30, 2026
@user-grinch

Copy link
Copy Markdown
Owner

LGTM.

@user-grinch
user-grinch merged commit b22f61b into user-grinch:main Aug 30, 2026
2 checks passed
@CanerKaraca23
CanerKaraca23 deleted the feat-render-dynamic-surfaceprops branch August 30, 2026 01:21
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