Garry's Mod Wiki

DModelPanel:SetAmbientLight

  DModelPanel:SetAmbientLight( table color )

Description

Sets the ambient lighting used on the rendered entity.

Arguments

1 table color
The color of the ambient lighting.

Example

Displays a model panel with a watermelon that has red ambient lighting.

BGPanel = vgui.Create("DPanel") BGPanel:SetPos(20, 20) BGPanel:SetSize(200, 200) local mdl = vgui.Create("DModelPanel", BGPanel) mdl:SetSize(BGPanel:GetSize()) mdl:SetModel("models/props_junk/watermelon01.mdl") mdl:SetCamPos(Vector(15, 15, 0)) mdl:SetLookAt(Vector(0, 0, 0)) mdl:SetAmbientLight(Color(255, 0, 0, 255))
Output: