How to make dynamic light affect PNG middle textures

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
WARCHILD_89
Posts: 452
Joined: Sun Nov 17, 2013 12:27 pm
Graphics Processor: nVidia with Vulkan support
Location: MIA between doomed dimensions

How to make dynamic light affect PNG middle textures

Post by WARCHILD_89 »

To anyone using the flashlight by "the zombie killer" or the lamplight from the "Lasting Light" mod or something similiar, here is one thing I discovered and it helps, when light does not affect middle textures:

It seems to me that the reason is the image format!

I created a texture that shows a plant in PNG format with transparency:
https://fbcdn-sphotos-d-a.akamaihd.net/ ... 7368_n.jpg


pointing the flashlight on it does have no effect:
https://fbcdn-sphotos-h-a.akamaihd.net/ ... 8977_n.jpg


After trying around with 3d floors and linedefs, I had a new idea, I tested it on an original Texture from doom 2 that also has transparent areas and I got this:
https://fbcdn-sphotos-b-a.akamaihd.net/ ... 3538_n.jpg

so to get a dynamic light affecting my tree, I have to convert the image to doom format and it works, the tree is being affected
(something went wrong with the colors, but this is not the point now):
https://fbcdn-sphotos-g-a.akamaihd.net/ ... 9604_n.jpg
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: How to make dynamic light affect PNG middle textures

Post by Gez »

Not so much the image format (everything is converted to an internal bitmap-like format anyway) but the image properties. Namely, full alpha channel or not. The Doom graphics format has no alpha channel to speak off: pixels are either fully transparent or fully opaque.
User avatar
Nash
 
 
Posts: 17498
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: How to make dynamic light affect PNG middle textures

Post by Nash »

How come the dynamic light only illuminates textures without full alpha? Seems like a bug...
User avatar
WARCHILD_89
Posts: 452
Joined: Sun Nov 17, 2013 12:27 pm
Graphics Processor: nVidia with Vulkan support
Location: MIA between doomed dimensions

Re: How to make dynamic light affect PNG middle textures

Post by WARCHILD_89 »

I wonder how I can make an image behave like the doom textures, does anybody know what kind of image format to use?
User avatar
Marrub
 
 
Posts: 1202
Joined: Tue Feb 26, 2013 2:48 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Arch Linux
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: How to make dynamic light affect PNG middle textures

Post by Marrub »

WARCHILD_89 wrote:I wonder how I can make an image behave like the doom textures, does anybody know what kind of image format to use?
I think there's a way to remove the full alpha channel (and just have binary opacity) from a PNG to make it act like a doom-format texture, but I don't exactly know how. Color Quantizer on very slow setting might remove it if it isn't needed.
User avatar
WARCHILD_89
Posts: 452
Joined: Sun Nov 17, 2013 12:27 pm
Graphics Processor: nVidia with Vulkan support
Location: MIA between doomed dimensions

Re: How to make dynamic light affect PNG middle textures

Post by WARCHILD_89 »

I finally did it. The thing is to safe the png file not with transparency, take a color instead. I took white for example.

Then, convert the png in SLADE 3 to PNG Truecolor, (otherwise the image turns black and white) set the transparency color to white (in my case) and there you go, all the white areas in the image are transparent now!
https://fbcdn-sphotos-a-a.akamaihd.net/ ... 6727_n.jpg
User avatar
Marrub
 
 
Posts: 1202
Joined: Tue Feb 26, 2013 2:48 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Arch Linux
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Contact:

Re: How to make dynamic light affect PNG middle textures

Post by Marrub »

Yep, that's a way of doing it. Still seems like a bug though.
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: How to make dynamic light affect PNG middle textures

Post by Gez »

Nash wrote:How come the dynamic light only illuminates textures without full alpha? Seems like a bug...
Oh, it is. I'm just pointing out the real cause of the discrepancy. There are different paths to render images with full alpha and images without full alpha.
Locked

Return to “Editing (Archive)”