terrain blending tutorial


(ratty redemption) #61

lol, a slightly more disturbing thought is how many other people are going to read this topic over the months or even years, and come across our very off topic conversation in the middle of all the technical stuff… do you think us two should edit our posts before it gets even more distracting? …at least ydnar had the sense not to make this a sticky topic :wink:

and good idea about linking my two tutorial topics, plus I should also link, if I havent done already, to seven dcs newbie friendly (and not at all furry) version of my terrain blending tutorial… I`ll set up the links when I do the other updates.


(obsidian) #62

Err… I’ll just stay clear of both of you from now on…

Ratty, if you have web space, I just thought that it would be nice if you reformatted your tuts into a web page instead, sort of a “how to use alphaMod volume/Q3Map2 terrain blending” tutorial. Would be easier for future readers to follow instead of this forum thread… plus they won’t get any… umm… odd ideas about you. :stuck_out_tongue:


(Mr_Tickles) #63

Lol, sorry :smiley: I can guarantee you all I don’t even wear womens clothing, never have. I’ve gone commando in the past, but i’m a studen’t what do you expect? That i’d do my washing on time? :smiley:


(MadJack) #64

OMG! /me runs under Mr_Tickles window!

<CENSORED SOUNDS>


(ratty redemption) #65

@obsidian, since the beginning of me preparing my rough notes and taking pics for these tutorials, Ive been planning on a tidier website version, which hopefully gerbil is still going to host for me on his burrow site, when weve ironed out enough of the technical notes from the forum versions.

although my plan is still keep the tuts quite advanced, ie not a complete step by step, newbie friendly version, but hopefully someone else can publish some website versions of those, as dime started to do.

and off topic: believe me, it`s much worse irl :wink:

as I look like a biker and before that, a punk rocker and for about 13 years was infamous in my city for riding a black skateboard when ever I went out, although some people would occasionally ask me what kinda motorbike I owned, which I didn`t, lol

perhaps this wasn`t helped by one of my favorite band t shirts, which I still ware from time to time, with the wrongly spelt words “gaye bykers on acid” and “lets do damnation” printed in big white letters :eek3:

so, even to this day, where I now walk every where, people of both sexes still cross the road from me.

either because I guess they fear Im going to want to steal from them, beat them up or shag them, none of which usually enters my mind ....and I would only be interested in that latter if at all, and only then with the opposite sex, although Im personally not homophobic, just not that way inclined.

on top of the visual reaction I seem to provoke in people, they are usually even more confused when they first talk to me …if they stick around long enough, as I have a posh english accent, where by most people in my city have distinctive regional accents.

although in their defense, some of the stereotypes are reinforced when I explain that yes I do listen to a lot of rock music, although not all heavy, and about 18 years ago I left school to take up a career in hairdressing, where even in that environment, I looked quite way out …and obviously hung out with both a lot of straight and gay people.

most people are even more surprised when I explain I then switched from working in busy salons, chatting to people all day long, to “working” on my own from home, in front of a pc all day.

although both hobbies, careers are good expressions for arty types like myself, and for the more technical amongst you, although one is a more social and less introverted then the other imo.

Ive also noticed, despite games development being mainly male orientated, the egos, various skill levels and clash of personalities seem very similar to hairdressing imo ...although Ive yet to successfully use “I`m now a computer games geek” as a chat up line :banana:


(Mr_Tickles) #66

@MadJack, I’m getting a bit freaked out by this topic now… why are you running under my window and making “Censored” noises when you’ve just found out I sometimes go commando? Actually, no, I don’t want to know. :uhoh:

@Ratty, Please tell me you’re 7 foot, have four arms and go by the name Goro. :smiley: (Mortal Kombat ;))
Lol, I think the word chap gave it away about your posh english accent :smiley:

I’m just going to have a go at some more blending then will post the results if they work out…

Is there a way to get the texture scrolling but not the alpha channel?
Or… is there a way of getting the alpha channel to scroll but not the texture?


(ratty redemption) #67

@Mr Tickles, I think MadJack`s censored sounds were him puking rather moaning and groaning… although both types would be disturbing :wink:

and lol, Goro is cool but irl Im only 5'6" ...which is another reason I think its rather odd when some people seem intimidated by me, especially as I dont act in an aggressive manner...I actually dont even drink and have been a pacifist for years, and never been in trouble with the police… anyway, enough about me… back to the topic :wink:

Is there a way to get the texture scrolling but not the alpha channel?
Or… is there a way of getting the alpha channel to scroll but not the texture?

we can have multi stage shaders where we scroll some layers and not others, but if a stage contains an alpha channel then unfortunately that always seem to scroll with the image, although I wish there was a way to control them separately… if anyone knows of a way, please tell us :slight_smile:

one thing I`ve been doing recently with my water shaders is applying a slight tcmod turb to the lightmap stage, as well as subtlety fade it in and out with a rgbgen wave, and use blendfunc blend on it so it works with the alphamod volume blending… this is great for spot lights pointing at a water surface, as it ups the realism considerably imo :slight_smile:


(Mr_Tickles) #68

Coolio, thanks!

I’m playing with water at the moment, will try those things out. :smiley:

I had a look at the battery shader and it appears as if they’ve used an alphamap. I’ve tried to recreate this with mixed results. If I use easygen, then I get a trisoup which works alright, but rather than using all those brushes I’d rather just have one volume in place of them. However I haven’t seemed to get the alphamap projection on to it yet. I’m wondering if the alphamap is just mapped to the vertexes of the trisoup and that’s why only one texture appears on the single brush. Is this the way alphamaps generally work? If so, with some easygen’ed terrain i’ve got elsewhere, i’ve moved the vertexes around and clipped them here and there and added triangles to keep things sparklie-less, although no extra vetexes have been added. Was just wondering, if the alphamap is projected onto vertexes, would all this vertex editing distort the final outcome of the terrain?


(ratty redemption) #69

alphamaps, indexmaps are a nightmare to work with and I personally no longer recommend using them.

because if we use any trisouping that doesnt have its verts aligned in a neat grid pattern, then it`s very difficult to map the pixels of the alphamaps to the intended alpha verts on the trisouping… and if we alter the trisouping work on either the x or y axis then we need to update the alphamaps pixels, which in my experience involved a lot of trial n error.

otoh, with volume blending, we can achieve the same visual results as alphamaps, but place almost exactly where we want the alpha verts to be, and if we change their coordinates then we simply move the volume brushes to still enclose the alpha verts.

I hope I said that was clear enough? as I know some of these concepts sound very abstract until we see them both in editor and the game.


(ratty redemption) #70

also I don`t think we can combine alphamaps and volume blending as I imagine the volume blending would override the vertex alpha.


(Mr_Tickles) #71

I’ve been playing around with water aswell and have come across an interesting point.

When creating your alpha channel, stay away from the contrast control! Adjust the brightness, but don’t go for the contrast, it may brighten the image, but leaves sharp edges in the channel… not good if you’re trying to do a smooth blend. However, if you do something like grass, then the contrast isn’t so bad because the grass texture is more patterned or grainy.

It took me ages to find out what was going wrong, was fiddling with the shader for ages. Just thought I should let other people know about it.
It gives lovely results when done aswell. :slight_smile:

It’s better seen in game however, with a bit of scrolling and Ratty’s Alpha blending.
The foam flecks start out in the water small, and grow as they approach the bank, very nice :slight_smile:


(ratty redemption) #72

cool :slight_smile:


(G0-Gerbil) #73

Just thought I’d mention that this tutorial has enabled me to sort out my glittering effect that I wanted.
Kudos to Ydnar (please fix the shaders though in your download, plus I got errors using a couple of the new dlls packaged with q3map2, had to revert to previous ones) for this great editting feature (I say editting because of course the q3 engine has always been capable of this!).
And cheers Ratty for the tut, it helped me sort out what was going wrong in my own stuff.

Here’s a quick pic (as usual doesn’t really do it justice - particularly having to brighten it in photoshop and can’t be bothered to desaturate it a bit, but hey :)):

And here’s the associated shader:

textures/mml_helmsdeep/glittering
{
	// Editor properties
	qer_editorimage textures/mml_helmsdeep/glitter.tga

	// General properties
	nopicmip

	surfaceparm nonsolid
	surfaceparm nolightmap
	surfaceparm trans
	polygonoffset

	// Background
	{
		rgbgen vertex
		alphagen vertex
		blendFunc GL_SRC_ALPHA GL_ONE
		map textures/mml_helmsdeep/glitter.tga		
	}

	// Alpha write
	{
		depthwrite
		rgbgen identity
		alphagen vertex
		alphafunc ge128
		blendfunc add
		map textures/mml_helmsdeep/glitteralpha.tga		
	}

	// Sparkle effect
	{
		tcgen environment
		tcmod scale 2 2
		tcmod scroll 0.003 0.01
		rgbgen vertex
		depthfunc equal
		blendfunc add
		map textures/mml_helmsdeep/glitter.tga
	}
}

The first layer is an additive static blend I did this simply because otherwise the blends were harsh edged.
The second layer is the depth write - the alpha matches the image used in the first layer (IE I derived the alpha from the image with photoshop)
The third layer is the brightest, glittering / scrolling effect.

Looks pretty nice, and since I don’t plan on going overboard on using it, should liven up the odd section here and there in me caves :slight_smile:


(ratty redemption) #74

cool and Ill have to try that depth write stuff sometime, Ive not used it like before.

btw Gerbil, Ill soon be updating the water in our terrain maps, so Im looking forward to working with you on them again :slight_smile:


(G0-Gerbil) #75

:slight_smile:
OK, was going to drop you a mail to say i hadn’t forgotton :slight_smile:
It says somewhere earlier in this thread you were going to do an HTML version of the tutorial - do you have a website yet?


(ratty redemption) #76

cool and I dont have a website of my own atm, so probably will want someone to host, help me with the html versions, but the forum tuts are still too messy and Im too busy to update, sort them out atm, but their on my to do list.


(WolfWings) #77

I can host from my domain if nothing else. :slight_smile:


(ratty redemption) #78

@WolfWings, thanx man and I`ll keep that in mind when the time comes :slight_smile:


(Mr_Tickles) #79

Ok… So… can anyine tell me what a normal of a vertex is please?
Vertex normal anyone?


(ratty redemption) #80

sorry I can`t but someone in here should be able to.