Jump to content
Sign in to follow this  
hdchristopher

Is this really what our mask should look like?

Recommended Posts

This is the mask from Stratis I rejoined from the paa files,

image.jpg

is this how detailed our masks are suppose to be? It doesnt make any sense to me

Share this post


Link to post
Share on other sites

Well, it doesn't have to be but the more it matches the 'textures' on your satellite image, the better the transition will be when you get up close in a helicopter for example.

I'm not entirely sure on this next bit but the reason why you see the blue being cut off in a square is probably because of the limit of 3 textures per terrain grid cell.

What's the part that doesn't make sense to you?

Share this post


Link to post
Share on other sites

Well for one thing, I thought black was used at zero sea level and the airport is covered in black?

Also all of the green and reds that are where the ocean is located, is that suppose to represent the ocean floor?

I understand the colors on the island itself, it is mostly the design outside the edges that look wierd to me.

Share this post


Link to post
Share on other sites

This is my mask and layer content. I have 4 paa files fo the mask.

I dont understand the size difference and all the black around the bottom and right side.

image.jpg

My mask is 20480 x 20480

My Grid is 4096 x 5

My sat image is 20480 resolution 10.0000 {had to go with 10.000 instead of 1.000 because of overlapping issues}

Surface tile is 2048 with 16px overlap

Texture layer is 40 x 40

Edited by hdchristopher

Share this post


Link to post
Share on other sites

Ah, I get your confusion. Your own colours are converted to RGB + Black when you're generating the mask layer. Like Schultzit pointed out, if you were to stitch the processed .paas together, you'd end up with a similiar 'art' piece.

Scroll down to Engine Notes here:

https://community.bistudio.com/wiki/Layered_Terrain_Surface_Representation

It mentions the RGB + Black there and there's either another page on the wiki explicitly mentioning the conversion of your own designated colours. I may have read that last bit in a tutorial, not sure but anyway, that's what happens.

- edit

Where do you get that second image from?

And I took a closer look at the Stratis ones, it seems they used some sort of noise to create a backgroundlayer. Then they just painted over that in PS probably.

About the black, have you tried going to those places on the map? I want to bet there's either a runway on them or structures that cover up the whole ground layer. They probably just didn't bother painting over them.

Edited by BadLuckBurt

Share this post


Link to post
Share on other sites

thanks for the link, I will read up on that. as for the second image,it's a side by side comparison of

my mask created in L3DT and the paa files stitched together from the layers folder of my island.

Interestly, the entire island is in only the first M_ paa. the rest the M_ paa's are black.

the M named paa files are the mask, the N named are the normal map and the S named are the sat image.

Share this post


Link to post
Share on other sites

Thanks. I though so but the black area seemed weird to me. There's probably a reason for it being there though. In the one that you stitched together from the PAA, the area of the real map is still the same amount of pixels as your original right?

- edit

It could be that the normal map tiles are stuffed in that black area when the engine loads everything but that is just me guessing while being very high :P

Share this post


Link to post
Share on other sites
It could be that the normal map tiles are stuffed in that black area when the engine loads

I tried it without the normal map and it still created the black tiles.

Share this post


Link to post
Share on other sites

Hi guys....

is this how detailed our masks are suppose to be? It doesnt make any sense to me

Yes - the mask should be a 1:1 pixel-by-pixel recreation of your satellite image, but in a limited number of "simple colours", each of which represents a "surface type" as depicted on the "realworld" sat image.

the reason why you see the blue being cut off in a square is probably because of the limit of 3 textures per terrain grid cell.

It's 4, 5 or 6 colours - per texture grid... could be as many as 12 actual colours/surfaces on the original mask. For example, the Arma 2 CWR2 "Everon" terrain has 14 different ground surfaces in use, and therefore used a 14 colour mask - and that was back in the days when only 4 colours were allowed - per texture grid.

I thought black was used at zero sea level and the airport is covered in black?

Also all of the green and reds that are where the ocean is located, is that suppose to represent the ocean floor?

They're "recoloured" at the tile-slicing Generating Layers stage - as someone mentioned above.

However - they're "recoloured on a tile-by-tile basis" which is why each tile looks different from the one next to it.

This is basically why you can't simply stitch the mask for a terrain back together in the way you could with the Sat image layer.

Just to complicate matters further - think for a moment... the mask visibly seems to consist of tiles coloured Red, Green, Blue & Black - that's 4 colours - but 6 colours are allowed "per tile" - where are the other two?

Lets look at a quick example to see what's actually going on...

Lets say you have a mask with Seven different surfaces - using 7 colours. The colours you use on the mask are irrelevant - as long as they're clear to you what's what, you can use anything you like, you just need to make sure you have the RGB values for each colour listed in your Layers.cfg file - one colour for each surface.

In that layers.cfg you've listed these surfaces

Ocean Floor = Blue

Beach Sand = Yellow

Ocean Rock = Cyan

Green Grass = Green

Dry Grass = Brown

Rock = Red

Urban Gravel = Magenta

Now - that's 7 surfaces/7 colours - only a maximum of 6 are allowed per texture grid, so we need to be careful and make sure that in any particular texture grid sized area, there's no more than 6 happening at once.

Best way to do that is to make a grid in Photoshop the size of your texture grids and overlay it on the mask - then count the colours in each "cell". (remember the overlap!)

**See above for BadLuckBart's reference link to the BI Wiki where this stuff IS explained in reasonably understandable terms.

Okay. So - you have your Layers.cfg & mask (assume a sat image and everything else is in place), you choose to "use 6 colours" at the Generate Layers stage and start the tile crunching process...

First thing TB does is to slice your mask into terrain grid-sized chunks - allowing for the overlap you chose. (Overlap is important for tiling transitions, but 16px is usually enough & is "standard" - using more can result in performance loss since bigger overlaps mean more tiles required to cover the same area = more data to load, etc).

Now it looks at the first mask tile - it looks at the very first pixel of that tile, finds that it's "Blue", so it goes to Layers.cfg and looks down the list of your surfaces - looking for that 0,0,255 RGB value. It finds it labelled as "Ocean Floor" - SO IT RECOLOURS THAT PIXEL BLACK AND MOVES ON TO THE NEXT PIXEL

(Actually, there's simultaneous tomfoolery going on with matching rvmats and the routine actually likes to work in "texture layer-sized" chunks - usually about 40x40m, but lets just focus on the colours thing here)

Notice the "recolours the pixel to Black" thing there... Regardless of what colours you actually used on the original mask image - the layers-generating routine will recolour each pixel it encounters in the following order...

Black, Red, Green, Blue - plus TWO Alpha Channel "intensities" = 6 colours maximum (32bit image)

So far - it's assigned one pixel - it was "Ocean Floor" and since it was the first pixel, the first of TB's "internal colours" - Black - was assigned to that pixel...

FOR THE REST OF THIS TILE - OCEAN FLOOR THEREFORE = BLACK

Next pixel it looks at is Cyan on your mask - so off it goes to your layers.cfg list again...

It looks at the list - the first item is Ocean Floor and Blue - so that's not it - next on the list is Beach Sand - that's assigned to Yellow so that's not it either.

Then it finds the third item on your list - Ocean Rock! Ocean Rock is assigned to Cyan, so TB RECOLOURS THAT PIXEL RED AND MOVES ON TO THE NEXT PIXEL

It was a very small rock area, so next, TB finds a whole load of "Ocean Floor/Blue" pixels on your mask - it's assigned Black to that surface already so it just colours them all black and moves on again...

Eventually, you get to the spot on your mask where you're nearing the island itself... The next pixel TB checks out is Yellow - that's a new one, so off to the layers.cfg list once more and - starting from the top of your list every time - it tracks down till it finds Yellow = Beach Sand, then - it colours that pixel GREEN on your mask tile...

... etc, etc, etc - until the entire tile is done...

Now lets look at another tile - in towards the centre of the island.... TB starts the same routine all over again for each tile, so...

First pixel = Green... Layers.cfg says Green = Green Grass, so TB recolours that pixel Black, and moves on to the next...

We'll stop right there 'cause I hope you've spotted what's going on by now...

In the first tile we looked at - once TB had recoloured it, Ocean Floor = Black... In this tile, we're only one pixel in and Black is now Green Grass!

TB basically treats each tile individually and recolours the pixels it encounters according to that little list of its own - always in the order - Black, Red, Green, Blue and, if necessary, Alpha grey 1, Alpha grey 2

Just to complicate matters, it also uses the list of surface types & matching colours in your layers.cfg in the same way - reading down the list, in order, from the top.

That means its perfectly possible to have two mask tiles side-by-side, and "Green Grass" is Black in one of them, but it's Red in the next tile because, just by chance, the very first pixel to be checked in that second tile was "Beach Sand", so IT got assigned to Black, which means that when Green Grass was subsequently recoloured, it used TB's "next available colour"...

By now you've also probably spotted that in TB, if you choose to use a "Normals" sat layer, then it means checking the "5 COLOURS + Normals" box - you lose one of those two "Alpha channel intensities", and it's "slot" is taken up by the normals layer for 32bit pixelshader processing or some other complicated graphics thingy which we don't really need to understand.

Actually - there's no need to delve too deeply into what TB gets up to when it's tile slicing either - most of the time. As long as you follow the basic rule of "No more than 4 (or 5 or 6) colours per <whatever your terrain grid size in mask pixels is>" - you remember to allow for the overlap between tiles - and count colours-per-tile carefully via a visual grid or something while making your mask - you should be able to squeeze in a few additional "spot effect textures" here and there.

B

Edited by Bushlurker
  • Like 1

Share this post


Link to post
Share on other sites

Awesome explanation Bushlurker :) It may have been one of your tutorials where I first read about it actually.

I thought the normal map always limited you to using 3 regular textures + normal map but apparently you get use 5? :yay:

I have one question if I may, you mentioned: Black, Red, Green, Blue - plus TWO Alpha Channel "intensities" = 6 colours maximum (32bit image)

Does that mean you paint the two shades of grey you want to use in the Alpha mask of your image and reference those colours values in layers.cfg?

Share this post


Link to post
Share on other sites
I have one question if I may, you mentioned: Black, Red, Green, Blue - plus TWO Alpha Channel "intensities" = 6 colours maximum (32bit image)

Does that mean you paint the two shades of grey you want to use in the Alpha mask of your image and reference those colours values in layers.cfg?

It basically uses what would be the alpha channel to carry those two other bits of information for the final two colours (or one colour plus normal data) and you don't have to do any messing around at all.

Back in the old 4-colour Visitor 3 days, the Extremely Clever Mondkalb figured out all of this stuff which happens "under the hood" and managed to do what you suggest - "post-edited" a 4 colour tile or two to use an extra couple of colours. At that time BI were using TerrainBuilder - and so Chernarus, etc had 6 colours here and there (and about 12 surfaces overall, using the "colour counting per grid tile) trick above).

We didn't have TB back then - now we do, so all you have to do is use those 6 colours (per area) on your standard RGB mask - TB does all the crazy stuff for you.

B

Share this post


Link to post
Share on other sites

Thank you very much. I think I got the full picture now. The 6 regular colours on my own mask image are converted to RGB + Black and the two remaining colours (one colour when you're also using the normal map) are saved in the alpha channel of the PAAs that are generated.

Share this post


Link to post
Share on other sites

Yup...

If you really really want to, you can take a peek at a tile that TB has made - load the .paa into TexView and save it as a .tga. Then when you load it into Photoshop you'll find it's a 4-channel, 32bit RGBA image and, if there was a 5th or 6th colour happening in that tile, you should see shading in the Alpha channel...

The clue is in the "suffix" - "_lca" - it follows BI's naming convention...

_co = "Colour image" = straight RGB 24 bit image

_ca = "Colour Alpha" = RGBA 32 bit image with an alpha channel

and the "l" just stands for land - so if you see a mask tile which ends in "_lca" then its a "six colour" tile

No need to mess with any of that really though - just use regular colours on your standard "mask_lco" and TB will do the complicated stuff for you at the tile crunching stage...

B

Share this post


Link to post
Share on other sites

Is there any possibility someone could drum up a terrain grid template we could overlay onto our masks images. Or are they not generic?? In other words it depends on the size of the terrain?? this would really help if someone could then deciding what how many textures are in a grid wouldn't be such a head f***!

Edited by SpookyGnu

Share this post


Link to post
Share on other sites

A terrain grid template would not be feasible as the grid size may vary from project to project.

To make a grid on your own you just have to consider the sizes specified under "Satellite/Surface (mask) tiles" taking into account both the values of Size (px) and Desired Overlap (px).

Let’s say you have a Size (px) of 1024 and a Desired Overlap (px) of 16 (never change this from 16 as bigger values will give you poor performance while lower ones may lead to see through holes in your terrain).

You should then draw a grid with tiles of 1024x1024 keeping in mind that once you will count the colours included in each tile you will have to consider the overlap value of 16. This means that you will have to expand the tile of 16px on each side, giving you a new tile width and height of 16+1024+16 = 1056x1056. In this final tile of 1056x1056 you will have to be sure you have no more of 4, 5 or 6 colours.

Take a look at this link where they explain everything in a bit more detail.

Share this post


Link to post
Share on other sites

Appreciate your response to my post, but I got some help with doing one already. which works great and I've already got up to eight textures on my map. looking to increase that now I understand what I had to do and what I did.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×