project-navigation
Personal tools

Author Topic: materialsystem: terrain  (Read 2899 times)

Offline Kildor

  • Project Artist
  • Captain
  • ***
  • Posts: 757
  • Project mapper and some other stuff`er
    • View Profile
    • http://ufoai.nx0.ru
materialsystem: terrain
« on: March 10, 2011, 07:29:43 am »
Hello. Is it possible to make reverse terrain?

Quote
terrain ceil floor
Terrain directives are used to achieve simple height-based terrain blending. The ceil and floor parameters specify the highest and lowest Z-axis coordinates where blending will occur. At Z coordinates less than floor, the base material texture will appear; at Z coordinates greater than ceil, the stage texture will appear. Linear interpolation is used to blend the two textures at Z coordinates between ceil and floor. Both parameters are required, and must be floating point numbers.

It is nice feature, but sometimes the better way to terrain in revers order (if Z less than floor, use stage texture).  For example, if we have one middle texture and want to blent it on top and bottom of the texture, we need to use lower stage as base (ugly), or use 3 material entry, like
{
   material tex_nature/sand
   {
      texture tex_nature/dirt002
      terrain -10 0
      lightmap
   }
   {
      texture tex_nature/sand
      terrain 3 20
      lightmap
   }
   {
      texture tex_nature/hedge001
      terrain 55 62
      lightmap
   }
}

proposed command: reverse_terrain, with the same syntax. Or add custom parameter to current terrain.

Or, may be there is some other ways to resolve this request (blend base texture with 2 stages, first upper and second lower than defined heights.

Offline Sandro

  • Squad Leader
  • ****
  • Posts: 240
  • Maintenance guy for UFO:AI 3D engine
    • View Profile
Re: materialsystem: terrain
« Reply #1 on: March 13, 2011, 03:53:48 pm »
Hello. Is it possible to make reverse terrain?

It is nice feature, but sometimes the better way to terrain in revers order (if Z less than floor, use stage texture). 

Could be done, either by a new stage type, or by allowing ceil<floor for the terrain stage.

For example, if we have one middle texture and want to blent it on top and bottom of the texture,

Do you aware of tape stage? Looks like it does what you want, but in reverse order.

PS: Each stage is a new rendering pass, so it slows the game.

Offline Kildor

  • Project Artist
  • Captain
  • ***
  • Posts: 757
  • Project mapper and some other stuff`er
    • View Profile
    • http://ufoai.nx0.ru
Re: materialsystem: terrain
« Reply #2 on: March 13, 2011, 04:48:27 pm »
> PS: Each stage is a new rendering pass, so it slows the game.
Sure. But what are we able to pay for beauty?
http://imagebin.org/142562 — there are two terrain stage.