Jump to content

Terrain textures issues


You are about to reply to a thread that has been inactive for 4171 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I'm going to assume that it's because the systems expects terrain textures at a specific size and in a specific format; namely 512x512 TGA with no transparency (24bit, not 32) as per this wiki article

if you mean terrain height fields, then the requirements are different, and a bit more involved (and seem to be contradictory in a few places) but seem to be 13 channel .raw files with the red green and blue channels  controlling height, height-mulitpier, and water level. unfortunately my paint program of preference can't open the sample file (it only allows 4 channels) but you may have better luck by reading the wiki article yourself

  • Like 1
Link to comment
Share on other sites

After reading Tips for Creating Heightfields and Details on Terrain RAW Files more questions pops up.

"Historically, all 13 channels of the RAW files were used in the terraforming process. This number has since been reduced to 3 terraforming channels. Despite this, it is still necessary to create and save the RAW file with 13 channels!"

Does it mean that 3 channels are created with care and the rest - 10 channels may be anything else e.g. alpha?

Here's how the 3 useful channels in the raw file are defined:

Channel 1(red) 0-255 Height Field 2(green) 0-255 Height Multiply Factor 3(blue) 0-255 Water Height of sim in Meters Notes on Channels Channel 1(red) is the raw terrain heightfield data. In its simplest form it represents the ground height in meters of every point on the map, where black (grey level 0) is 0 meters high and white (grey level 255) is 255 meters high. However, the height of the terrain is often modified further by values in channel 2.

Channel 2 (green) is a grayscale map that is used as a multiplier to scale the data in channel 1, resulting in the final height of each point on the map. The formula used to combine the 2 channels is: original height (channel 1) * multiplier (channel 2) / 128. A few examples will help to illustrate their interaction. 32 -- Divides pixel values by 4. The resultant elevations will be 32 / 128 = 1/4 of the original 64 -- Divides pixel values by 2. The resultant elevations will be 64 / 128 = 1/2 of the original 128 -- No effect : 128 /128 = 1 times the original. 255 -- Multiplies pixel values by 2. The resultant elevations will be twice that of the original : 255 /128 is about 2.

The hight is finally a mixture of channel 1 and 2? The channel 2 is only multipler and have only one color? 

Channel 3 (blue) is a gray value that sets the water height of the sim in meters. A sim can only have one water height, so fill the entire channel with one value. The default water level found in Second Life is 20 meters. This is the level of all "void" water, as well as the water level on the vast majority of existing sims. The water level can be set to other values on a per sim basis, but this should only be done in special cases, since it leaves a noticeable vertical gap between sims whose visible water edges abut but are not at the same level. The water channel is not affected by the multiply channel, so the maximum height of water is 255.

That seems to be understood. Just one color for channel 3, which shows water level. 

Link to comment
Share on other sites


Identity Euler wrote:

Does it mean that 3 channels are created with care and the rest - 10 channels may be anything else e.g. alpha?

I *think* so.


The hight is finally a mixture of channel 1 and 2? The channel 2 is only multipler and have only one color?


AFAIK, the multiplier channel is per pixel, so it doesn't HAVE to be a single color (but I think it's better if it's one of the defined values for each pixel, it's treat as if the multiplier channel is a numerator, over a denominator of 128). the finel height per pixel is R*(B/128) in meters


That seems to be understood. Just one color for channel 3, which shows water level. 

yup, and I'd strongly recommend leaving it at 20 unless you have a special reason not to. if an attached region uses that height, the water can seem to be at the wrong height for surrounding regions (it doesn't happen as much or as badly now as it used to, but it is still a problem sometimes.

 

unfortunately I can't give for sure answer to those questions as I can create one myslef or open the sample... if you can open the sample and separate the channels you should be able to see exactly what is expected

Link to comment
Share on other sites

Maybe it will be easier to describe the channels having a look at  video. The sample file can be seen here:

 The questions is about channel green. In this file there is only one color applied to this channel. There is no scale.

"Channel 2 (green) is a grayscale map that is used as a multiplier to scale the data in channel 1, resulting in the final height of each point on the map. The formula used to combine the 2 channels is: original height (channel 1) * multiplier (channel 2) / 128. A few examples will help to illustrate their interaction.
32 -- Divides pixel values by 4. The resultant elevations will be 32 / 128 = 1/4 of the original
64 -- Divides pixel values by 2. The resultant elevations will be 64 / 128 = 1/2 of the original
128 -- No effect : 128 /128 = 1 times the original.
255 -- Multiplies pixel values by 2. The resultant elevations will be twice that of the original : 255 /128 is about 2."

Does it mean that there is usually used 32, 64, 128, 255 to adjust the height from red channel?

One can notice that the other 10 channels are different so they were useful. Can they still improve the quality of the texture or it doesn't matter any more what is there?

Link to comment
Share on other sites

it's probably easier to set the green channel to just a flat value (the whole layer) of 128, the other 10 channels should probably be set to a flat value of 0 (black) as well (IIRC they used to control default parcel divisions, permissions, and terrain modify limits, but all that is overriden in the land and estate tools inworld now).

so your channels would be:

  1. greycale values [0, 255] (this is terrain height, 1px == 1sqm)
  2. greyscale value 128
  3. greyscale value 20
  4. greyscale value 0
  5. greyscale value 0
  6. greyscale value 0
  7. greyscale value 0
  8. greyscale value 0
  9. greyscale value 0
  10. greyscale value 0
  11. greyscale value 0
  12. greyscale value 0
  13. greyscale value 0

save as raw, 256*256, bitdepth 8, channels13, no header, interleaved.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4171 days.

Please take a moment to consider if this thread is worth bumping.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...