Couple of Questions

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
Billybob06
Posts: 41
Joined: Sun Apr 02, 2006 6:57 pm

Couple of Questions

Post by Billybob06 »

Hey again. I got a few questions about gtk.. wondered if you could help me?

1. First off, how can I make water create a reflection?

2. How do I make water look like it is moving in a certain direction?

3. How can I create beams of light coming in from a window?

4. Where will the options for the fog be found?

I don't need full explanations of these, just a couple of pointers would be nice. Sorry for all the questions guys but I thought of them all at once and didnt want to bog out the forum with seperate threads.

Cheers.
Billybob06
Posts: 41
Joined: Sun Apr 02, 2006 6:57 pm

Post by Billybob06 »

Ooo, just thought of another thing.. Is it possible for me to used bump maps in my textures, and for that matter, other types of layers such as reflection and specular maps?
User avatar
Foo
Posts: 13840
Joined: Thu Aug 03, 2000 7:00 am
Location: New Zealand

Re: Couple of Questions

Post by Foo »

Billybob06 wrote:Hey again. I got a few questions about gtk.. wondered if you could help me?

1. First off, how can I make water create a reflection?
You can hack a basic reflection in by taking a screenshot of the reflected area, then mapping this onto the surface as a shader stage. You will need to learn how to use shaders effectively to do this.

Alternatively, if the surface is static you could turn it into a misc_portal_surface without a target... This turns it into a 'true' mirror. You would have to figure out how to do this AND add water effects on top, though.

Failing both of these, there are some fake mirroring techniques you can do using basic 'looks like an reflection' effects with shaders. Again, as with all of these you need a very solid understanding of shaders.
2. How do I make water look like it is moving in a certain direction?
A shader using the tcmod_scroll property. Beyond this info, it's up to you to figure out how to use it :D
3. How can I create beams of light coming in from a window?
Semi-transparent textures mapped all around the edge of the window, with a gradiant of colour which fades off. Again, this needs a properly written shader to set the transparency/non-solid properties of the texture, and a graded texture fading from white to black (or whatever light color-to-black you need)
4. Where will the options for the fog be found?
You can have global or localised fog. Global fog is created with a keyword placed on the worldspawn entity. You'd have to consult the latest q3map2 shader manual for information on this. Localised fog is just a brush covered with a fog texture (\sfx\ i think) which can only be entered by the player from one side.
I don't need full explanations of these, just a couple of pointers would be nice. Sorry for all the questions guys but I thought of them all at once and didnt want to bog out the forum with seperate threads.
No worries. My first instinct was to say 'read the manuals' but then a lot of the info regarding this is spread so far and so thin you'd have to take a masters in google to get anywhere.
"Maybe you have some bird ideas. Maybe that’s the best you can do."
― Terry A. Davis
User avatar
Foo
Posts: 13840
Joined: Thu Aug 03, 2000 7:00 am
Location: New Zealand

Post by Foo »

Billybob06 wrote:Ooo, just thought of another thing.. Is it possible for me to used bump maps in my textures, and for that matter, other types of layers such as reflection and specular maps?
Not really. You can do a kind of pseudo bump-mapping which alters light effects with q3map2... you'll have to read the latest shader manual for this, again.

Specular I've seen mentioned but never gone into detail.. I doubt it's possible. Reflection...... kind of, see my first reply. Q3 has this 'portal' trick it uses to project an area of the game world onto a surface, but it's very immature and can only really be used for straightforwards 'mirror' or 'teleporter destination' type effects. Feel free to surprise me tho :D
"Maybe you have some bird ideas. Maybe that’s the best you can do."
― Terry A. Davis
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Post by obsidian »

Specular really only works on models that have a relatively fine tesselation (player models, for example), since it works on a vertex basis as opposed to a pixel basis as in D3-engine based games.

I've made a mirror water shader a long time ago. Worked okay, except that you couldn't have any deformVertexes for waves. You needed to create some subdivisions for the alpha blending and other "issues". Possible, but you do have to be pretty familiar with the inner working of shaders. It was a complicated effect and was pretty heavy on performance, so really limited in usefulness.

Read Shader Manual 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]
Billybob06
Posts: 41
Joined: Sun Apr 02, 2006 6:57 pm

Post by Billybob06 »

Coolo guys, cheers for that info. What I basically need to do then is to learn how to fully use shaders. Ok I can handle that, but could you make it a little easier, and let me know of any good tutorial sites? I'll have a look through other posts aswell, but fell free to add as many as you can think of. Thanks again.
User avatar
Hipshot
Posts: 1547
Joined: Sun Jan 20, 2002 8:00 am

Post by Hipshot »

You can look at this demonstration map I made for a style I was working on back then
http://www.zfight.com/misc/files/q3/pai ... r_demo.rar
You can open the PK3 with winzip/rar and look at the shaderfiles youself, copy paste, do whatever you feel like...
Q3Map2 2516 -> http://www.zfight.com/misc/files/q3/q3map_2.5.16_win32_x86.zip
Q3Map2 FS_20g -> http://www.zfight.com/misc/files/q3/q3map2_fs_20g.rar
GtkRadiant 140 -> http://www.zfight.com/misc/files/q3/GtkRadiantSetup-1.4.0-Q3RTCWET.exe
User avatar
Foo
Posts: 13840
Joined: Thu Aug 03, 2000 7:00 am
Location: New Zealand

Post by Foo »

Billybob06 wrote:Coolo guys, cheers for that info. What I basically need to do then is to learn how to fully use shaders. Ok I can handle that, but could you make it a little easier, and let me know of any good tutorial sites? I'll have a look through other posts aswell, but fell free to add as many as you can think of. Thanks again.
http://www.quake3world.com/forum/viewtopic.php?t=290
"Maybe you have some bird ideas. Maybe that’s the best you can do."
― Terry A. Davis
Billybob06
Posts: 41
Joined: Sun Apr 02, 2006 6:57 pm

Post by Billybob06 »

Ok. heres the thing. I read the shader manual on fog and it only tells u about the localised fog i think. Does anyone know how to do a global fog for a level?
4days
Posts: 5465
Joined: Tue Apr 16, 2002 7:00 am

Post by 4days »

have a search for "fog hull" and "far-plane culling".

think i saw a ydnar tutorial/example about it here, along with a big thread that concluded something about having a fog 'chimney' - a bit of the level that had to poke out of or into the fog for the effect to work.

it was a vis-blocking method as well as a visual effect, geometry would stop being rendered just outside of the distance you could see through the fog.

i'm not remembering any of that very accurately at all, but it might give you something to google on.

edit, google says:

Foghull
Most recent Quake III engine games are programmed with a feature known as distance clipping used to clip (cull) map geometry beyond a user set distance. At the time of Quake III Arena's release, distance clipping was not an available feature. The Q3Map2 foghull feature was designed to simulate true distance clipping for Quake III Arena and Team Arena games.


What is a Foghull?
Farplane distance clipping is a feature used to cull (remove) the drawing of polygons beyond a certain distance from the player in an attempt to improve performance. It is typically used on large, open terrain maps with little vis-blocking structures. Through the use of distance clipping a maximum vis distance is set, which provides the culling of rendered polygons. Fog is used to hide the effect of polygons appearing and disappearing by obscuring the maximum distance that the player can see.

Since distance clipping is not a feature natively built into Quake III Arena, using distance culling would result in a hall of mirrors (HOM) effect where the culled geometry begins, since nothing is being drawn in the frame buffer. To compensate for this, the foghull feature uses a series of six skybox images that are drawn in place of the absent culled geometry, thus preventing the HOM effect.


Skybox Images
The skybox images used with the foghull feature should never be actually seen since the idea is to use the fog to obsure the maximum distance that the player can see. It only exists to prevent the HOM effect. To pull this off in a convincing manner, the skybox images should be six identical 8x8 pixel (to save on texture memory) textures each filled with a flat color matching the exact color of the fog. The six skybox images must be named in accordance to the skyParms farbox convention, using the _ft, _rt, _bk, _lf, _up, _dn suffixes.


Foghull Shaders
Two shaders are required when using the foghull feature, a fog volume shader and a skybox shader, both of which are simple, standard shaders.

The color of the fog used must match the color used in the skybox images. Any decent image editing software will give you the three RGB color values of your skybox images, which must be normalized by dividing by 255. As with any other fog shader, the fogParms and surfaceparm fog keywords must be present.

Fog Volume Shader

Code: Select all

textures/env/fog1024
{
fogParms ( 0.8 0.8 0.8 ) 1024 //Normalized RGB, distance to opaque

surfaceparm fog //Must be used
surfaceparm nolightmap
surfaceparm nonsolid
surfaceparm trans

qer_editorImage textures/sfx/fog_grey.tga
qer_trans 0.4
}
The skyParms and surfaceparm sky keywords must be used to create the skybox "hull" of the map. The skyParms farbox value must point to the base name of the skybox images (sans suffix). Optional surface emitted sun lighting can be added using q3map_skylight with q3map_sun or q3map_sunExt (see Appendix I: Light Emitting Shaders).

Skybox Shader

Code: Select all

textures/skies/foghullsky
{
skyParms textures/skies/foghullsky 0 - //farbox cloudheight nearbox

surfaceparm nolightmap
surfaceparm nonsolid
surfaceparm sky //Must be used
surfaceparm trans
}
Entity Key Value Pairs
To activate the foghull feature, the _foghull and _farplanedist worldspawn entity key/value pairs must be set in the Entity Inspector (in Radiant, select any non-entity brush and press "N").

The _foghull key's value works similar to that of terrain entities. It must point to the name of the skybox shader, minus the standard "textures/" prefix. For the skybox shader example above with the shader name "textures/skies/foghullsky", you would use a _foghull value of "skies/foghullsky".

The _farplanedist value is simply the distance at which polygons will begin to get culled. One important note is that the _farplanedist value must be greater than the distance to opaque value set in the fog shader. In the above fog shader, the distance to opaque value was set to 1024 game units. The _farplanedist value must therefore be greater than 1024, otherwise the HOM effect will appear.
Billybob06
Posts: 41
Joined: Sun Apr 02, 2006 6:57 pm

Post by Billybob06 »

Bloody hell, thats a lot of info man.. cheers

I'm just off to work now, but I'll let you know how it goes when I get in.
Post Reply