custom textures for blending


(MonoTritiant) #1

I’m having some trouble with custom textures and making them blend. I read the tutorial at simland to get started with shading, and it was pretty helpful but I still had some issues with shading. I’m using GTKRadiant for JKA. What i’m trying to do now is take some textures from the base JKA files and blend them. Do i need to add another channel to these textures… like an alpha channel? If so… how do I do that. I loaded the textuers into photoshop… copy and add an alpha channel with the same texture greyscaled and brightened up. When I go to save it, the alpha channel disappears though…

here is the coding i’m using for my shader.

textures/blending2/blend_grassTdirt
{
qer_editorimage textures/blending2/blend_grassTdirt.tga

q3map_nonplanar
q3map_shadeangle 120
q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
q3map_alphaMod dotproduct2 ( 0.0 0.0 0.75 )
{
	map textures/blending2/blend_grass1.tga  //Primary texture
	rgbGen identity
}
{
	map textures/blending2/blend_dirt1.tga //Secondary texture
	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
	alphaFunc GE128
	rgbGen identity
	alphaGen vertex
}
{
	map $lightmap
	blendFunc GL_DST_COLOR GL_ZERO
	rgbGen identity
}

}
textures/blending2/blend_grassTrock
{
qer_editorimage textures/blending2/blend_grassTrock.tga

q3map_nonplanar
q3map_shadeangle 120
q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
q3map_alphaMod dotproduct2 ( 0.0 0.0 0.75 )
{
	map textures/blending2/blend_grass1.tga  //Primary texture
	rgbGen identity
}
{
	map textures/blending2/blend_rock1.tga //Secondary texture
	blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
	alphaFunc GE128
	rgbGen identity
	alphaGen vertex
}
{
	map $lightmap
	blendFunc GL_DST_COLOR GL_ZERO
	rgbGen identity
}

}

textures/blending2/alpha_000 // Primary texture ONLY
{
q3map_alphaMod volume
q3map_alphaMod set 0
surfaceparm nodraw
surfaceparm nonsolid
surfaceparm trans
qer_trans 0.75
}

textures/blending2/alpha_025
{
q3map_alphaMod volume
q3map_alphaMod set 0.25
surfaceparm nodraw
surfaceparm nonsolid
surfaceparm trans
qer_trans 0.75
}

textures/blending2/alpha_050 // Perfect mix of both Primary + Secondary
{
q3map_alphaMod volume
q3map_alphaMod set 0.50
surfaceparm nodraw
surfaceparm nonsolid
surfaceparm trans
qer_trans 0.75
}

textures/blending2/alpha_075
{
q3map_alphaMod volume
q3map_alphaMod set 0.75
surfaceparm nodraw
surfaceparm nonsolid
surfaceparm trans
qer_trans 0.75
}

textures/blending2/alpha_085
{
q3map_alphaMod volume
q3map_alphaMod set 0.85
surfaceparm nodraw
surfaceparm nonsolid
surfaceparm trans
qer_trans 0.75
}

textures/blending2/alpha_100 // Secondary texture ONLY
{
q3map_alphaMod volume
q3map_alphaMod set 1.0
surfaceparm nodraw
surfaceparm nonsolid
surfaceparm trans
qer_trans 0.75
}

When I compile and go ingame the textures are not even showing up… just the massive black/white boxes.

Also… if anyone knows of an easy tutorial besides simland for shading, please point me to it. Thanks.


(pazur) #2

Looks like your texture isn`t found by the engine. Make sure you have your terrain shader in shaderlist.txt


(SCDS_reyalP) #3

FWIW, the engine doesn’t look at shaderlist.txt. Gtkradiant and q3map2 do, and sometimes if q3map2 can’t find it, it will result the game not showing what you expect.

I don’t have any input on the original problem, except that you shouldn’t modify stuff included in the game without renaming it.


(obsidian) #4

Also, make sure you are saving to TGA. JPG’s don’t support alpha-channels. Also make sure that all TGA’s with alpha-channels are saved in 32bit. TGA’s without alpha-channels should be saved in 24-bit.


(MonoTritiant) #5

thanks, i’ll try some of that stuff out wihen I get a chance… right now i’m going through SIMlands example maps thoroughly to see how he did it exactly… and basically copy it and slowly go over to my own textures/style. Thanks for the help.


(wudan) #6

Jedi Academy can use PNG, use PNG. It’s a better format than TGA and Photoshop’s handling of PNG’s alpha channel is intuitive (if you see the grey and white checkers when you save the image, that part is transparent.)


(The Wanderer) #7

If you’re using photoshop 7.0 there’s a bug with the tga plugin(which has been mentioned many times) that it doesn’t save the alpha channel.
You need to update the tga plugin form the adobe site(or whatever other site you can find it).


(Fracman) #8

Sorry for pushing up :smiley:
Did you get to any results now?