easygen, key/value in func_group:ed terrain, shader


(Loffy) #1

Hi!
I’ve created terrain with the aid of Easygen. I’ve manually altered the shader.
When I select the terrain in the editor and hit “N”, I see a key: “shader” with the value: “the_hill/terrain”.
What is that key/value refering to, specifically?
//Loffy

PS. the_hill was just a working-name I used in the beginning. it is not in use anymore. I want to make sure that the key is pointing to the right information.


(Detoeni) #2

“path_to/shader”
the texture/model part having been dropped.


(EB) #3

Well, when you make the terrain in easygen the shader that is created is named after the terrain you created as an .egn file. You probably already know that huh Loffy ? hehe.
-Anyways, So “the_hill” is the name of the shader that it will specifically be looking to for the terrain’s texturing.
So inside of the shader “the_hill”, the single titled shader lines read “the_hill/terrain_0to1” and “the_hill/terrain.vertex” and some others… So if you change the name of the shader, then I would change the ‘Value’ to match (ie; from the_hill.SHADER to NEWMAPNAME.SHADER and then the ‘Value’ from the_hill/terrain to NEWMAPNAME/terrain). If you change the innerds of the .shader, just make sure the single title shader lines still read the same as they did once they were output or still connective within the same means. If you try adding the terrain shader, in radiant, to extra brushes that weren’t created in Easygen, then make sure you add those brushes into the func_group entity or give it the same keys and values as that entity it needs to mimic. If I didn’t explain well enough just let me know, I tend to shorthand things… but you know that. :wink:


(Loffy) #4

Thanks for your replies guys. It’s appreciated!
I also found out that the shaders have to be rewritten.
I found several good tips in this forums (using search) and I read the lightmaps read me included with the q3map2 (lm.txt?).
Heres my terrain shader now:


textures/duplex_towers/terrain_base // Template terrain shader
{
	q3map_lightmapaxis z // Project lightmap on z axis (up/down)
	q3map_lightmapmergable // Merges all terrain into one seamless lightmap
	q3map_lightmapsamplesize 32 // Sets lightmap sample size to 2x normal to save mem
	q3map_lightmapsize 512 512
	q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
	q3map_nonplanar
	q3map_shadeangle 120
	surfaceparm landmine
	surfaceparm snowsteps
}

textures/duplex_towers/terrain_0
{
	q3map_baseshader textures/duplex_towers/terrain_base // template shader
	{
		map textures/snow_sd/icelake3.tga
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
	}
}

textures/duplex_towers/terrain_1
{
	q3map_baseshader textures/duplex_towers/terrain_base
	{
		map textures/snow_sd/icelake2.tga
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
	}
}

textures/duplex_towers/terrain_2
{
	q3map_baseshader textures/duplex_towers/terrain_base
	{
		map textures/snow_sd/snow_var01_big.tga
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
	}
}

textures/duplex_towers/terrain_0to1
{
	q3map_baseshader textures/duplex_towers/terrain_base
	{
		map textures/snow_sd/icelake3.tga
	}
	{
		map textures/snow_sd/icelake2.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
	}
}

textures/duplex_towers/terrain_0to2
{
	q3map_baseshader textures/duplex_towers/terrain_base
	{
		map textures/snow_sd/icelake3.tga
	}
	{
		map textures/snow_sd/snow_var01_big.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
	}
}

textures/duplex_towers/terrain_1to2
{
	q3map_baseshader textures/duplex_towers/terrain_base
	{
		map textures/snow_sd/icelake2.tga
	}
	{
		map textures/snow_sd/snow_var01_big.tga
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
		alphaGen vertex
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
	}
}

And the keys/values for the terrain (func_group) are
alphamap duplex_towers.pcx
shader duplex_towers/terrain

It seems to work. if you see some stupid misstake above, let me know. Otherwise, expect Duplex Towers in the near future! (Twin Towers was too politically loaded, I thought - Duplex Towers sounds more neutral (even though duplex means twins).
Thanks again
//Loffy


(Loffy) #5

Hm, sharp edges between textures. Don’t like that. How do I get smooth blends instead?:


I will surf the forum to try to solve this one. Will try some other textures too (I want to stay with the default snow textures that came with the original installation of ET).
//L


(iwound) #6

You could try this, i think it should work

  textures/duplex_towers/terrain_0 
{
  
	q3map_novertexshadows  
	q3map_shadeangle 60
	q3map_forcesunlight
	surfaceparm snowsteps  
	surfaceparm landmine
	{
		map textures/snow_sd/icelake3.tga 
		rgbGen vertex
		tcmod scale 0.063 0.063
	}
}

textures/duplex_towers/terrain_1 
{
 
	q3map_novertexshadows  
	q3map_shadeangle 60
	q3map_forcesunlight
	surfaceparm grasssteps 
	surfaceparm landmine 

	{
      		map textures/snow_sd/icelake2.tga
		rgbGen vertex
		tcmod scale 0.063 0.063
	}
}

textures/duplex_towers/terrain_2
{
  
	q3map_novertexshadows  
	q3map_shadeangle 60
	q3map_forcesunlight
	surfaceparm grasssteps 
	surfaceparm landmine 
	{
      		map textures/snow_sd/snow_var01_big.tga
		rgbGen vertex
		tcmod scale 0.063 0.063
	}
}


textures/duplex_towers/terrain_0to1 
{
  
	q3map_novertexshadows  
	q3map_shadeangle 60
	q3map_forcesunlight
	surfaceparm snowsteps  
	surfaceparm landmine
	{
      		map textures/snow_sd/icelake3.tga 
		rgbGen vertex
		alphaGen vertex
		tcmod scale 0.063 0.063
	}
	{
      		map textures/snow_sd/icelake2.tga 
		rgbGen vertex
		alphaGen vertex
		tcmod scale 0.063 0.063
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
	}
}

textures/duplex_towers/terrain_0to2 
{
  
	q3map_novertexshadows  
	q3map_shadeangle 60
	q3map_forcesunlight
	surfaceparm snowsteps  
	surfaceparm landmine
	{
      		map textures/snow_sd/icelake3.tga 
		rgbGen vertex
		alphaGen vertex
		tcmod scale 0.063 0.063
	}
	{
      		map textures/snow_sd/snow_var01_big.tga
		rgbGen vertex
		alphaGen vertex
		tcmod scale 0.063 0.063
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
	}
}


textures/duplex_towers/terrain_1to2 
{
  
	q3map_novertexshadows  
	q3map_shadeangle 60
	q3map_forcesunlight
	surfaceparm snowsteps  
	surfaceparm landmine 
	{
      		map textures/snow_sd/icelake2.tga 
		rgbGen vertex
		alphaGen vertex
		tcmod scale 0.063 0.063
	}
	{
      		map textures/snow_sd/snow_var01_big.tga
		rgbGen vertex
		alphaGen vertex
		tcmod scale 0.063 0.063
		blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
	}
}


textures/duplex_towers/terrain.vertex
{
 
	q3map_novertexshadows  
	q3map_shadeangle 60
	q3map_forcesunlight
	{
		map textures/snow_sd/icelake3.tga 
		rgbGen vertex
		tcmod scale 0.063 0.063
	}
} 

(Loffy) #7

OK, will try.
Im also fiddling with the idea to use alpha blend techniques. (Sock’s tutorial you remember.)
//Loffy


(Detoeni) #8

textures/duplex_towers/terrain_0
{

q3map_novertexshadows
q3map_shadeangle 60
q3map_forcesunlight
surfaceparm snowsteps
surfaceparm landmine
{
map textures/snow_sd/icelake3.tga
rgbGen vertex
tcmod scale 0.063 0.063
}
}

vertex terrain shaders went out with the square wheel, if you dont know how to help someone then don’t post miss-leading trash plz.

loffy is your shader listed in the shaderlist.txt?


(Loffy) #9

yes, its in the shaderlist.
Infact, I think I will use the alpha blend instead. The testrestults I’ve gotten (testmap) is just incredible. Well, not that “call the UN!”-incredible, but really nice results.
//L.

EDIT: added comment after your reply below:
Yes. EasyGen + new shaders, incl. Alpha blend = great.


(Detoeni) #10

No worries, are there any keys in your worldspawn that you did not add?(apart from classname) easy gen can add code here for vertex terrain shaders, that will break the lightmapped stuff.

alpha blend is great stuff to work with. Its by far the best way of doing terrain.


(iwound) #11

Detoeni :
vertex terrain shaders went out with the square wheel, if you dont know how to help someone then don’t post miss-leading trash plz.

point taken! i dont claim to be an expert, but thought it might have got the effect he wanted and then he could change it.

But could you expand a little on why my shader isnt correct, as i use that for mine,
( seems to work fine ) as i would be interested know.


(Detoeni) #12

no worries,
If he wanted naff, yuk looking terrain, it would have worked well. I’ll give you that.

Your vertex terrain: lighting is calulated from the light value at each vertex point in the terrain.This value is then smoothed between points.

Lightmapped terrain: lighting is calulated based on the size of the lightmap used(normaly 512x512) and gives very detailed, realistic shadows. You can up this detail untill every leaf on your trees casts a shadow on the terrain.

See here for a more detailed and complete explanation:
http://www.planetquake.com/simland/pages/articles/terrain1_1.htm


(iwound) #13

cheers for that Detoeni, i will read through that several times or till it sinks in, hopefully i’ll have some good looking terrain. heres a before pic of a section of the terrain i have now. I’ll post an after pic when its done.

…first , vertex lit terrain
…second , the dotproduct2 terrain
…third , lightmap terrain