Do lights in GLDEFS apply to 3D models?

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

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.
Kzer-Za
Posts: 514
Joined: Sat Aug 19, 2017 11:52 pm
Graphics Processor: nVidia (Modern GZDoom)

Do lights in GLDEFS apply to 3D models?

Post by Kzer-Za »

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?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49098
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Do lights in GLDEFS apply to 3D models?

Post by Graf Zahl »

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.
Kzer-Za
Posts: 514
Joined: Sat Aug 19, 2017 11:52 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Do lights in GLDEFS apply to 3D models?

Post by Kzer-Za »

Thanks!
Kzer-Za
Posts: 514
Joined: Sat Aug 19, 2017 11:52 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Do lights in GLDEFS apply to 3D models?

Post by Kzer-Za »

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:

Code: Select all

pointlight GOLDWANDCRYSTAL1
{
    color 0.7 0.5 0.0
    size 26
    offset 0 26 0
}
Here's the hold state:

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
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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49098
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Do lights in GLDEFS apply to 3D models?

Post by Graf Zahl »

The HUD sprites are not part of an actor - you cannot attach lights to them - this will just be ignored.
Kzer-Za
Posts: 514
Joined: Sat Aug 19, 2017 11:52 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Do lights in GLDEFS apply to 3D models?

Post by Kzer-Za »

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")

Return to “Assets (and other stuff)”