Forum: Carrara


Subject: Terrains and Shaders

evinrude opened this issue on May 02, 2008 · 8 posts


Patrick_210 posted Fri, 02 May 2008 at 3:17 PM

Terrains are a little funny when it come to shaders.  When you create a terrain, say in a large size scene, it will come in at 100% size and it will be positioned with the center of the height at  zero on the z axis. But, the elevation functions will start at the bottom of the terrain. Simply put,  a terrain that is 2,000 ft tall, will be at listed at 1,000 ft  on the Z axis with half above zero and half below zero. But the elevation shader  will treat the terrain as if  zero is at the bottom of the terrain. If you want to use the numeric positions on the z axis, then you must move up the terrain so that the Z position is the same as the Z height. In other words, a 2,000 ft tall terrain should be at 2,000 ft Z height position.  Now when you use the elevation functions, the numeric height will match the actual position. Important: the shader functions will treat the terrain as if it is always at this size and position. That means after you set your shader at these positions, it will look the same even though you stretch it  or move it.  So, you should create your terrain shader before you stretch it. This is the reason terrain shaders made for a medium size scene don't look right on a terrain created in a large size scene.

Short tute version:

  1. Create terrain, change Z position to be the same as Z height.
      Now the elevation numbers will correspond to actual heights to create the shader.

  2. The shader will stay the same now, even if you resize it or change the height position of the terrain. But, at least you will have a relative frame of reference if you want to tweak the shader afterward.