[Tutorial] Models with brightmaps in GZDoom

[Tutorial] Models with brightmaps in GZDoom

Postby MaxED » Thu Aug 09, 2012 11:09 am

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 allExpand view
\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 allExpand view
brightmap texture cellpack {
  map "models/a_cellpack/cellpack_bm.png"
}

3. Done!

Example wad
User avatar
MaxED
 
Joined: 28 Feb 2012

Re: [Tutorial] Models with brightmaps in GZDoom

Postby Enjay » Thu Aug 09, 2012 12:19 pm

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.
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: [Tutorial] Models with brightmaps in GZDoom

Postby Blue Shadow » Thu Aug 09, 2012 12:33 pm

Wouldn't it be better to have this on the wiki?
User avatar
Blue Shadow
 
Joined: 14 Nov 2010

Re: [Tutorial] Models with brightmaps in GZDoom

Postby Enjay » Thu Aug 09, 2012 12:37 pm

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
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
Joined: 15 Jul 2003
Location: Scotland

Re: [Tutorial] Models with brightmaps in GZDoom

Postby Springy » Thu Aug 09, 2012 1:05 pm

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
Springy
Yes indeed ladies and gentlemen.
 
Joined: 08 Mar 2012
Location: Earth

Re: [Tutorial] Models with brightmaps in GZDoom

Postby MaxED » Thu Aug 09, 2012 1:11 pm

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
MaxED
 
Joined: 28 Feb 2012

Re: [Tutorial] Models with brightmaps in GZDoom

Postby Springy » Thu Aug 09, 2012 1:22 pm

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
Springy
Yes indeed ladies and gentlemen.
 
Joined: 08 Mar 2012
Location: Earth

Re: [Tutorial] Models with brightmaps in GZDoom

Postby Enjay » Thu Aug 09, 2012 3:44 pm

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
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
Joined: 15 Jul 2003
Location: Scotland

Re: [Tutorial] Models with brightmaps in GZDoom

Postby Nash » Thu Aug 09, 2012 4:09 pm

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
Nash
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia

Re: [Tutorial] Models with brightmaps in GZDoom

Postby Enjay » Mon Oct 29, 2012 2:19 pm

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 allExpand view
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?
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: [Tutorial] Models with brightmaps in GZDoom

Postby Gez » Mon Oct 29, 2012 2:59 pm

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.
Gez
 
Joined: 06 Jul 2007

Re: [Tutorial] Models with brightmaps in GZDoom

Postby Enjay » Mon Oct 29, 2012 3:06 pm

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.
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: [Tutorial] Models with brightmaps in GZDoom

Postby DoomQuaker » Mon Dec 24, 2012 8:48 am

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?
DoomQuaker
 
Joined: 24 Dec 2012

Re: [Tutorial] Models with brightmaps in GZDoom

Postby skornedemon » Thu Jan 09, 2014 10:31 am

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

I just tried this myself with no luck.

Code: Select allExpand view
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.
skornedemon
Doom modder since 2000.
 
Joined: 02 Aug 2010

Re: [Tutorial] Models with brightmaps in GZDoom

Postby Graf Zahl » Sat Jan 11, 2014 1:45 pm

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.
User avatar
Graf Zahl
 
Joined: 19 Jul 2003
Location: Germany

Next

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 0 guests