Garry's Mod

Garry's Mod

4,231 ratings
Advanced Light Entities
4
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Effects
Addon Tags: Build, Scenic
File Size
Posted
Updated
3.529 MB
4 Aug, 2015 @ 12:16am
22 Aug @ 9:19pm
16 Change Notes ( view )

Subscribe to download
Advanced Light Entities

Description
2025/8/17 - 2025/8/22
Update Summary:
  • Replaced the old entities with new ones that have more features (the old entities still exist and can still be spawned; see below).
  • Added new options to the editor panel.
  • Added new vgui elements to make editing easier.
  • Major optimizations.
  • Much more.

Notes on Compatibility:
  • All six original light entities from the old version are still implemented in this new version! This means that this new version should not break any content that uses the old version, as the original entities still exist in the game (they're just not in the spawn menu by default). However, let me know if anything does not work correctly!
  • Because the original legacy entities still exist alongside the new ones, you can still spawn them if you need to. You can do this by right-clicking on an icon for a light entity, going to "Spawn other version", and clicking on a class name:

    You can also spawn them by using the console command gm_spawnsent with the name of the entity class, like this:
    gm_spawnsent cheap_light
    The class names of the legacy entities are cheap_light, expensive_light, expensive_light_new, projected_light, projected_light_new, and spot_light.
  • Certain other mods (such as Stop Motion Helper and similar) that have support for the old version of this mod may not yet have support for the new entities. Until those other mods update to be compatible, you can spawn the original legacy entities to use with them as explained above.
  • I felt having a separate cleanup option for each type of light entity was cluttering the cleanup menu, so I replaced the separate options with a single "Advanced Lights" option.
  • If you have any issues with the new version, set the console variable advlights_legacy to 1 and restart. This will disable all new content and make the original legacy light entities available from the spawn menu again (but without spawn icons). This will also restore the original cleanup options.
  • You can convert a legacy entity to a new version using the console command advlights_update. Calling this with "trace" will convert the entity you're looking at, using "pvs" will convert all lights in the current potentially visible set, and using "world" will convert all lights in the current map. Using a number as a second optional parameter allows you to specify a delay. Currently, this concommand simply replaces the old entity with a new entity and copies over light settings. It does not copy any other external things, including attached constraints!

Update Details:
  • When you open an editor, an icon with an anchor will appear under your cursor. Click it to make the context menu hang open.
  • The editor panels are re-written and have the maximize button enabled to easily control the panel window. They also have tabs.
  • The rows in the "Raw Data" tab have dots next to them that indicate if a value is different from default by turning blue. Clicking a dot when it's blue will reset the value, then clicking it while it's white will set it back to the previous value. Right clicking a dot will open a menu with additional options (some of which may not currently be implemented).
  • You can reset, remove, and edit the position and angles of a light entity from the "Actions" tab in the editor menu. For the position or angles editor, the blued-out top section displays the current value, while the bottom section is where you can enter a new value which then must be applied by clicking the button to the left. The menu on the right lets you select a system.
  • The color tab has a color button on top that lets you pick a color from the world. Click this button and then click somewhere else to pick a color.
  • The projected light has a "Texture" tab that lets you set the texture using a material selector. You can specify what parameter on the material to get the texture from using the panel on the bottom, and clicking the label on the blued-out text bar on top will open a file browser that lets you find any material in the game. Right clicking on either the label or a material icon will open a menu with additional options.
  • Much more.




Description:
This addon adds four simple entities to the game:
  • A one-of-a-kind, shadow-casting point light
  • A normal ("cheap") point light
  • A projected light
  • A "spot" light (that uses the built-in light_dynamic entity)

Each entity is very basic and fully editable!
You can spawn them from the entities tab in the spawn menu, and you can edit them by right-clicking from the context menu and selecting "Edit Properties". The "cheap" point light is the same kind that the light tool creates, and the projected light is the same kind that the lamp tool creates. What makes these entities so special is that they are very simple -- no models, no ropes -- just the basic light. And they are also fully editable! They can have any of their many properties changed in real time, just like the editor entities!

You can use the material tool and the lamp tool to change the texture of the projected light, and you can use the color tool and the light tool to change the color of any light!

Notes:
  • You must have Shadow Detail set to High for shadows to work! From the main menu, go to Options -> Video -> Advanced -> Shadow Detail and set Shadow Detail to High. If there is no option for High, try this: From your game library, right click on Garry's Mod, go to Properties, click on SET LAUNCH OPTIONS... and try adding:
    -force_vendor_id 0x10DE -force_device_id 0x1180
    or
    -force_vendor_id 0x10DE -force_device_id 0x1180 -dxlevel 95
  • To spawn more than one expensive light you must increase the number of shadow textures. The projected light uses 1 shadow texture and the expensive light uses 6 shadow textures. By default, the engine does not support more than 8 shadow textures. To increase this number, do this: From your game library, right click on Garry's Mod, go to Properties, click on SET LAUNCH OPTIONS... and add:
    -numshadowtextures 16
    You don't have to use exactly 16, but don't set it too high.
  • Textures not specifically made to be projected may not project correctly on to models in Windows, and may not project correctly on to anything in OSX or other operating systems.
  • The "Simple FOV Mode" setting for the projected light makes the light entity simply obey the "FOV" setting. Disabling this setting will make the entity obey the separate "Horizontal FOV" and "Vertical FOV" settings, which don't seem to currently work correctly.
Popular Discussions View All (19)
7
7 Aug @ 3:58pm
New Update Broke Everything
Tyrian
19
1 Aug, 2024 @ 11:51am
No shadows
greek
2
21 Aug @ 12:56pm
Grainy shadows
BluerSonic
559 Comments
George_the_Crab 3 Sep @ 3:14am 
This legit remains the best addon throughout the years. Turns gmod into lightweight blender. It's cool that it got an update, but I agree, spot light and projected light lack that red pointy arrow that shows where the light is aiming at originally.
Diokat 2 Sep @ 10:39pm 
ah i gotcha.. im guessin the only way to probably soft-reset my console settings or so would be reinstalling or.. maybe deleting my autoexec? sorry if im soundin dumb, super late rn lol
tau  [author] 2 Sep @ 10:34pm 
@Diokat
It definitely seems like there's something wrong with your system. I recommend doing some careful uninstalling and reinstalling to try to fix things. To clarify about the issue, the first legacy projected light (the one simply named "projected_light") uses the built-in Source Engine "env_projectedtexture" entity, which is also what the gmod lamp tool uses. The second legacy projected light and the updated new one both use "ProjectedTexture" objects, which are client-side objects and essentially just simple handles for controlling the projected light effect itself. It seems like there's a discrepancy between them on your system that's not there for others.
Diokat 2 Sep @ 10:23pm 
im.. not quite sure to be honest with you, not sure which is which of the entity/object youre mentioning, but truth be told ive also been coming across quite a few other issues lately that i have no idea where they came from now ( SOME TF2 skyboxes missing, maps tearing, etc )
tau  [author] 2 Sep @ 10:13pm 
@Diokat
I just played around with "r_flashlightdepthres" for both the old versions and the new one, and everything worked exactly the same. I even tried spawning an old projected light and converting it to a new one using the "advlights_update" concommand with a delay while looking at the shadows, and I did not see any difference. I think the issue you're having is on your side, and is a difference between the built-in "env_projectedtexture" entity and the gmod "ProjectedTexture" object. Is there anything unusual about your gmod installation or the system you're running it on?
Diokat 2 Sep @ 9:21pm 
just got into using gmod after like 2 weeks and now no matter how high my r_flashlightdepthres code is put at, the new lights give off very grainy shadows, but the old/legacy ones are working perfectly (Projected Light btw, havent tried any of the others) hope theres a fix soon!
creepernator152 23 Aug @ 12:16am 
is there a way to have the helper for the projected light show which way the light is facing by showing a longer arrow? not sure why that was removed tbh

also is there a way to make the menu appear in the middle of the screen by default like it used to?
tau  [author] 22 Aug @ 11:00pm 
NEW -- I just pushed an update that may make the expensive light have slightly better shadows and use less memory. PLEASE LET ME KNOW IF ANYTHING LOOKS WRONG! I also added the ability to spawn original legacy entities by right-clicking on an icon for a light entity, going to "Spawn other version", and selecting a class name. Please see the most recent change note for details on the update. I have also updated the description again, so please see the top section.
Master-Queed 21 Aug @ 6:44pm 
@tau can u update it so that the regular light and the spot light have shadow?
Sir-Isembard-64 21 Aug @ 10:26am 
@tau
Well, I guess It is not deleting lamps from previous savefiles.

But It happened the opposite way, I started using updated Lamps, but when I realized I can't use SMH with updated version, I used "advlights_legacy 1" in console. After I reloaded Gmod, all New lamps disappeared, so I had to place Legacy lamps from scratch. It took just a few minutes to place them back as Legacy version, but It scared me, like it could possibly happen with my old savefiles. Thanks anyway.