Is There A Tutorial To Create Brightmaps [Images]?

Handy guides on how to do things, written by users for users.

Moderators: GZDoom Developers, Raze Developers

Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.
Post Reply
User avatar
ReX
Posts: 1578
Joined: Tue Aug 05, 2003 10:01 am
Location: Quatto's Palace
Contact:

Is There A Tutorial To Create Brightmaps [Images]?

Post by ReX »

I know how to use Brightmaps once the relevant images have been created. My question has to do with the creation of the images themselves. [I did make Brightmaps a few years ago, but have forgotten how to create them.] I have searched the internets and have read through the forums and tutorials (e.g., the one written by Kappes Buur), but they mostly cover the aspects pertaining to creating elements of the pk3.

The tools I have at my disposal are XnView and GIMP. XnView has a feature to convert to greyscale, and I thought that was what I had used years ago, but it doesn't produce the black/white/grey that Brightmap images need to be. I came across a tutorial to convert images using GIMP, but the process was much to cumbersome, and I gave up. I think the feature I need is one that converts a color image into a black & white one (with shades of grey).

Does anyone know of a tutorial to efficiently convert images into Brightmap format? I'm looking to convert about 200 images.
User avatar
phantombeta
Posts: 2088
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: Is There A Tutorial To Create Brightmaps [Images]?

Post by phantombeta »

ReX wrote:The tools I have at my disposal are XnView and GIMP. XnView has a feature to convert to greyscale, and I thought that was what I had used years ago, but it doesn't produce the black/white/grey that Brightmap images need to be. I came across a tutorial to convert images using GIMP, but the process was much to cumbersome, and I gave up. I think the feature I need is one that converts a color image into a black & white one (with shades of grey).
Actually, brightmaps are greyscale, not black and white. In fact, they can actually be coloured too.
However, there isn't really a way to automatically make brightmaps. You have to colour the image yourself based on what should be bright. An automated process won't really be able to do this, a brightmap that's just a greyscale version of the image will have pretty much everything in the image either brighter or darker than it should be.
User avatar
ReX
Posts: 1578
Joined: Tue Aug 05, 2003 10:01 am
Location: Quatto's Palace
Contact:

Re: Is There A Tutorial To Create Brightmaps [Images]?

Post by ReX »

phantombeta wrote:... a brightmap that's just a greyscale version of the image will have pretty much everything in the image either brighter or darker than it should be.
Yes, that's what I discovered recently when I tried to use XnView to convert to greyscale. But for the life of me I can't recall how I created the Brightmaps those many years ago. I'm pretty sure I didn't manually recolor each image; that would have caused me to pull out my beard-hair by the handfuls.
User avatar
Caligari87
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Is There A Tutorial To Create Brightmaps [Images]?

Post by Caligari87 »

GIMP has a "desaturate" option under the color menu, and / or you can change the image mode to greyscale under Image > Mode. Obviously you still have to adjust the resulting greyscale image to have bright and dark areas as desired. If you want to get fancy with it, look into channel splitting to get the data you want (for example, if your image should have glows on blue parts, you can extract just the blue channel and adjust contrast/levels/curves). The plugin "G'MIC" for GIMP also has an extensive library of channel splitting and combination methods.

8-)
User avatar
ReX
Posts: 1578
Joined: Tue Aug 05, 2003 10:01 am
Location: Quatto's Palace
Contact:

Re: Is There A Tutorial To Create Brightmaps [Images]?

Post by ReX »

Thanks for the tips, Caligari87. I must be mistaken in the level of effort this endeavor requires; I had imagined the image conversion to be a straightforward process, and I even thought I could do batch-processing of multiple images. My memory must be playing tricks with me.

Regardless, I'll try out what you suggested, and see how long it takes to convert each image. If it seems like it might take too long, I'll probably give up (or string the task out over a longer period of time). Basically, I have a bunch of textures that have some form of lighting or another, mostly in very small portions of each image. I simply want that lighting to be brightmapped, and it might not take an inordinate amount of time.
User avatar
Caligari87
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Is There A Tutorial To Create Brightmaps [Images]?

Post by Caligari87 »

The problem is that there's no way to automatically determine how bright something should be. Like, if you want glowing red monster eyes, then you have draw the intended glow by hand, because the blood on the monster sprite is also red. You can sometimes infer brightness based on the image data, but if you don't hand-tweak the result then a white shirt is going to glow brighter than a blue light strip, because the automatic image conversion simply has no idea what the pixels mean.

8-)
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Is There A Tutorial To Create Brightmaps [Images]?

Post by Enjay »

Although it does require manual editing of each image, I find it to be a pretty quick process. I have done literally hundreds, if not thousands of brightmaps and they don't take that long. I know that I certainly did some for a certain Half-Life themed mod a few years back that were easy enough to do. We probably both dod some of the ones there. I can't remember exactly.

I use Paint Shop Pro and my system is pretty simple. I select the entire image and deselect any bits that I want to be bright using the normal selecting tools (equivalents of which will be in any decent painting program). Then I press delete and all the bits that I don't want to be bright vanish. The deleted area is filled with black and I can do any adjustments that I need on the remaining bright bits (usually lightening them a bit - easy to do when you know the quick key strokes for adjusting the brightness). With images the size of Doom textures and sprites, this is all very easy.

These days I tend to leave a bit of colour on the brightmap. I have noticed that with certain graphics settings, the bright area can spill onto the surrounding pixels slightly. So, if you have, say, a texture with a bright red dot on a grey background, making a pixel-perfect white dot on the brightmap where the red dot is on the texture will give you a nice bright red dot in game but you might see a slight hint of bright grey around the edges of the dot too. If however, the dot on the brightmap is still at least a bit red coloured, the "overspill" takes that colour on too and so it looks like a more natural lighting effect.
User avatar
ReX
Posts: 1578
Joined: Tue Aug 05, 2003 10:01 am
Location: Quatto's Palace
Contact:

Re: Is There A Tutorial To Create Brightmaps [Images]?

Post by ReX »

Caligari87 wrote:The problem is that there's no way to automatically determine how bright something should be.
So I take it that, even if a specific part of the image (say, the part representing a light source) needs FULLBRIGHT, it can't be done automatically? Is there no way to select a color (e.g., white) and have all white parts of the image be brightmapped/all non-white areas to be blackened? [Enjay's method of "deselecting" might be what I am asking, but in reverse.]
Enjay wrote:I select the entire image and deselect any bits that I want to be bright using the normal selecting tools (equivalents of which will be in any decent painting program).
I poked around in XnView, and I don't believe I can "deselect" parts of the image. I did the same in GIMP (using this guide) but I got unsatisfactory results. I'll keep at it, and see if I can do better.

Thanks to all for the education and for your helpful ideas.
User avatar
Kappes Buur
 
 
Posts: 4120
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada
Contact:

Re: Is There A Tutorial To Create Brightmaps [Images]?

Post by Kappes Buur »

ReX wrote: So I take it that, even if a specific part of the image (say, the part representing a light source) needs FULLBRIGHT, it can't be done automatically?
It is done sort of automatically, the level of brightness is indicated by the range of black to white.

Some time ago, I made some brightmaps for the Bishop in HEXEN. Maybe that will help.
All I remember of the process is that I made it in PSP 7.04 by converting the Bishop images to greyscale and manipulated the contrast.
User avatar
ReX
Posts: 1578
Joined: Tue Aug 05, 2003 10:01 am
Location: Quatto's Palace
Contact:

Re: Is There A Tutorial To Create Brightmaps [Images]?

Post by ReX »

Kappes Buur wrote:.... the level of brightness is indicated by the range of black to white.

.... I made it in PSP 7.04 by converting the Bishop images to greyscale and manipulated the contrast.
That is my recollection of how I did it previously, but I can't replicate what I did. At any rate, I tried things using a 3-step process in XnView:

1. Convert to greyscale (256 color) [Image > Convert to Grey > 256Grey scale]
2. Adjust brightness (not contrast) - essentially, reducing brightness all the way down to -127 [Image > Adjust > Brightness/Contrast/Gamma/Balance]

The best I could get was a dark grey, not black. Here are the results:
Original Image
Original Image
DARK156.jpg (16.63 KiB) Viewed 3030 times
Modified Image 1
Modified Image 1
DARK156.png (16.7 KiB) Viewed 3030 times
3. Next, I adjusted the black & white levels - Black Point = 112, White Point = 116 [Image > Adjust > Levels]

Here is the final result:
Modified Image 2
Modified Image 2
DARK156A.png (610 Bytes) Viewed 3030 times
This appears to be a reasonable facsimile of what a brightmap ought to be. If someone else can take a shot at making a better brightmap of the original image, and can document the steps, I'd appreciate it. [Unfortunately, I don't have Photoshop, so I'll need to figure out what the equivalent steps are in XnView or GIMP.]
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Is There A Tutorial To Create Brightmaps [Images]?

Post by Enjay »

Dunno if this is any good. With the original image being a JPG, there are lots of compression artefacts that make getting a nice clean image more difficult.

Image
User avatar
ReX
Posts: 1578
Joined: Tue Aug 05, 2003 10:01 am
Location: Quatto's Palace
Contact:

Re: Is There A Tutorial To Create Brightmaps [Images]?

Post by ReX »

Enjay wrote:Dunno if this is any good.
I like your version a whole lot better than mine, as it has just the correct amount of traces of grey. What did you do to get this result? [I know you're a PhotoShop user, but it would still help for me to know. Perhaps I might be able to translate your steps for use in XnView or GIMP.]
With the original image being a JPG, there are lots of compression artefacts that make getting a nice clean image more difficult.
Yes, I had figured that working with a JPEG original might create some issues. Unfortunately, the source image I used to create the various patches is in JPEG format. What are my options? Convert each image into PNG format before beginning the process of creating the brightmaps?

[EDIT: I tried converting the JPEG image into PNG format & adopting the steps I outlined above. Sadly, the result is no different than what I achieved without a conversion to PNG format. Therefore, I'm guessing that I need to modify something else.]
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Is There A Tutorial To Create Brightmaps [Images]?

Post by Enjay »

Paint Shop Pro 7.04 rather than PhotoShop but anyway...

After figuring that the jpeg artefacts were going to make simple editing a bit of a no-go, I just played with the brightness and contrast until I got the background black and the light bits near white. This was basically an image pretty much like your brightmap.

I did a tiny bit of manual touch up (a handful of pixels had ended up being white rather than black).

Then I copied the image using white as the background colour (so that the white bits became transparent in the copy).

I applied a small amount of blur to the original image to get the grey-fade edges.

Then I pasted the copy with the transparent bits back on top of the blurred image to restore the hard edges where the black needed to be (i.e. effectively this meant that I had blurred the light bits but not the black bits).


It probably sounds complicated but I know PSP and its keyboard shorcuts very well so it probably took me longer to type this post than it did to make the brightmap.
User avatar
ReX
Posts: 1578
Joined: Tue Aug 05, 2003 10:01 am
Location: Quatto's Palace
Contact:

Re: Is There A Tutorial To Create Brightmaps [Images]?

Post by ReX »

Enjay wrote:It probably sounds complicated ....
Indeed, it does. I don't believe I will be able to duplicate what you've done using the tools at my disposal. But I'll keep at it, perhaps using GIMP instead.

Nonetheless, thanks for the tutorial.
User avatar
Kappes Buur
 
 
Posts: 4120
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada
Contact:

Re: Is There A Tutorial To Create Brightmaps [Images]?

Post by Kappes Buur »

If you need to convert many sprites, flats, textures to brightmaps, then
XnView is quite helpful with its Batch Processing tool.

For example the SARG sprites.

Copy the SARG sprites into a folder.
Start up XnView and select Tools - Batch Processing.

Settings in the General tab
Spoiler:
Settings in the Transformations tab
Spoiler:
Start up Slade3 and load your pwad.
Drag the greyscaled sprites into your map.
Spoiler:
Make the GLDEFS lump
Spoiler:
Result
Spoiler:
Post Reply

Return to “Tutorials”