I've got a water shader here that uses original id textures (shader by id modified by pjw modified by me).
The water looks good but I'd like to get it more opaque / less transparent. Can this by achieved by modifying the shaderscript (if so: how) or would this task involve messing with the texture?
You could easily make it fully opaque by removing the blendfunc in the first stage, but that's not what you're after.
It would probably be best to start messing about with copies of the textures. Currently it's using filter and additive blends, which only modify existing colours behind the shader rather than replacing them like an alpha blend would.
Best candidate would be adding an alpha channel to the texture for the first stage and making the whole shader more solid that way. You could hack it by just using an alphagen const directive, but it will look better with a proper variable alpha. Change the blendfunc for that stage to blendfunc blend. Start with a pretty dark channel and make it lighter until it looks like what you want.
Another thing you could try is putting a dark green fog brush into the water.
Hmmm, tough one. Adding more stages will give the effect of making it what your after but it will reduce FPS (Increase fill rate). Changing alpha will also do what your after, but it will unfortunatly mean you cant re-dist the texture.
The best bet is as Shallow said, fog. Add a light fog and make it thicker as you please, it will work pretty much just as you intended anyway. Water is slightly murky anyway, so it will probably look better. The only problem is that you might want to work with the fog colour a little closer, as making it green or to green will look less like water and more like acid.
o'dium wrote:Changing alpha will also do what your after, but it will unfortunatly mean you cant re-dist the texture.
No, as long as it is under a different folder/name so it won't overwrite the base asset, it's perfectly fine. Unless id have had a change in policy, it always used to be OK to distribute modified texture assets as long as it's for the same game, and it's part of a map or mod.
That's a sorta special exemption thing from ages ago, not a general copyright law thing by the way... Copyright does indeed say that you shouldn't redistribute modified content, but the community was told that it was OK to tweak textures etc. as long as they weren't blatantly giving them to people who didn't have the game.
Otherwise, try alphaGen const N.N (sets constant vertex alpha value) with rgbGen vertex (specifies use of vertex values) in the texture stages, where N.N is a normalized value.
BTW, comment out/remove q3map_lightSubdivide and surfaceparm noimpact (swimmable water shouldn't have this). And surfaceparm trans should be enabled for all transparent shaders. I don't think you really want the lightmap on the last stage.
Shallow wrote:No, as long as it is under a different folder/name so it won't overwrite the base asset, it's perfectly fine. Unless id have had a change in policy, it always used to be OK to distribute modified texture assets as long as it's for the same game, and it's part of a map or mod.
Thats' good news.
I've been wondering why so many people distribute so many modified official textures so far. :icon27:
@dichtfux
I would remvoe "rgbGen identiy" from the stage where "blendFunc add" is specified, defaulting to "rgbGen identityLighting".
AFAIK, the combination of these makes the texture oversaturated, resulting in expansion of the flatness. (One example would be an officail red armor. It is spoiling subtle detail due to this combination.)
And this is just my biased taste. (It ain't the way it has to be.)
You should probably add surfaceparm nolightmap to that, since you aren't using a lightmap stage. It will prevent unused lightmap data from being generated and stored in the BSP. Probably a trivial amount of data, but, y'know.