alphablending problem


(eiM) #1

Hello,

I read several tutorials about alphashaders and alpha blending and I got an idea of how it works.
Now I gave it a try and made a simple black room with an brush in it which had the shadertexture on it. Then I made another brush surrounding half of the first brush and gave it the alpha 00% texture so it should fade from the secondary into the primary texture.
But somehow it does not work out it always only shows the secondary texture at 100% and does not blend anything. I attatch a screenshot of the radiant to make clear what I did and here are the shader I am using (yes i added eimer to the shaderlist.txt):

eimer.shader

textures/eimer/rocktograss
{
qer_editorimage textures/eimer/rocktograss
surfaceparm landmine
surfaceparm grasssteps

q3map_nonplanar
q3map_shadeangle 120
q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
q3map_bounceScale 0.2
{
map textures/egypt_floor_sd/sandygrass_b.tga
rgbGen identity
}
{
map textures/temperate_sd/rock_grayvar.tga // Secondary
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
rgbGen identity
alphaGen vertex
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}
}

// ======================================================================
// alpha fade shaders
// © 2004 randy reddig
// http://www.shaderlab.com
// distribution, in part or in whole, in any medium, permitted
// ======================================================================
//
// These shaders are not fixed to this directory location, they can
// be moved around. They exist here for convenience only.
//
textures/eimer/alpha_000 // Primary texture ONLY
{
q3map_alphaMod volume
q3map_alphaMod set 0
surfaceparm nodraw
surfaceparm nonsolid
surfaceparm trans
qer_trans 0.75
}

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

textures/eimer/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/eimer/alpha_075
{
q3map_alphaMod volume
q3map_alphaMod set 0.75
surfaceparm nodraw
surfaceparm nonsolid
surfaceparm trans
qer_trans 0.75
}

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

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

I compiled the map with BSP -meta and run it ingame with g_gametype 2 , sv_pure 0 and devmap alphatest (mymaps name).

So I am really confused, I think it is all correct and I have no idea what to do =) I searched the forums but it just gave me other tutorials which told me to do the same or similar things.

Edit:
I again searched some tutorials and in one the guy made the brushes and the alphabrush a func_group … is that important? I now tried it aswell but still no blending texture =/

Best regards,
eiM


(kamikazee) #2

I believe it might be necessary to group them into a func_group.

Also, post your Q3Map2 version (printed when doing a map compile). It could be that you are using an old version which doesn’t support alphablending.


(Diego) #3

I don’t group mine and it works fine. Try throwing an Alpha 000 on the other side and see if that helps. And Kamikazee is right about the q3map 2 version. I’ll have to check what version I am using when I get home. But you need a current version to get this to work. Other than that, I will try to compare your shader to mine. But if you got it from Sock’s tutorial, it should be the same.


(kamikazee) #4

[QUOTE=Diego;175838]I don’t group mine and it works fine.[/QUOTE]Ok, grouping them might have been for some advanced usage then, never really worked a lot with alpha2 blending.


(eiM) #5

well never thought about that…
I have 2.5.11 and never updated it or smth… so what version should I have and where do I get it from? :smiley:

edit
i know installed / copied a newer version 2.5.8 and 2.5.7 as test but now my gtkradiant 1.4 does not start anymore :frowning: so which is the correct version as there are like 30 on the webscpae linked in the q3map2 forum


(Magic) #6

I think 2.5.16 is the one you should go for.

Q3map2_v2.5.16

And here is a tutorial how to install it - you have to do some changes to several existing files

www.map-craft.com

Btw - i was struggling to get the blending to work - i had to make them func_group


(eiM) #7

thanks dude now it works =)