Fully lit 3D sources of light

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom 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.

Fully lit 3D sources of light

Postby Kzer-Za » Wed Jun 10, 2020 8:13 am

Sprites with lights attached to them are always lit by these lights to the full extent. However, 3D objects with a light source attached to them look actually less lit than the objects around them. I supose that's because their sides are considered turned away from the light source, since the light is positioned inside of it. Is their a way to recognise such an object as a light source and make it lit by the light attached to it?

Making such an object +BRIGHT is a poor option. First, it displays the object as lit by the brightest light possible, while the light attached to it may be rather dim and small. Second, it displays the object as lit by white light, while the light attached to it may be (and most often is) colored. Currently the only option seems to be to spawn several invisible objects (with smaller lights of the same color attached to them) around any such object. Maybe there is some smarter way?

PS Also, making objects Bright helps (even partially) only in case of additive lights, but not in case of subtractive lights. For example, I made Iron Liches bearers of subtractive light sources, and it looks pretty strange that they darken everything around them, but stay pretty well lit themselves.
Kzer-Za
 
Joined: 20 Aug 2017
Operating System: Other Linux 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: Fully lit 3D sources of light

Postby Enjay » Wed Jun 10, 2020 10:11 am

Model skins can have brightmaps attached to them in the same way as you can do for textures. Would that help?
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Fully lit 3D sources of light

Postby Kzer-Za » Wed Jun 10, 2020 12:41 pm

Thanks for the idea, that partially solves the problem (though I shudder to think what a pain in the hind end it's gonna be, creating all those brightmaps, and changing them if I decide to change the tone of the attached light). But it covers only additive lights, and not subtractive lights. Unless subtractive light can be emulated by making the fog denser around the actor, but as far as I know, fog is a sector property.
Kzer-Za
 
Joined: 20 Aug 2017
Operating System: Other Linux 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: Fully lit 3D sources of light

Postby Moebius » Sat Jun 05, 2021 7:55 pm

Enjay, how do you make a brightmap for a texture used as a surface skin on a 3D model? I know how to make a brightmap for a texture used as a wall or floor/ceiling. I have a 3D model that uses a texture that already has a brightmap for it and it doesn't "glow". I have another 3D model that has a light bulb texture I made. It looks lit in UDB but unlit in the game. Is there a certain way to define it?
Moebius
 
Joined: 28 Jan 2021

Re: Fully lit 3D sources of light

Postby Kzer-Za » Sat Jun 05, 2021 8:27 pm

For me it worked simply after I defined it in GLDEFS with this:

Code: Select allExpand view
brightmap texture "path_to_texture/mytexture.png"
{
   map "path_to_brightmap/mybrightmap.png"
}


Where mytexture.png is the texture defined in the MODELDEF.
Kzer-Za
 
Joined: 20 Aug 2017
Operating System: Other Linux 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: Fully lit 3D sources of light

Postby Enjay » Sun Jun 06, 2021 3:00 am

By sheer coincidence, I made this simple example for another thread entirely just a few days ago. It might help.

LightCube.pk3



Something else that struck me while re-reading this thread - ambient occlusion also affects models and can make them look a but dull in appearance even if they are well lit and have brightmaps.
You do not have the required permissions to view the files attached to this post.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Fully lit 3D sources of light

Postby Graf Zahl » Sun Jun 06, 2021 5:48 am

What can you do? If it had been my vote only, AO would never have made it into the engine, it's the single biggest cause of rendering issues.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Scripting

Who is online

Users browsing this forum: No registered users and 1 guest