PDA

View Full Version : Check it out: I got phonged-up metashaded terrain working!


rgoer
07-21-2003, 06:25 AM
http://www4.ncsu.edu/~rlcordes/shot0064.jpg

And they told me it was impossible... heh. Ydnar knows best, like always. I love q3map2.

Shotokan
07-21-2003, 06:33 AM
Wow rgoer... As a fellow mapper my respect for you has heightened dramatically. I am impressed like always rgoer.

Kengo
07-21-2003, 10:13 AM
*Gasp*

That is amazing man, looks truely excellent. Shame your character's more than ample frame blocks out most of the view ;) Amazing the difference a good skybox can make to the look of a level, I think several maps of late like Patrick_Hs have shown that. You got this skybox in mind for a particular project?

BTW, up for a fight with the RPG system? :)

Patrick_H
07-21-2003, 01:12 PM
Man, that looks great. I have read a little about this in one of the EasyGen manuals. After seeing this screen, I'm dying to redo some of the exteriors of my map. Did you use EasyGen for this? Expect more pestering to come...

rgoer
07-21-2003, 01:32 PM
Yes, I used EasyGen for this, but it was a little bit of a pain in the ass. Truthfully, though, the only hard part was getting past everybody that said "oh, you can't do that in JK2." Other than that, you have to remember that when people talk about the quake3 "scripts" directory, they mean the "shaders" directory in JK2, and also that there exists no common/terrain shader in JK2 by default--you have to make it yourself.

Patrick_H
07-21-2003, 01:43 PM
Yeah I was a bit thrown by that "scripts" thing too, but looked at a few Q3 maps and realized that it was where the .shader file was kept.

So this common/terrain shader exists in Quake III?

rgoer
07-21-2003, 01:47 PM
Yeah. All you have to do is open up yourmap.shader in Notepad and add this to the end of it:textures/common/terrain
{
q3map_terrain
surfaceparm nodraw
surfaceparm nolightmap
surfaceparm nomarks
} That's all it takes. Let me know when you've got a decent metashader working in JK2 and then I'll tell you how to get it lightmapped (instead of vertex-lit), so shadows and such fall correctly onto your terrain.

wedge2211
07-21-2003, 02:25 PM
Hot damn. Just don't use yavin/greenblock, it has ugly lines where I think you meant to have grass. :)

But, man, that looks nice. Where's the rest of the map to go with it????

Shotokan
07-21-2003, 09:26 PM
Yea wedge is right. Use the yavin moss texture thing. Well I'm assuming that you want the floor to look green because of the yavin/greenblock texture.

rgoer
07-21-2003, 11:28 PM
Heh, thanks for the concern, guys. This was just a quick proof-of-concept map; the textures were chosen quasi-randomly, solely because I thought they were different enough from each other that I could see if the alpha-blending was working properly. You guys are right, though: greenblock is fugly.

Eldritch
07-22-2003, 02:43 AM
:eek: :eyeraise: :eek:

Sweet merciful crap!

I don't even have the words to describe such a screenshot - the proof-of-concept ALONE is staggeringly stupourfazing (yeah, I made that word up JUST for that terrain).

Can't wait to see the rest of the map that accompanies it. :D

__CKY__
07-24-2003, 08:29 PM
:eek: That is awesome dude! :cheers:

Jorus Ardel
07-25-2003, 04:32 AM
Holy sheat! Is all I have to say. That is certainly exceptional, nice work on that man!

<EJK>DevMapAll
08-16-2003, 02:46 AM
Screenshot........too...............big........... .

Nice man:thmbup1: love it

I know the screentshot is in multiplayer, so is the map going to be multiplayer or SP?

JDKnite188
08-16-2003, 05:47 PM
Just beautiful. MAKE MORE MOUNTAINS! I wouldn't mind just walking through miles of that.

Oh btw, that skybox is nice, but I can see block edges in it. Try to get a more detailed one.

rgoer
08-16-2003, 07:08 PM
Originally posted by JDKnite188
...Oh btw, that skybox is nice, but I can see block edges in it. Try to get a more detailed one...Tell it to Raven Soft--it's one of theirs. Like I said: this was just a proof-of-concept map. When I get around to using this technology in a real map, you can rest assured I'll be making my own high-res skybox.

Shadyz
08-17-2003, 11:15 PM
Step by step tut be possible?

rgoer
08-18-2003, 01:50 AM
Before we get started, class, will all students please make sure they've downloaded EasyGen (http://digilander.libero.it/ilbanca/files/EasyGen_v142.zip) for me? Thanks, that's a big help. Also, take some time to familiarize yourself with the EasyGen 3D view controls before going any further with this tutorial; they are pretty much like Radiant, but there are a few subtle differences. If you play around with it for two minutes, you'll figure it out.

Some EasyGen (http://digilander.libero.it/ilbanca/files/EasyGen_v142.zip) setup guidelines: When it asks you for the "Work mod" path, enter the path to your "gamedata/base" directory (for default install of JK2: "c:\program files\lucasarts\star wars jk ii jedi outcast\gamedata\base")
Ignore the "Bitmaps" "Export folders" path
Put the path to your "gamedata/base/textures" in for the "Bitmaps" "Import folder" (for default install of JK2: "c:\program files\lucasarts\star wars jk ii jedi outcast\gamedata\base\textures\")
Set the "Player size" to "32 32 64"
Make sure the "Texture load filter" is set to "jpg;tga"1. Create your heightmap in the bitmap-creation software of your choosing. I'm partial to Photoshop, but if that particular app is beyond your means, I'm sure any number of cheaper alternatives will give you decent results (maybe). Here are the particulars: The heightmap needs to be 33x33 pixels (yes, that small--each pixel of this heightmap corresponds to a terrain vertex in EasyGen)
The heightmap must be an 8-bit, greyscale .bmp Bitmap file.
50% grey is "sea level," zero elevation. Darker pixels are lower elevation, and brighter pixels are higher. Who would have guessed?
Save your heightmap into your base/textures/<yourmap>/ directorySo anyway, here's how my heightmap turned out for this little test map I started this thread for:http://www4.ncsu.edu/~rlcordes/heightmap.bmpJust a little unimpressive, yeah? Well, brace yourself: the sparks, now waking from their long winter naps, are preparing to fly.

2. Fire up EasyGen (http://digilander.libero.it/ilbanca/files/EasyGen_v142.zip) and pick, from the "File" menu, "Import -> Heightmap (.bmp)"

http://www4.ncsu.edu/~rlcordes/easyGen0.jpg

In the next little window that pops up, hit the "Browse..." button and navigate to base/textures/<yourmap>/ (where you saved the .bmp heightmap you created in step one). After you've chosen your heightmap, notice the "Terrain height" field: it defaults to "256," which is pretty low. Set this to "1024" and hit "Ok." You should see something like this:

http://www4.ncsu.edu/~rlcordes/easyGen1.jpg

3. Now it's time to add textures; from the "Textures" menu in EasyGen (http://digilander.libero.it/ilbanca/files/EasyGen_v142.zip), choose the "Add folder..." option (it's the first one):

http://www4.ncsu.edu/~rlcordes/easyGen2.jpg

Now browse to the textures directory of your choosing; for this example map, I used the "Yavin" texture set. Loading the textures in EasyGen (http://digilander.libero.it/ilbanca/files/EasyGen_v142.zip) takes even longer than in Radiant, so be prepared to wait. You'll know it's ready when you can hit the "Alphamap" tab and things look like this:

http://www4.ncsu.edu/~rlcordes/easyGen3.jpg

4. Click the first black square in that color palette area and choose a non-black color. Then scroll down the texture browser (on the left) and choose what texture you want that color to represent. Now, choose "Texture" from the "View" menu and things will start looking like this:

http://www4.ncsu.edu/~rlcordes/easyGen4.jpg

5. Click the next black square in the palette, pick a new color and a new texture. Now we're ready to start painting. Make sure your newest color/texture is selected in the palette, then you can use ctrl+shift+leftMouse to paint that texture onto your terrain:

http://www4.ncsu.edu/~rlcordes/easyGen5.jpg

6. Click the next black square in the palette, pick a new color and a new texture. Paint as many different textures onto your terrain as you like, but be warned: quake will alpha-blend at most two textures on any given triangle. If you try and blend more than two textures on one triangle, it will show up as black in EasyGen (http://digilander.libero.it/ilbanca/files/EasyGen_v142.zip), so it's easy to see the areas you need to go back and fix:

http://www4.ncsu.edu/~rlcordes/easyGen6.jpg

When you get this, you'll need to re-paint your textures until you've only got two blends happening on any given triangle.

7. Once you've got your textures set up how you want them, it would be a good time to Save your project in EasyGen (http://digilander.libero.it/ilbanca/files/EasyGen_v142.zip). Just in case the power goes out, you can load up your .egn file and not have lost all this work.

8. Now is the time to export the whole shebang:

http://www4.ncsu.edu/~rlcordes/easyGen7.jpg

Then, in the next window, set your options like this (everywhere I wrote "tutorial," put whatever your project is called):

http://www4.ncsu.edu/~rlcordes/easyGen8.jpg

Save the .pcx file into the "gamedata/base/" directory, and save the metashader into the "base/scripts/" directory. This will need to be moved into the "base/shaders/" directory in a little bit, but right now EasyGen (http://digilander.libero.it/ilbanca/files/EasyGen_v142.zip) only wants you to put it into the scripts folder. Set the remaining options up like I've got them (I assume you're using q3map2 (http://www.shaderlab.com/q3map2/2.5/q3map_2.5.6_win32_x86.zip) to compile), and you're good to go. Hit "Continue >>>" and away we go--just save it as whatever.map in the "base/maps/" folder, and we're done with this part.

9. Move your .shader file from the "base/scripts/" folder to the "base/shaders" folder, and then open your .shader file in Notepad (or whatever text editor you prefer). It should look something like this:textures/tutorial/terrain_0
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )
{
map textures/yavin/greenblock.jpg
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/tutorial/terrain_1
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )
{
map textures/yavin/rock3.jpg
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/tutorial/terrain_2
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )
{
map textures/yavin/lighturth.jpg
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/tutorial/terrain_3
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )
{
map textures/yavin/stone.jpg
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/tutorial/terrain_0to1
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )

{
map textures/yavin/greenblock.jpg
}
{
map textures/yavin/rock3.jpg
alphaGen vertex
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/tutorial/terrain_0to2
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )

{
map textures/yavin/greenblock.jpg
}
{
map textures/yavin/lighturth.jpg
alphaGen vertex
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/tutorial/terrain_0to3
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )

{
map textures/yavin/greenblock.jpg
}
{
map textures/yavin/stone.jpg
alphaGen vertex
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/tutorial/terrain_1to2
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )

{
map textures/yavin/rock3.jpg
}
{
map textures/yavin/lighturth.jpg
alphaGen vertex
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/tutorial/terrain_1to3
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )

{
map textures/yavin/rock3.jpg
}
{
map textures/yavin/stone.jpg
alphaGen vertex
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/tutorial/terrain_2to3
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )

{
map textures/yavin/lighturth.jpg
}
{
map textures/yavin/stone.jpg
alphaGen vertex
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/tutorial/terrain.vertex
{
{
map textures/yavin/greenblock.jpg
rgbGen vertex
}
}This is OK, and will work (sort-of), but some tweeking is needed if you want your terrain to get lightmapped. We want to change it to look like this:textures/tutorial/baseterrain
{
q3map_lightmapsamplesize 8
q3map_lightmapsampleoffset 8
q3map_lightmapaxis z
}

textures/tutorial/terrain_0
{
q3map_baseshader textures/tutorial/baseterrain
{
map textures/yavin/greenblock.jpg
rgbGen identity
tcMod scale 0.1 0.1
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbGen identity
}
}

textures/tutorial/terrain_1
{
q3map_baseshader textures/tutorial/baseterrain
{
map textures/yavin/rock3.jpg
rgbGen identity
tcMod scale 0.05 0.05
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbGen identity
}
}

textures/tutorial/terrain_2
{
q3map_baseshader textures/tutorial/baseterrain
{
map textures/yavin/lighturth.jpg
rgbGen identity
tcMod scale 0.075 0.075
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbGen identity
}
}

textures/tutorial/terrain_3
{
q3map_baseshader textures/tutorial/baseterrain
{
map textures/yavin/stone.jpg
rgbGen identity
tcMod scale 0.1 0.1
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbGen identity
}
}

textures/tutorial/terrain_0to1
{
q3map_baseshader textures/tutorial/baseterrain

{
map textures/yavin/greenblock.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.1 0.1
}
{
map textures/yavin/rock3.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.05 0.05
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbGen identity
}
}

textures/tutorial/terrain_0to2
{
q3map_baseshader textures/tutorial/baseterrain

{
map textures/yavin/greenblock.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.1 0.1
}
{
map textures/yavin/lighturth.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.075 0.075
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbGen identity
}
}

textures/tutorial/terrain_0to3
{
q3map_baseshader textures/tutorial/baseterrain

{
map textures/yavin/greenblock.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.1 0.1
}
{
map textures/yavin/stone.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.1 0.1
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbGen identity
}
}

textures/tutorial/terrain_1to2
{
q3map_baseshader textures/tutorial/baseterrain

{
map textures/yavin/rock3.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.05 0.05
}
{
map textures/yavin/lighturth.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.075 0.075
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbGen identity
}
}

textures/tutorial/terrain_1to3
{
q3map_baseshader textures/tutorial/baseterrain

{
map textures/yavin/rock3.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.05 0.05
}
{
map textures/yavin/stone.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.1 0.1
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbGen identity
}
}

textures/tutorial/terrain_2to3
{
q3map_baseshader textures/tutorial/baseterrain

{
map textures/yavin/lighturth.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.075 0.075
}
{
map textures/yavin/stone.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.1 0.1
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbGen indentity
}
}

textures/tutorial/terrain.vertex
{
{
map textures/yavin/greenblock.jpg
rgbGen vertex
}
}

textures/common/terrain
{
q3map_terrain
surfaceparm nodraw
surfaceparm nolightmap
surfaceparm nomarks
}You'll need to twiddle with the "tcMod scale" lines to get your textures looking how you want them, exactly, but this shader file should now be good to go. I hope you can see how to apply these changes to the shader files EasyGen (http://digilander.libero.it/ilbanca/files/EasyGen_v142.zip) generates.

10. Open up the .map file you created in step eight in Radiant. Select the terrain entity (it's just a func_group, so do whatever you need to do to select all the brushes--in GtkRadiant (http://www.qeradiant.com) it's ctrl+alt+click) and open the entity inspector by hitting the "n" key. Make sure you've got your terrain entity set up like this: just make sure the name of the .pcx file in the entity inspector matches the name of the .pcx file you created with EasyGen (http://digilander.libero.it/ilbanca/files/EasyGen_v142.zip), and make sure that the "shader" line matches the name of your shader file (it should be yourmap/terrain). Finally, make sure that you didn't forget to add the "textures/common/terrain" code to yourmap.shader. Now, save this map as a prefab and import it into whatever map you're working on.

11. Compile with q3map2 and you're good to go--you might want to use the -shadeangle switch (I usually use 120) to make sure your terrain is as smooth as possible. Good luck!

Shadyz
08-18-2003, 02:06 AM
holy crap! thanks alot.

rgoer
08-18-2003, 03:55 AM
No prob; always happy to help.

Shadyz
08-18-2003, 03:53 PM
Ok i did everything in the tutorial and i tested in game and none of my textures showed up. Here are my shaders, and yes after i edited in notepad i renamed it to tutorial.shader

Origional:
http://shadyz.elitegaming.net/tutorial.shader

Edited:
http://shadyz.elitegaming.net/tutorial2.shader

rgoer
08-18-2003, 06:11 PM
Keep in mind that "tutorial" was just the example name I used for the tutorial above. Your .shader file should be called <yourmap>.shader (or whatever naming convention you follow when mapping), where <yourmap> is the name of the project your working on. As in, when I was working on the Chapel of the Ysalamiri, the map file was chapel.map, the textures were in base/textures/chapel/ and the shader file was called chapel.shader.

Now, as for your problems, it looks like you need to be using the "blackstone" name in your .shader file. The terrain meta-shader file doesn't have to be separate from your other shaders (although, if you're familiar enough with how .shader files can be organized, it doesn't hurt to keep them in separate files). Here, try this:textures/blackstoneTerrain/baseterrain
{
q3map_lightmapsamplesize 8
q3map_lightmapsampleoffset 8
q3map_lightmapaxis z
}

textures/blackstoneTerrain/terrain_0
{
q3map_baseshader textures/blackstoneTerrain/baseterrain
{
map textures/blackstone/blackstone6.jpg
rgbGen identity
tcMod scale 0.1 0.1
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbGen identity
}
}

textures/blackstoneTerrain/terrain_1
{
q3map_baseshader textures/blackstoneTerrain/baseterrain
{
map textures/blackstone/blackstone5.jpg
rgbGen identity
tcMod scale 0.05 0.05

}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbGen identity

}
}

textures/blackstoneTerrain/terrain_0to1
{
q3map_baseshader textures/blackstoneTerrain/baseterrain
{
map textures/blackstone/blackstone12.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.1 0.1
}
{
map textures/blackstone/blackstone6.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.05 0.05
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbGen identity
}
}

textures/blackstoneTerrain/terrain_0to2
{
q3map_baseshader textures/blackstoneTerrain/baseterrain
{
map textures/blackstone/blackstone12.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.1 0.1
}
{
map textures/blackstone/blackstone5.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.075 0.075
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbGen identity
}
}

textures/blackstoneTerrain/terrain_1to2
{
q3map_baseshader textures/blackstoneTerrain/baseterrain
{
map textures/blackstone/blackstone6.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.05 0.05
}
{
map textures/blackstone/blackstone5.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.075 0.075
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbGen identity
}
}

textures/blackstoneTerrain/terrain.vertex
{
{
map textures/blackstone/blackstone12.jpg
rgbGen vertex
}
}

textures/common/terrain
{
q3map_terrain
surfaceparm nodraw
surfaceparm nolightmap
surfaceparm nomarks
}Save that into a .shader file called "blackstoneTerrain.shader" and make sure that both "blackstone" and "blackstoneTerrain" have been added to shaderlist.txt. Now, open your terrain .map file and inspect the terrain entity. It should look like this:http://www4.ncsu.edu/~rlcordes/radiant1.jpgYou want to change the first two entries so that they now read:alphamap blackstone.pcx
shader blackstoneTerrain/terrainMake sure that those match your filenames--if you saved your alphamap as "tutorial.pcx" then you need to rename it as "blackstone.pcx" instead.

Now, as long as you added "blackstone" and "blackstoneTerrain" to shaderlist.txt and you do an sv_pure 0 before you devmap, you should be good to go.

One important thing: make sure that the top face of all the brushes in your terrain entity are textured with common/terrain! If you missed this part of the tutorial up there, you really need to re-read it. When you choose to export your "terrain entity" from EasyGen, you have to tell it to use "common/terrain" as the "shader" for the "top" of the brushes. Otherwise, it won't work.

shukrallah
08-21-2003, 12:41 AM
sweet.... i just downloaded that, ganna check it out now :D

shukrallah
08-21-2003, 12:54 AM
everything looks like its working.... just whats a hieghtmap? I dont understand that...


EDIT: nevermind i get it now :)

shukrallah
08-21-2003, 02:01 AM
(I assume you're using q3map2 to compile)

ummm.. what if you dont. My comp cant handle GTK radiant so i use JK2radiant. Ive done all i can to speed GTK up... but its just too slow. Anyways, would i just leave it at standard?

rgoer
08-21-2003, 02:59 AM
You can use q3map2 without using GtkRadiant. You can download the latest version of q3map2 (version 2.5.6) here (http://shaderlab.com/q3map2/2.5/q3map_2.5.6_win32_x86.zip). Then download q3map2toolz (http://lum-chan.bbox.org/moses/files/q3map2toolz_setup.exe) and set it up like so: "Game:" should read either "Jedi Knight2-MP" or "Jedi Knight2-SP" (depending on what you're working on); for "Path to jk2mp.exe/jk2sp.exe" just browse to the .exe it's looking for; for "Path to sof2map.exe/q3map.exe" hit "Browse" again, but this time browse to wherever you installed q3map2--you'll have to tell it to look for "*.exe" and then you can select q3map2.exe; ignore the rest of the settingns and hit ok. Now, you can use q3map2toolz to compile your map with q3map2 and gain access to all the uber features.

wedge2211
08-21-2003, 03:03 AM
You can download q3map2 separately at www.shaderlab.com. Then...basically you open up the compile batch file that JK2Radiant generated, and replace all the references to the SOF2MAP program with the path to the q3map2 .exe. I think you don't need to do anything other than that (oh, the -bsp flag is unnecessary, but q3map2 will take care of it), but you can do so much more cool lighting stuff with q3map2's compile-time options...

Oh, add the -meta switch to the BSP phase command. And leave -fast in the light phase, even if it's a final compile.

shukrallah
08-21-2003, 02:16 PM
I think i got it right. ill test it right now...

anyways, so i make my map with jk2 radiant, and then i load up the toolz thing to compile? ill just test it out.

another question, which is the best compile? right now, ill just try bsp-fullvis -light -extra



*********

whoa, the map looks a lot different. I did have 1 problem. You know that shader for the vents? (i was using my cutscene map, the vent kyle hit with his saber) everything looks super bright in the tunnel, but when he breaks the grid it looks normal, whats wrong with that? should i just use a different grid thing?

rgoer
08-21-2003, 04:40 PM
the "best" compile in q3map2 would look something like this: bsp -meta; vis -fullvis; light -fast -patchshadows -samples 3 -samplesize 1 -bounce 8

shukrallah
08-21-2003, 10:04 PM
Argg... I dont seem to get the texture to work either... and i dont really understand the shader thing... I used yavin textures, and called everything (where you put tutorial) rocky including the map. so it was rocky.shader rock.pcx rocky.map
heres the shader:

textures/rocky/terrain_0
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )
{
map textures/yavin/greenblock.jpg
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/rocky/terrain_1
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )
{
map textures/yavin/s_rock2.jpg
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/rocky/terrain_2
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )
{
map textures/yavin/s_rock3.jpg
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/rocky/terrain_3
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )
{
map textures/yavin/stone.jpg
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/rocky/terrain_4
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )
{
map textures/yavin/lighturth.jpg
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/rocky/terrain_0to1
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )

{
map textures/yavin/greenblock.jpg
}
{
map textures/yavin/s_rock2.jpg
alphaGen vertex
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/rocky/terrain_0to2
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )

{
map textures/yavin/greenblock.jpg
}
{
map textures/yavin/s_rock3.jpg
alphaGen vertex
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/rocky/terrain_0to3
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )

{
map textures/yavin/greenblock.jpg
}
{
map textures/yavin/stone.jpg
alphaGen vertex
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/rocky/terrain_0to4
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )

{
map textures/yavin/greenblock.jpg
}
{
map textures/yavin/lighturth.jpg
alphaGen vertex
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/rocky/terrain_1to2
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )

{
map textures/yavin/s_rock2.jpg
}
{
map textures/yavin/s_rock3.jpg
alphaGen vertex
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/rocky/terrain_1to3
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )

{
map textures/yavin/s_rock2.jpg
}
{
map textures/yavin/stone.jpg
alphaGen vertex
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/rocky/terrain_1to4
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )

{
map textures/yavin/s_rock2.jpg
}
{
map textures/yavin/lighturth.jpg
alphaGen vertex
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/rocky/terrain_2to3
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )

{
map textures/yavin/s_rock3.jpg
}
{
map textures/yavin/stone.jpg
alphaGen vertex
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/rocky/terrain_2to4
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )

{
map textures/yavin/s_rock3.jpg
}
{
map textures/yavin/lighturth.jpg
alphaGen vertex
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/rocky/terrain_3to4
{
q3map_lightmapsamplesize 64
q3map_lightmapaxis z
q3map_texturesize 512 512
q3map_tcGen ivector ( 128 0 0 ) ( 0 128 0 )

{
map textures/yavin/stone.jpg
}
{
map textures/yavin/lighturth.jpg
alphaGen vertex
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
}
}

textures/rocky/terrain.vertex
{
{
map textures/yavin/greenblock.jpg
rgbGen vertex
}
}

sorry if you answered this, but i dont get it :(

BTW, im not worrying about the lightmap right now, if thats required then ill do it though...

thanks

rgoer
08-21-2003, 10:09 PM
Did you add "rocky" to shaderlist.txt before you compiled? And did you "sv_pure 0" before you devmap'ed your map?

shukrallah
08-21-2003, 10:50 PM
no i didnt add so ill just recompile. Anyways, im using SP so i dont think i need the sv_pure 0 but ill type it in just in case...


____

nope didnt work :( (BTW, i said it was called rock.pcx it was rockY.pcx sorry i misspelled that in here)

additional info: rocky.pcx is in the base directory
rocky.shader is in the shaders directory, and rocky.map is in the maps directory. (might have something in the wrong directory)

took a screenshot of the console... maybe it will help..

http://www.angelfire.com/games5/lukeskywalker215/console.jpg

shukrallah
08-22-2003, 12:31 AM
textures/common/terrain
{
q3map_terrain
surfaceparm nodraw
surfaceparm nolightmap
surfaceparm nomarks
}

I have to put this in my shader at the end? Ill try that out and compile... maybe it will work...

just asking would i put:

textures/rocky/terrain
{
q3map_terrain
surfaceparm nodraw
surfaceparm nolightmap
surfaceparm nomarks
}

?

rgoer
08-22-2003, 12:48 AM
No, it needs to be "textures/common/terrain"

Look up in the tutorial--when it came time to export the "Terrain Entity," you told it to texture it with "common/terrain." That's what this shader is for. "common/terrain" is a "special" shader that Quake understands--it's what tells Quake to look in your shader file for the rest of your terrain shaders.

shukrallah
08-22-2003, 02:16 AM
YEAH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


it finally worked. But theres 1 problem, sometimes when im on flat ground and i look down, it looks like the void is showing up, but when i look straight its ok. Any idea whats with this? Maybe it just needs to be in a pk3 file... anyways, thats awesome... thanks a lot!!!!

rgoer
08-22-2003, 03:54 AM
Screenshots? That would really help me diagnose what's going on immensly...

wedge2211
08-22-2003, 02:37 PM
Seeing the void is a VIS issue. Is your terrain made of structural brushes? That could be a problem.

rgoer
08-22-2003, 03:23 PM
Ah--yes. Terrain should always, always, always be detail brushes. Never structural--terrain made of structural brushes would rape your comp during VIS compile. However, since the terrain is detail, you need a structural "caulk hull" around it. That may be your problem, Luke.

shukrallah
08-22-2003, 08:11 PM
Yeah that was the problem... thanks a lot!!! :D :D
This is really useful once you know how to use it :)

rgoer
08-23-2003, 03:43 PM
So let's see some shots of what your working on, now that you've got it figured out!

shukrallah
08-23-2003, 05:20 PM
Well, that was a test.. sort of.

my current WIP: JKII MOVIE FOR SP (http://lucasforums.com/showthread.php?threadid=104576)

Ill be using this though, when i get to the ground fight :D I hope to have pt. 2 completly finished by tonight, and upload it... then ill do some major work on what i started on in pt. 1

shot of my test: (i just threw in a bunch of lights, so its too light in some places...)


http://www.angelfire.com/games5/lukeskywalker215/terrain.jpg

then when i finally finish this movie, ill finish this with the easygen terrain. It was a clan map, but the clan... lets say it failed... so i stopped working on the map (also FPS problems) the rocks looked nice (i never finished, but there was too much z-fighting) then i used patches for hills, and just had whole lot of detail, atsts, atpts, ships, storage rooms, the logo all over the place


http://www.angelfire.com/games5/lukeskywalker215/map5.jpg

http://www.angelfire.com/games5/lukeskywalker215/map6.jpg

http://www.angelfire.com/games5/lukeskywalker215/map3.jpg


anyways, im ganna remake it... it will be awesome.. then with the JA scripting in mp, im ganna have a tie fighter flying around the map (looped)

Eldritch
08-23-2003, 07:00 PM
Please just be sure to use sunlight for the outdoor areas instead of light entities... the spots look really unnatural.

Not bad otherwise, though.

shukrallah
08-24-2003, 12:12 AM
yeah it was a rush job.. took like 30 seconds, just kept hitting space and moving the mouse (i really wanted to see if it worked :D ) uhh.. how do you use sunlight?

71M
11-03-2003, 03:40 PM
You apply a specific command in the skybox's shader script, and then q3map will calculate and apply the sunlight while it compiles your map.

I just quickly found a page that talks about it in more detail. It's for Q3, but there is virtually no difference between the two. :)

http://www.planetquake.com/lordsquart/Tutorials/_english/basic/tutorial10/main.htm

-TiM

shukrallah
11-03-2003, 07:33 PM
Yeah, i got it now using the entites stuff (_sun 1)

BTW, is there anyway to increse the size of the terrain area? I just want to know, because the size it gives isnt big enough for me....

<EJK>DevMapAll
01-14-2004, 01:19 AM
Just use an image bigger than 33X33 for your heightmap, that's what I did.

Also, I am having trouble. I have everything, the easygen file, the .shader in the right place, but when I load up Radiant (I'm using GTKRadiant 1.4.0) and try to load my .map, it says 'Cannot find active shader: textures/common/terrain (or something close to that) then freezes up. Any idea?

seks03
01-14-2004, 02:59 AM
sorry but what is everyone so excited about? the images are not coming up. Does anyone have them?

shukrallah
01-14-2004, 01:41 PM
lol, this thread is old, so most of the images are gone...

Also, I am having trouble. I have everything, the easygen file, the .shader in the right place, but when I load up Radiant (I'm using GTKRadiant 1.4.0) and try to load my .map, it says 'Cannot find active shader: textures/common/terrain (or something close to that) then freezes up. Any idea?

I think the shader came with GTK... Im not sure though.. try to reinstall gtk or something.


check this site, it has pics of something he did with easy gen..

http://digilander.libero.it/ilbanca/files_easygen.htm?

<EJK>DevMapAll
01-14-2004, 11:30 PM
Reinstalled...no help there...

Do you have the common/terrain texture? Can you send me the image and the common.shader? Is there somewhere to download the 'common/terrain' texture?

<EJK>DevMapAll
01-19-2004, 01:11 AM
Hate to double post, but the EXACT line from radiant that includes the error is:

WARNING: Activate shader failed for textures/common/terrain

Also, I suppose showing everyone what I changed in my .shader might help

It's gone from this:
textures/ejkterrain/terrain_0
{
surfaceparm nolightmap
q3map_novertexshadows
q3map_forcesunlight
{
map textures/yavin/jung8.jpg
rgbGen vertex
tcmod scale 1.000 1.000
}
}

textures/ejkterrain/terrain_1
{
surfaceparm nolightmap
q3map_novertexshadows
q3map_forcesunlight
{
map textures/yavin/rockwall.jpg
rgbGen vertex
tcmod scale 1.000 1.000
}
}

textures/ejkterrain/terrain_2
{
surfaceparm nolightmap
q3map_novertexshadows
q3map_forcesunlight
{
map textures/korriban/os_outsidebasef.jpg
rgbGen vertex
tcmod scale 1.000 1.000
}
}

textures/ejkterrain/terrain_0to1
{
surfaceparm nolightmap
q3map_novertexshadows
q3map_forcesunlight
{
map textures/yavin/jung8.jpg
rgbGen vertex
alphaGen vertex
tcmod scale 1.000 1.000
}
{
map textures/yavin/rockwall.jpg
rgbGen vertex
alphaGen vertex
tcmod scale 1.000 1.000
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
}

textures/ejkterrain/terrain_0to2
{
surfaceparm nolightmap
q3map_novertexshadows
q3map_forcesunlight
{
map textures/yavin/jung8.jpg
rgbGen vertex
alphaGen vertex
tcmod scale 1.000 1.000
}
{
map textures/korriban/os_outsidebasef.jpg
rgbGen vertex
alphaGen vertex
tcmod scale 1.000 1.000
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
}

textures/ejkterrain/terrain_1to2
{
surfaceparm nolightmap
q3map_novertexshadows
q3map_forcesunlight
{
map textures/yavin/rockwall.jpg
rgbGen vertex
alphaGen vertex
tcmod scale 1.000 1.000
}
{
map textures/korriban/os_outsidebasef.jpg
rgbGen vertex
alphaGen vertex
tcmod scale 1.000 1.000
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
}

textures/ejkterrain/terrain.vertex
{
surfaceparm nolightmap
q3map_novertexshadows
q3map_forcesunlight
{
map textures/yavin/jung8.jpg
rgbGen vertex
tcmod scale 1.000 1.000
}
}


To this (self-edited):
textures/ejkterrain/baseterrain
{
q3map_lightmapsamplesize 8
q3map_lightmapsampleoffset 8
q3map_lightmapaxis z
}

textures/ejkterrain/terrain_0
{
q3map_baseshader textures/ejkterrain/baseterrain
{
map textures/yavin/jung8.jpg
rgbGen identity
tcMod scale 0.1 0.1
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbGen identity
}

}

textures/ejkterrain/terrain_1
{
q3map_baseshader textures/ejkterrain/baseterrain
{
map textures/yavin/rockwall.jpg
rgbGen identity
tcMod scale 0.1 0.1
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbGen identity
}
}

textures/ejkterrain/terrain_2
{
q3map_baseshader textures/ejkterrain/baseterrain
{
map textures/korriban/os_outsidebasef.jpg
rgbGen identity
tcMod scale 0.1 0.1
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbGen identity
}
}

textures/ejkterrain/terrain_0to1
{
q3map_baseshader textures/ejkterrain/baseterrain

{
map textures/yavin/jung8.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.1 0.1

}
{
map textures/yavin/rockwall.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.05 0.05
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbGen identity
}
}

textures/ejkterrain/terrain_0to2
{
q3map_baseshader textures/ejkterrain/baseterrain

{
map textures/yavin/jung8.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.1 0.1

}
{
map textures/korriban/os_outsidebasef.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.05 0.05
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbGen identity
}
}

textures/ejkterrain/terrain_1to2
{
q3map_baseshader textures/ejkterrain/baseterrain

{
map textures/yavin/rockwall.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.1 0.1

}
{
map textures/korriban/os_outsidebasef.jpg
rgbGen identity
alphaGen vertex
tcmod scale 0.05 0.05
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
}
{
map $lightmap
blendFunc GL_DST_COLOR GL_ZERO
tcGen lightmap
rgbGen identity
}
}

textures/ejkterrain/terrain.vertex
{
{
map textures/yavin/jung8.jpg
rgbGen vertex
}
}

textures/common/terrain
{
q3map_terrain
surfaceparm nodraw
surfaceparm nolightmap
surfaceparm nomarks
}


Any help is appreciated.



[EDIT]Hmm....it loaded in radiant, but no textures...all of the surface is the 'missing shader' texture...

rgoer
01-20-2004, 04:26 AM
I assume you are the dude that emailed me about this? Radiant will never show the true textures for terrain--that's just not the way the Team Arena terrain system works. The terrain entity (really just a func_group) is textured with one texture ("common/terrain")... the compiler does the rest based on your terrain blending .shader definitions and the .pcx alphamap (both of which are defined in the key/value pairs of said terrain entity). You will never see a "true" representation of your terrain's shader blending in the editor, the most you will get is whatever image you defined in common/terrain's qer_editorimage line. If the red and black "shader not found" checkerboard bugs you, feel free to use whatever image you want for qer_editorimage; otherwise, don't sweat it, because it don't mean a damned thing.

lauser
01-20-2004, 07:07 AM
Well well...aren't we the professor of mapping. Good to see your ugly mug on the forums man. I don't usually come here much anymore. But I might stop in from time to time. Great tutorials as always rgoer. If anyone should be working for RAVENSOFT or even ID........:D