Page 1 of 2

[Tutorial] Models with brightmaps in GZDoom

Posted: Thu Aug 09, 2012 11:09 am
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

Re: [Tutorial] Models with brightmaps in GZDoom

Posted: Thu Aug 09, 2012 12:19 pm
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.

Re: [Tutorial] Models with brightmaps in GZDoom

Posted: Thu Aug 09, 2012 12:33 pm
by Blue Shadow
Wouldn't it be better to have this on the wiki?

Re: [Tutorial] Models with brightmaps in GZDoom

Posted: Thu Aug 09, 2012 12:37 pm
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.

Re: [Tutorial] Models with brightmaps in GZDoom

Posted: Thu Aug 09, 2012 1:05 pm
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?

Re: [Tutorial] Models with brightmaps in GZDoom

Posted: Thu Aug 09, 2012 1:11 pm
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)?

Re: [Tutorial] Models with brightmaps in GZDoom

Posted: Thu Aug 09, 2012 1:22 pm
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.

Re: [Tutorial] Models with brightmaps in GZDoom

Posted: Thu Aug 09, 2012 3:44 pm
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.

Re: [Tutorial] Models with brightmaps in GZDoom

Posted: Thu Aug 09, 2012 4:09 pm
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?

Re: [Tutorial] Models with brightmaps in GZDoom

Posted: Mon Oct 29, 2012 2:19 pm
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?

Re: [Tutorial] Models with brightmaps in GZDoom

Posted: Mon Oct 29, 2012 2:59 pm
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.

Re: [Tutorial] Models with brightmaps in GZDoom

Posted: Mon Oct 29, 2012 3:06 pm
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.

Re: [Tutorial] Models with brightmaps in GZDoom

Posted: Mon Dec 24, 2012 8:48 am
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?

Re: [Tutorial] Models with brightmaps in GZDoom

Posted: Thu Jan 09, 2014 10:31 am
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.

Re: [Tutorial] Models with brightmaps in GZDoom

Posted: Sat Jan 11, 2014 1:45 pm
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.