Shader Problem - Texture Blending


(Orange) #1

I didn’t have a problem for some time now but that’s only because I didn’t have time to work on my map lately…
I’ve lost my shader some time ago when reinstalled gtkRadiant but I collected pieces from my posts here and also re-exported the shader from EasyGen and also added some new textures.
Now, for some weird reason, blending isn’t working so well.
This is how the texture blending looks like:

(The overAll red is on purpose, but the over-red in the blended section is a problem)

My shader:
http://www.vibrahost.com/itzikcom/crash.shader
(This time I uploaded it, just in case, you know…)

Now I need you to tell me what I did wrong…

Edit: Alpha blending problem solved.
I have other problem now but I have to go now so I’ll edit this again when I’ll come back.


(Orange) #2

Update: I’ve just figured out the alpha blending problem… I wrote blendFun without the “c”.
Now there’s only the normal blending issue.

Update 2:
Now more weird things are happening:
All player models have stupid green hats instead of helmets and I have the British flag instead of the American flag (in the limbo).

Please… I don’t remember messing up with anything or editing any files except my map files but those problems happen not just in my map.

BTW:
Blending is still a problem…


(Orange) #3

Don’t you know, pump it up,
You got to pump it up,
Don’t you know pump it up,
You’ve got to pump it up

It’s not so long ago,
That the sound hit the nation.
Every Saturdaynight,
On your favourite radio.

The party’s jumpin’
And the vibe feels so strong.
Throw your hands in the air,
Lif your head up high,
You know you got to sing along.

It’s not so long ago,
That the sound hit the nation.
Every Saturdaynight,
On your favourite radio.

The party’s jumpin’
And the vibe feels so strong.
Throw your hands in the air,
Lif your head up high,
You know you got to sing along.

Sorry but I need your help…


(The Wanderer) #4

First of all use a clean install for your mapping. Those “weird” things that are happening are undoubtedly due to some mod or map that you’ve installed.
Now to your blending problems:
Is that middle stripe( the orange portion) one triangle thick? (post that screenie with r_showtris 1). If so you can’t blend 3 textures on 1 triangle…maximum is 2.
Nevertheless I would still suggest making the following changes to your shaders

  1. Your non-blending terrain shaders have an implicitMap stage followed by a lightmap stage and another mapping stage. The implicitMap command includes the lightmap stage so you don’t need to put it again. Just remove it. (unless ofcourse you’re going for some weird effect)
  2. I’d suggest using a base shader for the common commands on your terrain shaders. It’s not necessary but it just makes everything more compact and easier to understand.
    3)I don’t quite understand why you’re mapping the sky again as the last stage. If you’re doing it so that the sky reflects of the ground, I suspect it will look quite weird on anything but water. If you just want the terrain to have a redish hue like the sky just give the skylight a redish value and that will work much better(and you won’t need the extra stage).
    I suspect however that you’re using it to have the clouds cast shadows on your terrain. Personally I find this unnecessary, but it’s your map and the only thing I’d suggest is if you’re gonna have the sky move( and you should because it looks better) don’t forget to put the same scrolling parameters on the clouds shadowing stages as well so that everything moves together in sync.

(Orange) #5
  1. I just thought no one played ET besides me and so no mod or new pk3s are installed, but then I saw that I have pk3s that shouldn’t be there and then removed them.

  2. Yep, that’s one triangle thick… here’s the screenshot:

  3. I had enough wierd effects… I just didn’t know implicitMap has the lightmap stage in it…

  4. I will

  5. At the beginning I wanted to have daylight map and then add clouds (and they both were moving) but then I’ve decided that I want early morning sky and the clouds layer just stayed there…
    (The lighting now is just for the development stage because I’m afraid that if I’ll make things darker now I’ll miss some parts…

And here’s another question:
Assuming I have a box rotated 45 degrees on the Z axis, what’s the simplest why to make my texture align correctly on it for each side?
Currently, this is what I have:

In gtkRadiant it looks fine, but ET mess it all up.
If I’ll remove the tcGen command, would it order ET to show the textures as I have them in gtkRadiant?


(The Wanderer) #6

remove the tcgen commands on the non-terrain shaders. They’re necessary for terrain shaders so that you don’t have seams on the terrain but they don’t give you any control over the mapping coordinates so you shouldn’t use them for buildings etc. Once you remove them use the surface inspector in radiant to adjust the texture mapping, and they will show up the same in game as in radiant.
Now just to make sure I understand what’s going on… There are 3 textures you’re trying to blend on those screenies correct?(the green the orange and the brown)
If so, than there’s absolutely no way you can do it over one triangle. Like I said before maximum is 2 textures over 3 vertices. If you’re using easygen for the terrain than you can see triangels that are textured badly by switching to the texture view (in the view menu). They show up as black triangles.


(Orange) #7

Thanks for the info about the tcGen command.
And I already solved the problem as you told me I can’t add so many blend stages…

Thanks again, The Wanderer, that’s the second time you save me from mental illness… lol
If something good would come out of my map, you’re sure going to get a good place in my credits list.
And don’t worry, if my map would come out to be a total failure I’ll save you the shame and humiliation…