Alpha Shaders

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Stealthzone
Posts: 31
Joined: Thu Dec 07, 2006 12:37 am

Alpha Shaders

Post by Stealthzone »

Hi all,

Stealth here from the TC:E community. I'm having a problem with alpha shaders.

Here is the layout by the way.
Image

My problem is that when you look into the water you can see the skybox base. Is it possible to darken the color of the water so you can't see it? Or even make it foggy, dirty? Or even edit one of the TGA files with photoshop? Just inside the mark I made.

Image

And when you look off into the horizon, you can see the outline of the skybox/water as well.

Image

I've tried messing with alpha shaders but cant seem to get them to work. Or even know where to place them. If anyone here can please send me an example map of how water fades off into the skybox, and to where you can't see the bottom of the skybox in the water, that would be much appreciated.
o'dium
Posts: 11712
Joined: Sun Mar 25, 2001 8:00 am

Re: Alpha Shaders

Post by o'dium »

What game is that?

Anyway, if your making a boat level, make a LARGE circle water surface rather than a small square/rectangle, that way it looks and fades out better. Don't worry about performance, it wont be much different, if any.

Then, add a fog light under the water to simulate depth in there, and maybe even a slight one above the water to simulate atmosphere.

That should create a fake horizon which will look good enough for what you want.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Alpha Shaders

Post by obsidian »

Assuming it's Q3-engine based and supports Q3Map2, use alphaMod volume brushes to fade the water and ground into the skybox. This assumes you are using a skybox, skyportal or hemisphere type sky, not the generic Q3 cloud skies with the massive HoM effect at the bottom (which looks better anyway).
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Stealthzone
Posts: 31
Joined: Thu Dec 07, 2006 12:37 am

Re: Alpha Shaders

Post by Stealthzone »

Wow, thanks for the responses. I will try both suggestions and let you know.
About the alpha brushes. Where do I place them?

And Fog lights?

Sorry, I'm very new to this still.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Alpha Shaders

Post by obsidian »

There are no foglights in Q3.

Read this:
http://www.quake3world.com/forum/viewto ... 10&t=37504

And shader manual linked in my signature.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Stealthzone
Posts: 31
Joined: Thu Dec 07, 2006 12:37 am

Re: Alpha Shaders

Post by Stealthzone »

Its actually, WET, is that the same?

I'm more concerned with the alpha shaders. Some reason its not working. Is there a special switch during the compile that I need?
Stealthzone
Posts: 31
Joined: Thu Dec 07, 2006 12:37 am

Re: Alpha Shaders

Post by Stealthzone »

So according to the manual, the engine cant do what I want to do. What engine can? I'm going to find out.
Kaz
Posts: 1077
Joined: Wed Mar 08, 2006 3:43 am

Re: Alpha Shaders

Post by Kaz »

Enemy Territory is quake 3 based and can do alphamod shaders. You don't need special switches, you just have to set up everything properly.

http://www.quake3world.com/forum/viewto ... 10&t=37504

edit: didn't see that obsidian posted the same link, oops...
Last edited by Kaz on Thu Sep 25, 2008 12:49 am, edited 1 time in total.
Stealthzone
Posts: 31
Joined: Thu Dec 07, 2006 12:37 am

Re: Alpha Shaders

Post by Stealthzone »

My apologies and ignorance, but I don't see how that topic can help what I'm doing. And if it does, please don't assume that I have any knowledge on this. I'm just trying to learn. If someone can make an example map of how this is done, I would gladly pay them. Thanks.

Edit: Dont forget were dealing with two different shaders, one being a skybox, and one being water. Not land or ground. I do hope someone can help. :)
Stealthzone
Posts: 31
Joined: Thu Dec 07, 2006 12:37 am

Re: Alpha Shaders

Post by Stealthzone »

Well, I figured it out. I eventually do he he.

Image
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Alpha Shaders

Post by obsidian »

Since this works based on vertex alpha, you may want to chop up the water geometry a bit, say radiating from the centre or something. You'll probably get better results on the blend.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Alpha Shaders

Post by obsidian »

Since this works based on vertex alpha, you may want to chop up the water geometry a bit, say radiating from the centre or something. You'll probably get better results on the blend.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Stealthzone
Posts: 31
Joined: Thu Dec 07, 2006 12:37 am

Re: Alpha Shaders

Post by Stealthzone »

In dumba$$ language please?
Stealthzone
Posts: 31
Joined: Thu Dec 07, 2006 12:37 am

Re: Alpha Shaders

Post by Stealthzone »

Is this what you meant?

Image
Stealthzone
Posts: 31
Joined: Thu Dec 07, 2006 12:37 am

Re: Alpha Shaders

Post by Stealthzone »

Ya done with me obsidian? Oh mighty one...... :p
$NulL
Posts: 100
Joined: Wed Mar 27, 2002 8:00 am

Re: Alpha Shaders

Post by $NulL »

This is how I would do it:

Image
Stealthzone
Posts: 31
Joined: Thu Dec 07, 2006 12:37 am

Re: Alpha Shaders

Post by Stealthzone »

Did you actually compile that? Any screens? Part of the problem is the sky shader.

Check this tutorial out.

http://szicovii.com/modules/smartsectio ... ?itemid=20
$NulL
Posts: 100
Joined: Wed Mar 27, 2002 8:00 am

Re: Alpha Shaders

Post by $NulL »

No I didnt compile that particular one, but the shader / medod is taken from the map ut4_mandolin which i made for urbanterror. The water and sky fade into a common colour.

[See here]

That article looks quite interesting, i just quickly scanned through it. but I guess there are a couple of things I would have done differently to him:

1. I dont see any reason to include alpha mods for 75%, 50% and 25%; as only using 100% and 0% will provide a smooth gradient transition in which all alpha values will be present.

2: The fade brushes could be made into a _skybox entity so as to not increase the size of the map. (and yes _skyboxes can be made to line up perfectly with world geometry, have a look at ut4_subterra for urban terror if you dont believe me.)
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: Alpha Shaders

Post by obsidian »

Was on vacation for a month. Posting here was a luxury whenever I could snag a free wifi signal. Then my laptop crapped out on me and I'll have to send it in for warranty repair.

The square bits are alpha mod 0% brushes. No need for all those extra rings like in the tutorial.

Image
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Stealthzone
Posts: 31
Joined: Thu Dec 07, 2006 12:37 am

Re: Alpha Shaders

Post by Stealthzone »

Thank you very much guys. I'm working on bumpmapping now and its not cooperating with me. LOL.

My findings and comments on this. After tweaking and several series of tests. I'm afraid I'm not happy with the results. I found that you must have little or no light. There must be a parameter I can add to my script which is below. Meanwhile, check out what I have so far. Which is not much.....

Here you see the first test
Image
Then the second. Which I liked the most.
Image
Here is the textured result
Image
Here is the non-bumped angle
Image
Here is the bumped angle
Image
Here is the non-bumped side
Image
here is the bumbed side
Image

I guess I'm going to have to play with it a little more. But it is interesting if used with correct lighting and texture.

Here is my shader file.

Code: Select all

textures/re_metal/metal_13833
{	
	qer_editorimage textures/re_metal/metal_1383.tga
	q3map_normalimage textures/re_metal/metal_1383_bump.tga
	q3map_lightmapsamplesize 0.1
	{
		map $lightmap
		rgbgen identity
	}
	{
		map textures/re_metal/metal_1383.tga
		rgbgen identity
		blendFunc GL_DST_COLOR GL_ZERO
}

Last edited by Stealthzone on Tue Oct 07, 2008 1:48 pm, edited 1 time in total.
o'dium
Posts: 11712
Joined: Sun Mar 25, 2001 8:00 am

Re: Alpha Shaders

Post by o'dium »

Are you running in 16bit mode...? That will really make bump maps look worse mate, try running in 32bit.
Stealthzone
Posts: 31
Joined: Thu Dec 07, 2006 12:37 am

Re: Alpha Shaders

Post by Stealthzone »

Running 32bit. I think it has to do with the creation of the bump in PS, and some parameter in the shader to obtain the right results for the lighting I have. Its a night map.
Dark Metal
Posts: 5496
Joined: Sun Feb 20, 2000 8:00 am

Re: Alpha Shaders

Post by Dark Metal »

You know, when this thread loads it looks like you're mapping a phallic symbol...
[WYD]
Stealthzone
Posts: 31
Joined: Thu Dec 07, 2006 12:37 am

Re: Alpha Shaders

Post by Stealthzone »

ROFLMAO..... good one! :)
o'dium
Posts: 11712
Joined: Sun Mar 25, 2001 8:00 am

Re: Alpha Shaders

Post by o'dium »

Stealthzone wrote:Running 32bit. I think it has to do with the creation of the bump in PS, and some parameter in the shader to obtain the right results for the lighting I have. Its a night map.
32bit...? You sure?

I only ask because those are jpegs, yet they show a hell of a lot of banding...?
Post Reply