Skip to content

Implement engine client lighting queries - #258

Merged
marchc1 merged 1 commit into
SourceDotNET:mainfrom
Earu:engine/client-lighting
Nov 13, 2026
Merged

marchc1 merged 1 commit into
SourceDotNET:mainfrom
Earu:engine/client-lighting

Conversation

@Earu

@Earu Earu commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Second split from #256.

  • IEngineClient.ComputeLighting, ComputeDynamicLighting, GetLightForPoint, GetLightForPointFast now go through the lightcache instead of throwing or returning zero. ComputeLighting takes a nullable normal (null returns the averaged ambient cube, like the SDK's pNormal == NULL).
  • IModelRender.SetupLighting: sets the ambient cube, local cubemap and up to two local lights on the render context, same as SDK 2013 CModelRender::SetupLighting.
  • ModelRender.WorldLightToMaterialLight is now internal for reuse by the lightcache.

Studiorender calls are guarded for dedicated builds. Behaviour was checked against GMod's engine.dll.

Implement ComputeLighting, ComputeDynamicLighting, GetLightForPoint and
GetLightForPointFast on the engine client, and add
IModelRender.SetupLighting, all matching GMod's engine.dll.
@marchc1
marchc1 merged commit 0c2aa5f into SourceDotNET:main Nov 13, 2026
16 checks passed
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