Textures and terrains in ET


(Prophesy) #21

Thanks.


(hummer) #22

Thanks for the clarification :slight_smile:

By new metashader format, do you mean like, using a base shader then having other shaders inherit properties from it, or something entirely different? At this point I’ve re-written the shader as such.

Also, you mentioned in an eariler post that inporting / exporting of .maps can be useful in EasyGen. However, if triangles are manually cut, say, to 128 x 128, does easygen export it back out as a 256 x 256?

If I’m asking too many questions, go ahead and tell me to feck off :slight_smile:


(sock) #23

I mean exactly that, metashaders can have a base shader now which saves alot of time and allows the terrain to maintain some parameter standards. ALot easier if you want to modifiy the whole terrain. The last time I looked at Easygen 1.4 it did not cope with creating metashaders with lightmaps and still used the old system of vertex light. Often it is easier to just write the metashader by hand or use the existing metashaders in ET as a template.

Indeed the import/export map feature of Easygen is very good, but it does not cope with multiple sized terrain triangles or cut sections. In various places of the Fueldump map I had to cut the terrain to fit brushwork. There were a couple of times I had to cut the terrain triangles because they were sharing the same space as some existing brushwork. For example the image below shows the tunnel entrance at the beginning of the map.

The triangle section of the terrain is flush with the inside of the tunnel. The edge of the terrain was painted with a “caulk” texture but it still cut the inside of the tunnel and cause some nasty splits of the tunnel brushwork. The solution was to do some cutting of the terrain triangle to stop the inside edge of the terrain sharing the same space as the inside of the tunnel brushwork as follows:

Because the inside edge of the terrain no longer shared the same space as the inside of the tunnel brushwork it did not cause nasty splits/cuts in the brushwork. These cuts also affected the floor and caused alot of unnecessary triangles.

The moral of this story is that sometime u need to cut the terrain in order to stop the compiler from creating more splits of other brushwork. Once the terrain is cut to fit it becomes difficult for Easygen to import/export the terrain again.

Sock
:moo:


(Prophesy) #24

Again, excuse a light n00b :???:

Could someone please explain the difference beetween metashaders with lightmaps and the old system of vertex light.


(Danyboy) #25

Can’t really give definitions of lightmap and vertex lighting - but a metashader is the name given to the .shader file you find in the scripts folder of any Q3-based engine


VTX1300S


(sock) #26

Metashaders is the name given to the special set of shaders used to create terrain blends. Originally all terrains where designed with vertex light because of the time and the size of the lightmaps needed for the BSP. The original syntax for terrain metashaders used vertex light.

Here is a sample from the terrain.shader with TA (Q3 Team Arena) the pioneer of the technology.

textures/terrain/mpterra2_0

{
	qer_editorimage textures/stone/pjrock9b_2.tga
	surfaceparm nolightmap
	q3map_novertexshadows
	q3map_forcesunlight

	{
		map textures/stone/pjrock9b_2.tga
		rgbGen vertex
		tcmod scale 0.125 0.125
	}
	{
		map textures/skies2/clouds.tga
		blendfunc filter
		detail
		tcmod scale 0.01 0.01
		tcMod scroll -0.05 0.05
		tcmod transform 1 0 1 1 1 1
	}

	
}

Notice on the first stage of the shader it forces the texture to be drawn with vertex light and the shader does not have a lightmap stage either. Here follows a section of the metashader for Fueldump, stored in the fueldump.script file.

textures/fueldump/terrain1_0
{
        qer_editorimage textures/stone/mxsnow2.tga
	q3map_baseshader textures/fueldump/terrain_base
	{
		map textures/stone/mxsnow2.tga
		rgbgen identity
	}
	{
		lightmap $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbgen identity
	}
	{
		map textures/detail_sd/snowdetail.tga
		blendFunc GL_DST_COLOR GL_SRC_COLOR
		rgbgen identity
		tcMod scale 5 5
		detail
	}
}

Notice the lightmap stage of the shader and the main texture having a “rgbgen identity” parameter.

The documentation for metashaders is usually included with a default install of the GTK editor. Go to the directory where it is installed (usually \Program Files\GtkRadiant) and find the directory called “Terrain_Manual”. This has some documentation on metashaders and the basics of terrain creation.

Adding a light stage to a shader is covered in the Shader manual which is linked to the F1 menu of the GTKEditor browser help as follows:

Quake III Arena Shader Manual
http://www.planetquake.com/polycount/resources/quake3/tutorials.shtml
http://www.quake3world.com/files/Q3Ashader_manual.doc
This is the official id documentation of Quake III Arena shaders. The second source is a download

Sock
:moo:


(Prophesy) #27

Thanks :drink:
I will dig into metashading now.

Although I have been mapping for a couple of years, I have almost learnt more in this forum than in all others.


(hummer) #28

Heh… this thread especially :slight_smile:

So, I’m building my terrain now. I have the alphamap more or less the way I like it, but I think I’ll want to go back and make changes to it. I’ve found painting it in Easygen and exporting is a simple way of doing this, rather than hand editing the alphamap.

So now, I want to start smoothing the terrain manually, cutting triangles and such. I’ve already played with this a bit. However, if I need to make changes to the alphamap, putting the terrain back into Easygen is going to lose all my manual terrain cutting.

Is there an easy way, or at least some method to go back and fourth between the two? At the moment, all I can think of is “saving” the manually cut trianlges into another .map file, the bringing them back in after the terrain has been imported / exported into Easygen. This seems like a huge pain in the ass.

Maybe I should just get the texturing the way I like it, and stick with it :confused:


(SCDS_reyalP) #29

If you are just changing the alphamap, you don’t need to re-export the .map. (assuming you actually mean alphamap and not heightmap)

I don’t know how easygen deals with this, but if it requires you to export everything at once, at the worst you should just have to point it to a different directory, and manually copy the new alphamap to the correct location.


(hummer) #30

I guess my concern is, when I manually change the terrain in Radiant, it’s possible that there will be some fundamental changes to the terrain that will affect the texturing.

For example, if I take down part fof a hill, but there’s a rock texture on it. Or maybe I raise up some terrain with sand applied to it, but I’d rather have rock.

So, I make these changes, but then I have to change the texturing to refelct these changes. Using the original terrain as a base might work, but it’d take some fudging, and mutiple imports / exports / recompiles / to get it right. I’d have to manually change the alphamap and hope it accuratley reflects changes made to the terrain.

What I’d rather do, is make changes in Radiant, then import back into Easygen and repaint the terrain. But if I’ve cut small triangles, they’ll be lost in the process.

What I guess I’ll do for now, is make the changes to the terrain as necessary, and not cut up the trianlges. Then edit the alphamap / texturing as needed, export, then make the smaller cuts. I just hate feeling like I’m locked into that terrain / texturing once it’s been built :confused:

Also, one a side note, I’m noticing that even on steep cliff walls, players can run up the “seams” of the terrain… where two trianlges meet and go up. This happens even if the terrain is really tall. Is there some way to prevent this besides putting, say, slip brushes over all the seams?


(Mr_Tickles) #31

Hey! Just thought I’d bring this thread back seen as though it was the only one that came up in my searches, and it is also extrememly helpful.

What I was searching for:

I was wondering if there was a command you could add to the shader that easygen exports so that you can project your alphamap from the sides rather than from above. The reason I want to do this is to create a large cavern with the easygen style blending and not just a single texture that gtkgensurf gives. Also, the easygen method would be a lot more helpful as I can then create properly curved cavern surfaces. I.e. if you use gtkgensurf you still end up with a box which may have bumpy sides.

Well, I suppose in general, seen as though you can’t really support easygen, I was wondering if you can project alphamaps onto the terrain/terrain2 brushes from an angle other than the vertical, also including the negative vertical?


(thegnat) #32

For this I would use the “newly” introduced alphavolume blending method. I think it will also work well on the sides of brushes - not only on top of them.

Rattys tutorial: HERE


(joop sloop) #33

be sure to also check the rockwall tutorials by sock :wink:


(Mr_Tickles) #34

Coolio, thanks guys.

Is there any way you know of, of making the cavern this way however? The reason I ask is because it is hopefully going to be about half the size of my map already. I can easily set up the shape that I want via Easygen. But it’s just too damn big to do either by hand or gensurf. Gensurf only deals with flat surfaces, ok it does make the surface uneven, but doesn’t have curvy edges which could be done with easygen. Thanks for the replies, and I guess I may have to do this by using the easygen heightmapping and some alpha blending, thanks. :slight_smile:


(joop sloop) #35

By hand produces the best effect and you have the best control of your rockface. You could always rotate your easygen terrain in radiant, and write your own custom terrain shader?


(Mr_Tickles) #36

Yeah, I was trying to avoid doing it by hand, but I may have to. When you say, “create your own custom terrain shader” wouldn’t you need to know how to project an alphamap from the horizontal rather than the vertical? This is my problem with altering the Easygen shader aswell. Thanks for the reply :slight_smile:


(Mr_Tickles) #37

Hmmm, yeah, but how would I project the alphamap from a horizontal axis? The only thing that I can find in the shader easygen outputs is q3map_lightmapaxis z, and I don’t think this would do that. Maybe there is something which is set as default and therefore wouldn’t be put into this shader as z is the assumed axis for terrain.

Basically:
How do I project an alphamap horizontally?