Garry's Mod Wiki

Garry's Mod Wiki

  render.SetLightingMode( number Mode )


Sets lighting mode when rendering something.

Do not forget to restore the default value to avoid unexpected behavior, like the world and the HUD/UI being affected


1 number Mode
Lighting render mode

Possible values are:

  • 0 - Default
  • 1 - Total fullbright, similar to mat_fullbright 1 but excluding some weapon view models
  • 2 - Increased brightness(?), models look fullbright


Draws a fullbright quad on 2D skybox

local MATERIAL = Material("skybox/trainup") hook.Add("PostDraw2DSkyBox", "Quaddrawer", function() render.OverrideDepthEnable( true, false ) render.SetLightingMode(2) cam.Start3D(Vector(0, 0, 0), EyeAngles()) render.SetMaterial(MATERIAL) render.DrawQuadEasy(Vector(200,0,0), Vector(-1,0,0), 64, 64, Color(255,255,255), 180) cam.End3D() render.OverrideDepthEnable( false, false ) render.SetLightingMode(0) end)


Display everything the same way as when you set mat_fullbright to 1.

local LightingModeChanged = false hook.Add( "PreRender", "fullbright", function() render.SetLightingMode( 1 ) LightingModeChanged = true end ) local function EndOfLightingMod() if LightingModeChanged then render.SetLightingMode( 0 ) LightingModeChanged = false end end hook.Add( "PostRender", "fullbright", EndOfLightingMod ) hook.Add( "PreDrawHUD", "fullbright", EndOfLightingMod )

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated twice a day. Edits and history are not available.

Last Parsed: Loading...