Terrain blending tutorial for noobs by Seven_dc


(seven_dc) #1

I showed ratty redenptions tutorial for fellow mapper and he said: too complicated. But I think blending is not so hard. So here is little basic tutorial to get started with fantastic q3map2 feature!

  1. Just choose some nice textures which you want to blend.
    I use ET and choosed nice snow textures:
  • textures/snow_sd/snow_noisy.tga
  • textures/snow_sd/snow_var01_big.tga

So I created nice shader for my white snow:

textures/forest_dc/snow_1
{
	qer_editorimage textures/snow_sd/snow_var01_big.tga	

       q3map_forceMeta
       q3map_nonplanar
       q3map_shadeAngle 179 
	surfaceparm landmine	
	{ 
		map textures/snow_sd/snow_var01_big.tga
	        rgbGen identity
	}	
   	{
      		map $lightmap
      		blendFunc GL_DST_COLOR GL_ZERO
      		rgbGen identity
   	} 
}

And made blending shader to the more dirty snow:
textures/forest_dc/snowmurky

textures/forest_dc/snowmurky
{
	qer_editorimage textures/snow_sd/snow_noisy.tga
	
	q3map_forceMeta
   	q3map_nonplanar
   	q3map_shadeAngle 179 
	surfaceparm landmine	
	{ 
		map textures/snow_sd/snow_noisy.tga
	        rgbGen identity
	}
	{ 
		map textures/snow_sd/snow_var01_big.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA      		
      		rgbGen identity
      		alphaGen vertex
   	}
   	{
      		map $lightmap
      		blendFunc GL_DST_COLOR GL_ZERO
      		rgbGen identity
   	} 
}

Now the hard part is done!
Now to the more visual part of the tutorial…

First of all texture your terrain with the base shader and then select few brushes to see where should the alpha blending be:

Then create nice brush with alpha shader 0% in middlepoint of the terrain brushes

Texture those surrounding brushes with the blend shader:

Func_group your texturized brushes and the alpha shader.

compile and look the amazing blend!!

This tutorial is not perfect and describes only very simple blend. see rattys tutorial for bigger scale blending: http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=8244

EDIT: Thanks for ratty to pointing out typos.


Avandia Attorneys


(Fracman) #2

Eh… did i miss something?
Why did you add that strange cube with alpha 0% ???


(seven_dc) #3

For the blending. The every vertex inside these cube with alpha 0% gets alpha channel of level 0 and it gradianly goes to edges of the brushes where alpha is 100%. these weird alpha boxes uses the special q3map_alphaMod shaders from rgoer.


Avandia Lawyers


(ratty redemption) #4

@seven_dc, thanx, this will help a lot, and feel free to update your newbie friendly tut with anything from my “advanced mapper” version.

which uses the same principles, just @seven_dc is starting you guys off with a simpler blend then what I started on, plus he`s filling in the inbetween steps which I left out due to time, and as I knew some experienced mappers would decipher my version.

I`m going to be posting my 2nd chapter on terrain hopefully tonight, so depending on how you guys are following all this, your have two resources to follow :slight_smile:


(Fracman) #5

You two should work on a newbie2pro friendly tutorial then :wink:


(Mr_Tickles) #6

Very true


(ratty redemption) #7

also take into consideration, I spent over 6 months doing nothing but terrain and water test maps, using various methods of blending and construction.

even with the best tutorials, and I`m not saying mine is one of them, this stuff might take more then a few days to learn for some of you.

the important thing is to know the engine can produce these kinds of results, and that if you guys can keep your heads cool, and are prepared to listen to the advice of other mappers who already understand this stuff, then any of you could in theory, reproduce as good results with enough time and practice :slight_smile:


(MadJack) #8

seven, I’m wondering where you got that alpha 0%. It has to be a shader right? Could you post the content.

I haven’t been playing with different ways to make terrain, I’m old school, so I’m confused the way ratty set his tutorial.


(dime1622) #9

the alpha 0 comes from ydnar’s stuff he distributed. take a look at his sticky in the q3map2 forum at the top. its in his first post. hes got a link to download it.


(MadJack) #10

Now it makes a lot more sense! :smiley:

I’m wondering if, as ratty’s tut, those imagse need to have a saturated alpha channel or I could use a non-alpha or a normal alpha image?


(dime1622) #11

it needs to have an alpha channel, pure white, or else youll be able to see through it.


(MadJack) #12

Alright then, now that I have all the info, let’s try that… Willl try to post later with some results. :smiley:


(Ifurita) #13

I get my terrain from Mustard. Yay Mustard!


(ydnar) #14

Nice tutorial!

Note that it’s not necessary to func_group the brushes to get the blend to work. If you have a large pot of terrain blending between just two different textures, it’s fine to have the blend shader on all of it and use alphaMod volume brushes on the verts where you want the blends to be.

y


(ratty redemption) #15

I agree with ydnar on all that :slight_smile:


(seven_dc) #16

You do not need any alpha channels! If you have ET just create those shaders and fire away.


Lovely Wendie


(ratty redemption) #17

another way of thinking about this is:

linear blending: similar look to the old style meta shaders, indexmap terrain blending, and quick and easier to set up, more predictable results.

dithered blending: needs some alpha channel tex, and looks like dotproduct blends, harder to set up and less predictable results, so more tweaking involved.


(MadJack) #18

It seems I have a little inconvenient… I finally got some time to work on it and got something that doesn’t look too bad though there’s still some tweaking to be done but I noticed there’s no markings from the blending area, no shadow projected either. It will make some gravel ejections/gravelsteps though.

I had some ISP problem and I couldn’t access the net so I couldn’t see about the alpha channel so my images have them. I wonder if it’s because of that. Also, even though brightness/contrast is at 100% on the alpha channel I still can see through when there are explosions like artillery.

I’m about to go to bed but I’ll try without any alpha channel tomorrow and see what it does.

Now if I can only find a way to make the textures from the terrain fit with the alpha mod… I guess that’ll take lots of work if it’s even doable.

Here’s what it looks like after artillery strikes.


(seven_dc) #19

I think the problem here is the shaders. If you did copy mine they use the phong shading and react differently to shadows. try using the same shader parameters in your blending shader than the other terrain shaders. Wuold you mind of posting your shaders. thx.


Fetish Tube


(MadJack) #20

Got the problem fixed. There was one blendFunc too many.

Since I took dime’s shader I think he should check if his test map will have the same behavior as mine did. Might be me who pasted that part too…

Here’s the shader:


textures/ebe/road_alpha
{
	qer_editorimage textures/ebe/dirt_pebbles.tga
	q3map_forceMeta
	q3map_nonplanar
	q3map_shadeAngle 179
	surfaceparm gravelsteps
	{
		map textures/ebe/dirt_pebbles.tga
		//blendfunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
	}
	{
		map textures/ebe/grass_dirt3.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		rgbGen identity
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

The commented blendFunc in the first stage is the one that was giving the no shadow/nomarks.

Next step is to remove those alpha channel (or use the jpg) and see what it does.