[Tutorial] Models with brightmaps in GZDoom

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.
User avatar
MaxED
Posts: 2246
Joined: Tue Feb 28, 2012 12:55 pm

[Tutorial] Models with brightmaps in GZDoom

Post by MaxED »

Image

In this short tutorial I'll show you how brightmaps can be applied to models in GZDoom.

1. Place your model and model's texture somewhere inside "textures" folder, like so:

Code: Select all

\textures\models\a_cellpack\cellpack.md2
\textures\models\a_cellpack\cellpack.png
2. Add GLDEFS brightmap definition for model's texture, like so:

Code: Select all

brightmap texture cellpack {
  map "models/a_cellpack/cellpack_bm.png"
}
3. Done!

Example wad
User avatar
Enjay
 
 
Posts: 26516
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: [Tutorial] Models with brightmaps in GZDoom

Post by Enjay »

Ha! I've wanted brightmaps on model skins for ages - and the answer was there and staring me in the face all along. Thanks very much.
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: [Tutorial] Models with brightmaps in GZDoom

Post by Blue Shadow »

Wouldn't it be better to have this on the wiki?
User avatar
Enjay
 
 
Posts: 26516
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: [Tutorial] Models with brightmaps in GZDoom

Post by Enjay »

Hmmm, one thing that bothers me about this: it means having to put non textures data into the textures namespace (ie the models). No errors are spat out ATM but it just worries me that something could crop up and mean this doesn't work in the future.
User avatar
Springy
Posts: 532
Joined: Thu Mar 08, 2012 3:22 am
Location: Earth

Re: [Tutorial] Models with brightmaps in GZDoom

Post by Springy »

Nice will give this a try, I think this would be quite useful for others as well. Could it be stickied or put on the wiki as suggested by Blue Shadow?
User avatar
MaxED
Posts: 2246
Joined: Tue Feb 28, 2012 12:55 pm

Re: [Tutorial] Models with brightmaps in GZDoom

Post by MaxED »

Springy wrote:Nice will give this a try, I think this would be quite useful for others as well. Could it be stickied or put on the wiki as suggested by Blue Shadow?
Not sure about this. It's not an engine feature, it's more like a hack, so it's completely unsupported and may be broken in the future. Have anybody made a request to add brightmaps to models "officially" (like, new MODELDEF or GLDEFS keyword)?
Last edited by MaxED on Thu Aug 09, 2012 1:22 pm, edited 1 time in total.
User avatar
Springy
Posts: 532
Joined: Thu Mar 08, 2012 3:22 am
Location: Earth

Re: [Tutorial] Models with brightmaps in GZDoom

Post by Springy »

MaxED wrote:
Springy wrote:Nice will give this a try, I think this would be quite useful for others as well. Could it be stickied or put on the wiki as suggested by Blue Shadow?
Not sure about this. It's not an engine feature, it's more like a hack, so it's completely unsupported and may be broken in the future. Have somebody made a request to add brightmaps to models "officially" (like, new MODELDEF or GLDEFS keyword)?
Hmm yeah you made a good point, I'll have a look around see if there's tutorials for the "official way" if not, then guess I'll make a request. Either way I'll give your method a try.
User avatar
Enjay
 
 
Posts: 26516
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: [Tutorial] Models with brightmaps in GZDoom

Post by Enjay »

MaxED wrote:Have anybody made a request to add brightmaps to models "officially" (like, new MODELDEF or GLDEFS keyword)?
I know I requested it at some point in the past and there my be others who have done it.


The worry with this is that I guess it's "undefined behaviour" rather than an explicitly coded feature.
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [Tutorial] Models with brightmaps in GZDoom

Post by Nash »

Cool trick, but yes, it does seem kind of hacky, putting it in the textures namespace. Since it is proven that the code is indeed capable of drawing brightmapped models, I wonder if it's possible to tweak GZDoom's code to add proper support for it?
User avatar
Enjay
 
 
Posts: 26516
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: [Tutorial] Models with brightmaps in GZDoom

Post by Enjay »

Now here's interesting. It's possible to set this up so that the model doesn't have to be in the textures folder.

Code: Select all

Model CellPack {
   Path "models"
   Model 0 "cellpack.md2"
   Path "textures"
   Skin 0 "cellpack.png"
   Scale 80.0 80.0 80.0

   FrameIndex CELP A 0 0
}
I didn't think that it was possible to set a different folder path for the model and the skin but apparently it is.

evidence

I would still appreciate a "yay or nay" from Graf to say whether such a setup is acceptable or not. I don't want to start doing this for it to break at a later date because it wasn't the right way to do things. I've been caught out before doing things that I assumed were OK but which turned out not to be.


Also, as a minor aside, while messing around with this I found that modeldef will accept either a "\" or a "/" to separate the directories in a path but gldefs only accepted "/" and couldn't find the brightmap when I used a "\". Is this something that needs to be addressed?
Gez
 
 
Posts: 17833
Joined: Fri Jul 06, 2007 3:22 pm

Re: [Tutorial] Models with brightmaps in GZDoom

Post by Gez »

Not really. Keep in mind, as awful as that fact is, that \ is a valid frame letter, so it's a valid "name" part of a full path for graphic resources.

And as I have discovered, it's not just sprites! Xaser was evil enough to use \ in a texture name in his "Lost Episode" mod.

So, being strict in only accepting / for path separator makes sense, as \ is ambiguous and could be part of a lump name rather than a separator.
User avatar
Enjay
 
 
Posts: 26516
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: [Tutorial] Models with brightmaps in GZDoom

Post by Enjay »

Gez wrote:makes sense
Indeed. I hadn't even considered that "\" being possible as part of a sprite name could be an issue here.

[Edit] Mind you, it's possible to be even more evil than Xaser ;)

Image

Much to my surprise, I was able to rename a texture lump to WHE\*/EE and use it in a map on a wall and ZDoom displayed it. (Heh, and I renamed the SCRIPTS lump. I forgot about that.) For info, SLADE didn't like the renaming process and whenever a / was entered, it split the name. Both XWE and DeePSea did it and once it had been done, SLADE happily displayed it.
DoomQuaker
Posts: 17
Joined: Mon Dec 24, 2012 6:28 am

Re: [Tutorial] Models with brightmaps in GZDoom

Post by DoomQuaker »

I've read this tutorial and followed instructions for brightmaps, tried but it doesn't work. I've tried it on a model (an imp) to make his eyes glow in the dark but nothing happens. Does it work on mosters?
skornedemon
Posts: 154
Joined: Mon Aug 02, 2010 11:10 am

Re: [Tutorial] Models with brightmaps in GZDoom

Post by skornedemon »

I have never had luck with brightmaps, never really know why.

I just tried this myself with no luck.

Code: Select all

MODELDEF

Model InvulnerabilityHunter
{ 
   Path "Models\Monsters\HunterInvulnerability"
   MODEL 0 "Idle.md3"
   Path "Textures\Models\Monsters\HunterInvulnerability\Skin"
   SKIN 0 "invulhunter.tga"
   Scale 1.0 1.0 1.0
   
   FrameIndex TEST A 0 0

}

GLDEFS

brightmap texture invulhunter {
  map "Models/Monsters/HunterInvulnerability/Skin/invulhunterglow.tga"
}
I should mention that the actual brightmap is in Textures/Models/Monsters/HunterInvulnerability/Skin/

I've seen them work in other mods so I know I can see them.

EDIT: After doing some quick tests, the brightmapped models seem VERY picky(even in terms of typing out directories in GL DEFS and such). I don't believe they work on MD3 models.
There was a case of one gldef file not working,but another with literally copy/pasted stuff working. However I did not get MD3 to achieve it.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [Tutorial] Models with brightmaps in GZDoom

Post by Graf Zahl »

Gez wrote: And as I have discovered, it's not just sprites! Xaser was evil enough to use \ in a texture name in his "Lost Episode" mod.

Sigh...
Why do some people have to do this shit despite being warned?
If the current lump management ever gets replaced with a real virtual file system this (and more so Enjay's test case) will break horribly. Lump editors are best advised to disallow any special characters in lump names - with the sole exception of backslashes in sprite frames.
Post Reply

Return to “Tutorials”