Basic Half-Life Map Support For Stock GLQuake
@mexicouger - yeah, its another texture thats been altered from the original. i wish decal textures worked though, you can do some cool stuff with them some times.
@baker, if you want to set up alpha textures for hlbsp how they do it is the take the color out of the pallete which is #255 and if the texture is set to func_illusionary and a certain value which i dont remeber is off hand is set to 255 then it's transparent if you can do that. then that would be awesome.
@baker, if you want to set up alpha textures for hlbsp how they do it is the take the color out of the pallete which is #255 and if the texture is set to func_illusionary and a certain value which i dont remeber is off hand is set to 255 then it's transparent if you can do that. then that would be awesome.
You threw me off with the TGA alpha channel thing in your other thread.ceriux wrote:@baker, if you want to set up alpha textures for hlbsp how they do it is the take the color out of the pallete which is #255 and if the texture is set to func_illusionary and a certain value which i dont remeber is off hand is set to 255 then it's transparent if you can do that. then that would be awesome.
This palette 255 = transparent feature may be something you get tonight, btw.
The night is young. How else can I annoy the world before sunsrise? Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Upload your map, I think I have this done. Except I have no test case map.
Nevertheless, I need to do some finishing touches.
Of course, that can be changed
Nevertheless, I need to do some finishing touches.
Ahem. FitzQuake doesn't load external textures of q1 mdl as far I know, just bsps.ceriux wrote:really? wow that would be awesome =) then i wont have to bother with tga's. at least not till i get to some models.
Of course, that can be changed
The night is young. How else can I annoy the world before sunsrise? Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-
- Posts: 268
- Joined: Tue Nov 24, 2009 2:20 am
- Contact:
The dark pink one. In Wally it's the last colour (lowest right).ceriux wrote:my map isnt setup to have hl's texture to be transparent, but i can update it to do that. just have to figure out how to find which color is the 255 color.
Get off my lawn!Ken Thompson wrote:One of my most productive days was throwing away 1000 lines of code.
Okey i have a way to add Alpha channel:
Go to "Mod_LoadTextures" and before add:
qboolean hl_map;
then go to the line: "if (loadmodel->bspversion == HL_BSPVERSION) { ..." and add here after "byte *data;":
tx->transparent = false;
hl_map = true;
in "if ((data = WAD3_LoadTexture(mt))) {"
you add first:
if (tx->name[0] == '{')
tx->transparent = true;
change now the "GL_LoadTexture32" to:
tx->gl_texturenum = GL_LoadTexture32 (mt->name, tx->width, tx->height, (byte *)data, true, tx->transparent);
okey now we are done in here no open the "gl_rsurf.c" and
go to "R_DrawBrushModel"
before "void" add:
extern qboolean hl_map;
no go to in the void and add after "glColor3f (1,1,1);":
if (hl_map) {
glColor4f (1, 1, 1, 1);
glEnable(GL_ALPHA_TEST);
}
In "gl_model.h" find: "typedef struct texture_s"
add at end of the struct:
int transparent;
Go to "Mod_LoadTextures" and before add:
qboolean hl_map;
then go to the line: "if (loadmodel->bspversion == HL_BSPVERSION) { ..." and add here after "byte *data;":
tx->transparent = false;
hl_map = true;
in "if ((data = WAD3_LoadTexture(mt))) {"
you add first:
if (tx->name[0] == '{')
tx->transparent = true;
change now the "GL_LoadTexture32" to:
tx->gl_texturenum = GL_LoadTexture32 (mt->name, tx->width, tx->height, (byte *)data, true, tx->transparent);
okey now we are done in here no open the "gl_rsurf.c" and
go to "R_DrawBrushModel"
before "void" add:
extern qboolean hl_map;
no go to in the void and add after "glColor3f (1,1,1);":
if (hl_map) {
glColor4f (1, 1, 1, 1);
glEnable(GL_ALPHA_TEST);
}
In "gl_model.h" find: "typedef struct texture_s"
add at end of the struct:
int transparent;
I thing it will work a and i edit the WAD3 Convertion its from Tomaz Quake:
On my Engine looks like this:
Code: Select all
static byte *ConvertWad3ToRGBA(miptex_t *tex) {
byte *in, *data, *out, *pal;
int d, p;
in = (byte *)((int) tex + tex->offsets[0]);
data = out = malloc(tex->width * tex->height * 4);
if (!data)
return NULL;
pal = in + (((tex->width * tex->height) * 85) >> 6);
pal += 2;
for (d = 0;d < tex->width * tex->height;d++) {
p = *in++;
if (tex->name[0] == '{' && p == 255)
out[0] = out[1] = out[2] = out[3] = 0;
else {
p *= 3;
out[0] = pal[p];
out[1] = pal[p+1];
out[2] = pal[p+2];
out[3] = 255;
}
out += 4;
}
return data;
}