Projects that have specifically been abandoned or considered "dead" get moved here, so people will quit bumping them. If your project has wound up here and it should not be, contact a moderator to have it moved back to the land of the living.
GLDEFS Generator is a tool written in C# that reads the filenames in a specific folder and generates GLDEFS for each file from a template using keywords.
---DOWNLOADS--- GLDEFS Generator v1.1[Last update: 08/9/2018]
NOTE: Source code is in the zip under "src" folder.
Spoiler: Requirements
.NET Framework 4.6.1
Spoiler: Usage
Launch program and specify path to image folder manually. Copy-pasting path works. Navigate using arrow keys. The program uses a template file called "Template.txt" in the same folder as the executable. Here is an example:
//Shaders.
HardwareShader Texture "<texname>" // <texname> will be substituted when generating code. Quotes are no longer automatically placed starting v1.1.
{
shader "shaders/scroll2.txt"
speed 1
}
//Brightmaps.
Brightmap sprite "<texname>"
{
map "bm/bmspr/<fulltexname>"
disablefullbright
}
//Dynamic lights.
PointLight <texname>
{
Color <rgbcolor>
Size 64
}
//Glowing flats.
Glow
{
Texture "<texname>", <hexcolor>, 32
}
Available keywords:
- <texname>: The image's name without extension, e.g. SKELA0.
- <fulltexname>: Same as above, but with extension, e.g. SKELA0.png.
- <rgbcolor>: Determines the average image color and sets the RGB value to that. Results not perfect if lots of colors are involved.
- <hexcolor>: Same as above, but returns a hex.
Available options:
- Intensity Mult: Due to how finding the average color works, the resulting brightness may be lower than expected. Use this to fine-tune if the image batch has lots of dark colors. Range of [0.0, 10.0].
- Intensity Clamp: Caps the maximum value for each color. Range [0.0, 2.0]. Only works for RGB.
Spoiler: License
See license.txt in zip.
Last edited by Accensus on Sat Sep 22, 2018 12:27 pm, edited 5 times in total.
Thanks! Kodi did give me an idea for a TEXTURES generator, albeit a bit different in function. I'll see if something can be done about it. That one's a bit more complex due to all the offset, scaling, and other stuff.
Aw man! Where were you a couple or more years back when I really needed something like this? (At least my text editor's macro function took most of the pain out of it.)
This is a really good idea. I suspect I'll get good use out of it sooner or later. Thanks.
Enjay wrote:Aw man! Where were you a couple or more years back when I really needed something like this?
Likely having no idea what programming is, lol.
I'm currently working on v1.1. It will hopefully include dynamic lights generation by (possibly) taking the average pixel color in an image and working with that. Also planning on having glowing flats generation which would work the same way.
The current version is only really useful for shaders, as that was the original suggestion by kodi.
It was brightmaps I originally needed it for. Can it handle those? (Basically, it would need to put correct paths in for the brightmap image for each image to have a brightmap allocated to it and format them in a brightmap entry in gldefs.)
If you already have the brightmaps as files, then yes. You'd have to edit the template for that. As is, the tool only really replaces keywords in the template. Anything that's not a keyword stays the same.
Just read your ninja edit, I'm not too sure if it can do that, cause I remembered brightmaps require a bit different syntax for the map property iirc. Like, needing the extension. I'll take a look at those. Would be appreciated if you could mail me some test brightmaps to work with.
I can easily mail you some if you like, but GZDoom ships with a bunch in brightmaps.pk3
I don't know about anyone else, but the way I set up brightmaps is in a folder (and then possibly a sub folder). I give each brightmap the same name as the texture/sprite that it is a map for. So a typical entry for me would be something like:
Changelog:
- Expanded functionality to work with dynamic lights, glowing flats, and brightmaps.
- In the case of dynamic lights and glowing flats, pixel data is read and the average color is picked for glow color. Intensity is based on pixel brightness, but can be fine-tuned.
- Updated the Usage spoiler with useful info. Please read it.
Sorry for probably stupid question, but can allows this tool to attach dynamic light (PointLight) to a map texture or it works only for actor textures?
And if no, then a bit off-topic question: is a some way to assign a specific dynlight to the specific map texture, aside from manually attachment? Maybe it already discussed at somewhere?
I have a similar question like Void Weaver here. Can spotlight dynamically be attached to texutres for them to move, or disappear , like switches (from red to gree , i.e.).
I been using a similar add on, (as far as I can see cos I am not able to download this due to gdrive permission) but seems this behaves similar. Wondering if the dynamic fact is real.