Do lights in GLDEFS apply to 3D models?
Moderators: GZDoom Developers, Raze Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
-
- Posts: 509
- Joined: Sat Aug 19, 2017 11:52 pm
- Graphics Processor: nVidia (Modern GZDoom)
Do lights in GLDEFS apply to 3D models?
You can create Modeldefs for 3D models and assign them sprite names there, but will the lights from GLDEFS be applied to them, or do they apply only to actual sprites?
-
- Lead GZDoom+Raze Developer
- Posts: 48845
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Do lights in GLDEFS apply to 3D models?
Yes, they just apply the same.
However, if you create custom content you may save yourself some work and attach the lights to the actual ZSCript or DECORATE definition by adding the 'light(lightnsme)' keyword to the states themselves. Check out the StrifeHumanoid class for an example.
However, if you create custom content you may save yourself some work and attach the lights to the actual ZSCript or DECORATE definition by adding the 'light(lightnsme)' keyword to the states themselves. Check out the StrifeHumanoid class for an example.
-
- Posts: 509
- Joined: Sat Aug 19, 2017 11:52 pm
- Graphics Processor: nVidia (Modern GZDoom)
-
- Posts: 509
- Joined: Sat Aug 19, 2017 11:52 pm
- Graphics Processor: nVidia (Modern GZDoom)
Re: Do lights in GLDEFS apply to 3D models?
And are these lights applied to HUD weapons? I'm trying to make a weapon emit a light when Altfire is held for some time, but I don't see the light, though the same light, when it's attached to its ammo I do see. Here's the light:
Here's the hold state:
The idea is that the weapon stays emitting the light while the altfire is held, and the shot is made when it's released. But I don't see the light, though it's noticeable when coming from ammo.
Code: Select all
pointlight GOLDWANDCRYSTAL1
{
color 0.7 0.5 0.0
size 26
offset 0 26 0
}
Code: Select all
AltHold:
GWND A 1 Light("GOLDWANDCRYSTAL1")
GWND A 1 Light("GOLDWANDCRYSTAL1") A_Refire("AltHold")
GWND A 1 Offset(0, 33) // I haven't made the shot itself yet
Goto Ready
-
- Lead GZDoom+Raze Developer
- Posts: 48845
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Do lights in GLDEFS apply to 3D models?
The HUD sprites are not part of an actor - you cannot attach lights to them - this will just be ignored.
-
- Posts: 509
- Joined: Sat Aug 19, 2017 11:52 pm
- Graphics Processor: nVidia (Modern GZDoom)
Re: Do lights in GLDEFS apply to 3D models?
Ah, okay. I guess for lighting up a weapon I can use something like
Code: Select all
GWND A 1 bright A_SpawnItemEx("some-object-with-attached-light-living-1-tic")