Jump to content

Home

Terrain


lauser

Recommended Posts

Terrain texture blending. What are the specs for that?

 

textures/endor/groundd

{

qer_editorimage textures/endor/groundd

surfaceparm nolightmap

q3map_novertexshadows

q3map_forcesunlight

q3map_material ShortGrass

cull twosided

{

map textures/endor/groundd

rgbGen vertex

alphaGen vertex

tcmod scale 0.167 0.167

}

}

 

Will this work? I made my own custom brushwork terrain and I want to know if this will blend the verts.

Link to comment
Share on other sites

Apparently there was some confusion about the alpha channels. As to whether you need them or not. But I think it makes sense to have them. So I'm going to try both jpgs and PNGs. Now they use PNGs that hold Alphas for JA. Maybe I should stick with TGA. I'm paranoid about shaders working properly.

 

The LINK Gothix gave me has other links in it to help out with terrain blending. Apparently they are trying to throw together NOOB tutorials for terrain blending. These methods are for custom terrains without using the old method of bitmaps and PCX files as far as I can tell. :)

 

Here are the files you need for terrain blending:

 

alphascale

 

Just put them in the appropriate folders.

 

 

GOTHIX, I'm not entirely sure but I think Q3map_surfaceModel is enabled still. It's just no one is using it that I'm aware of. So I emailed Ydnar just incase regarding that feature. I would like to experiment with this feature if I can get the shader correctly laid out.

 

q3map_surfaceModel modelpath density odds minscale maxscale minangle maxangle oriented

 

A surface with q3map_surfaceModel in its shader will randomly place a specified model across it's face. This is designed to place grass or tree models over terrain.

modelpath : The path to the model file (any supported format).

 

density : The density of the models, in game units.

 

odds : The odds of the model appearing (normalized?).

 

minscale : The minimum scale of the model from its original size of 1.0.

 

maxscale : The maximum scale of the model from its original size of 1.0.

 

minangle : The model's minimum angle of rotation.

 

maxangle : The model's maximum angle of rotation.

 

oriented : This is a flag, either 0 or 1, and sets whether the model gets fitted to the orientation of the surface.

 

Is this what we are looking for:

 

textures/endor/groundd

{

qer_editorimage textures/endor/groundd

q3map_surfaceModel models/map_objects/endor/tree 800 2 1.4 2.6 0 270 1

surfaceparm nolightmap

q3map_novertexshadows

 

{

map textures/endor/groundd

}

}

 

Anyone? Does this look like it will work? I guess I can do a TEST map and see if it works.

Link to comment
Share on other sites

I just got a reply back from Ydnar. He says the function works. WOOT! This should make mapping much easier if let's say you want a scene with lots of detail on the terrain. He did not say anything about performance loss. He did say that he only recommends using small items as the CLIP feature for this is buggy.

Link to comment
Share on other sites

It's like anything else Luke. Just takes practice and a little patience. I have a hard time with shaders too. But if you read the shader manual it helps. Have a look at other shaders and see what they do also helps.

Link to comment
Share on other sites

 

Here are the files you need for terrain blending:

 

alphascale

 

Just put them in the appropriate folders.

 

 

 

Ok, I DLed it, and I assume the shader goes in the shaders folder, and not the script folder? Also, Ive added it to my shaderlist.txt file, and put the textures in textures/common/alpha.... etc. This should work right?

 

I think I get it... :)

Link to comment
Share on other sites

Aye, but texture blending is not on that one hand. Im going to keep trying, and if I cant get it, ill post back here.

 

EDIT: OK

 

I made 2 shaders for 2 textures. Here are the textures:

 

textures/compress/rock.jpg

textures/compressgrass1.jpg

 

Here are the 2 shaders:

 

shaders/rock_blend

shaders/ground1

 

Rock_Blend.shader

 

textures/compress/rock_blend
{ 
  qer_editorimage textures/compress/rock

  q3map_forceMeta 
     q3map_nonplanar 
     q3map_shadeAngle 179 
  surfaceparm nolightmap
  { 
     map textures/compress/rock
          rgbGen identity 
  } 
  { 
     map textures/compress/rock
     blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA             
           rgbGen identity 
           alphaGen vertex 
     } 
     { 
           map $lightmap 
           blendFunc GL_DST_COLOR GL_ZERO 
           rgbGen identity 
     } 
}

 

grass1.shader

textures/compress/grass1
{ 
  qer_editorimage textures/compress/ground

      q3map_forceMeta 
      q3map_nonplanar 
      q3map_shadeAngle 179 
  surfaceparm nolightmap
  { 
     map textures/compress/ground
          rgbGen identity 
  }    
     { 
           map $lightmap 
           blendFunc GL_DST_COLOR GL_ZERO 
           rgbGen identity 
     } 
}

 

In radiant I took rock.jpg and put it on a square in the middle of a room. All around the square was covered with grass1.jpg. In radiant they had the white thing around it, so I know it was a shader. I put the alpha 0 (or something) in the rock.jpg square. I made those two into a func_group, and all of it was detail.

 

 

radiant_blend.JPG

 

:-/ Anyways, looks like a normal map inside JA.

Link to comment
Share on other sites

So Luke, the blending did NOT occur ingame? You just had normal textures without any blending?

 

Okay try making the ALPHA brush much smaller. You don't need it that high, just for neatness purposes. And make sure that alpha brush is level at the bottom with all the other brushes. Try extending the Alpha beyond the vertices of the large brush encompassing the verts of the smaller brushes and post back here.

 

Did you use Q3map2 2.5.14? You need the latest compiler to make it work. Actually 2.5.15 is the latest I believe but I use the latter....works just fine.

 

Also your shader needs work. Look at the examples in the tutorials. Your textures need to be TGAs with a white alpha channel also. You need AlphaBlend to blend the layers so that part of your texture will actually be see through. Understand? If you can see through a portion of the texture that is the illusion of blending.

Link to comment
Share on other sites

Eh, Lauser, you're wrong. Alphamod blending is based on vertexpoints, so dropping the alpha_0 brush in the middle of a plane isn't going to work. Also, if you'd put it at all 4 points, it wouldnt work, since you're then marking the whole surface as a 0% fade. Cut the brush up into four brushes using an X-shape, and use the alpha_0 brush in the middle, surrounding the center vertex.

Link to comment
Share on other sites

Hmm..that makes more sense now Gothix. If I have a hill with 3 different textures at different heights, I'll assume I just have to manipulate multiple brushes to get the fade effect. Because I never got the whole trisouping thing. I'll assume trisouping is making a brush into 4 triangles...or...what I do is just vertex edit and then I have 2 different triangular surfaces but one brush. I will assume this will still work. If not then I have to cut up the brushes where I want the terrain to blend.

Link to comment
Share on other sites

hmmm, ok... 4 brushes, yeah, in the tutorial that dude had 4 brushes for his blend area.

 

About the channel thing. You mean that my texture will need something like a layer on it.. ? You know like with photoshop (I use gimp) to add transperency, and other layers?

 

Or are you talking about the actual alpha shader (that 0%) thing?

Link to comment
Share on other sites

PS can do it, add a new channel in the channels tab (bottom-right), and make it completely white, save it as a 32-bit TGA. (FYI: Each channel uses 8 bits, and you're using four channels: R, G, B, and an alpha channel. A 24-bit TGA will only use RGB channels)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...