Author Topic: Efficient terrain  (Read 2682 times)

seeeker

  • Posts: 122
  • Turrets: +19/-5
Efficient terrain
« on: February 16, 2008, 11:42:09 pm »
Is there a way to make a terrain (or a model like an asc) have levels of detail? pretty much like the cylinders or meshes that you can make with GTKRadiant. Im trying to make the terrain have a higher lod (level of detail, more triangles in this case) when close to player, and very low lod in the distance (an open area).
After compiling map and devmapping, I see lod changing for curve meshes, not the terrain no matter what i do x_x.
Has anybody tried to do this? done something similar? know anything?
I could also be missing some compiler parameters (using -meta only so far)

Quote
from ydmar:

Using terrain is more efficient because the brush faces are meshed together into a nice nonplanar surface. Using -shadeangle 180 in the light phase just shades the lightmaps based on interpolated normals, but each face is still a distinct surface.

You might have noticed the vertex & surface r_speeds in Twinlakes jump significantly...

The best way to do nonplanar mesh stuff w/o terrain is to make a shader with these two directives:

q3map_nonplanar
q3map_shadeangle 120 // or 90, 160, etc. higher values may cause errors

Note that you can apply normal Q3Map2 terrain shaders directly to brush faces--the q3map_tcGen ivector stuff works in any shader. This keeps the texture coordinates aligned so the meta meshing is as efficient as possible.
That makes me think it should be possible >_>, taken from here


my shader applied to surface of terrain
Code: [Select]
textures/dryout/rockground_phng_s
{
q3map_nonplanar
q3map_shadeangle 120
qer_editorimage textures/dryout/rockground.jpg
{
map $lightmap
rgbGen identity
}
{
map textures/dryout/rockground.jpg
blendFunc filter
}
}


shader applied to rest of terrain (unseen surfaces)
Code: [Select]
textures/dryout/misc_caulk_s
{
qer_editorimage textures/dryout/editorimage/caulk.tga
surfaceparm nodraw
surfaceparm nolightmap
surfaceparm nomarks
qer_trans 0.5
}

anyone please help!  =P
thanks =D

Odin

  • Spam Killer
  • *
  • Posts: 1767
  • Turrets: +113/-204
    • My Website
Re: Efficient terrain
« Reply #1 on: February 16, 2008, 11:55:29 pm »
I know patch meshes do this automatically, but normal brush planes can't have this at all. I wouldn't worry about polycount on terrain. However, if you want to optimize triangles for terrain, use q3map_nonPlanar to instruct q3map2 to merge triangles adjacent to each other. Or, more specifically, try using q3map_terrain on your shaders to enable all this at once:
Code: [Select]
       q3map_tcGen ivector ( 32 0 0 ) ( 0 32 0 )
      q3map_lightmapAxis z
      q3map_nonplanar
      q3map_shadeAngle 180
      q3map_indexed

Kaleo

  • Posts: 2098
  • Turrets: +176/-220
    • KaleoDesign
Re: Efficient terrain
« Reply #2 on: February 17, 2008, 07:56:02 am »
You would probably be better off with less detailed terrain. Just apply phong shading to the texture, and it'll look fine.
Quote from: Stannum
Thou canst not kill that which doth not live,
but you can blow it into chunky kibbles!
I has a cookie, and u can has a cookie, but i no givs u mai cookie...

Taiyo.uk

  • Posts: 2309
  • Turrets: +222/-191
    • Haos Redro
Re: Efficient terrain
« Reply #3 on: February 17, 2008, 12:56:23 pm »
LoD on brush geometry is not possible. Efficiency (in terms of number of triangles vs visual effect) in brushwork terrain has more to do with being able to select an appropriate brush size for the desired effect. Patchwork terrains all look like smooth blobs and will require brushwork playerclipping to avoid building and clipping bugs. Simon OC's terrain tutorials may help here. You might like to download the .map to his pyramid of the magician map and study the techniques used there.

blood2.0

  • Guest
Re: Efficient terrain
« Reply #4 on: February 22, 2008, 03:21:04 am »
he is right. the way i do it is make 6 different maps of different terrain then save them and import them into my main map. this saves a lot of time and helps to eliminate the hassle of recreating it again. oh and btw to delete or change texture press shift click just in case you didn't know cuz i didn't for a wile.