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!
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.

Do lights in GLDEFS apply to 3D models?

Postby Kzer-Za » Tue Feb 12, 2019 5:19 am

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?
Kzer-Za
 
Joined: 20 Aug 2017

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

Postby Graf Zahl » Tue Feb 12, 2019 6:27 am

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.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

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

Postby Kzer-Za » Tue Feb 12, 2019 6:31 am

Thanks!
Kzer-Za
 
Joined: 20 Aug 2017

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

Postby Kzer-Za » Tue Feb 12, 2019 12:14 pm

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 allExpand view
pointlight GOLDWANDCRYSTAL1
{
    color 0.7 0.5 0.0
    size 26
    offset 0 26 0
}


Here's the hold state:

Code: Select allExpand view
   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.
Kzer-Za
 
Joined: 20 Aug 2017

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

Postby Graf Zahl » Tue Feb 12, 2019 1:30 pm

The HUD sprites are not part of an actor - you cannot attach lights to them - this will just be ignored.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

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

Postby Kzer-Za » Tue Feb 12, 2019 1:40 pm

Ah, okay. I guess for lighting up a weapon I can use something like

Code: Select allExpand view
GWND A 1 bright A_SpawnItemEx("some-object-with-attached-light-living-1-tic")
Kzer-Za
 
Joined: 20 Aug 2017


Return to Assets (and other stuff)

Who is online

Users browsing this forum: No registered users and 0 guests