Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2   Go Down

Author Topic: Water effects  (Read 6217 times)

0 Members and 1 Guest are viewing this topic.

tabbycat

  • member
  • Offline Offline
  • Posts: 44
Water effects
« on: February 13, 2012, 05:36:20 PM »

I've been struggling to understand exactly how water effects are controlled in map construction; so in order to get my head around it, I've spent the past two days experimenting. I created from scratch, a very small test map 640x384 pixels consisting of a simple rectangle to represent the land, bordered on two sides by ocean. I then created 512x512 tiles (filled with primary colours so that I could see exactly what was happening), which I assigned to the four water entries under the [FIELDS] category in the load.ini.

The following are my observations and findings from my testing:

Water0, Water1, Water2 & Water3 are simply texture slots and have no bearing on the representation or colour of water.

(Presumably the names are historical and were originally used for land textures that abutted actual water features, whether sea, rivers, lakes or reservoirs?)

The greyscale values that represent the above in map_T and their corresponding tile names in FMB are:

Water0 : greyscale 28 in map_T = WATER tile in FMB
Water1 : greyscale 29 in map_T
Water2 : greyscale 30 in map_T = CoastRiver tile in FMB
Water3 : greyscale 31 in map_T = CoastSea tile in FMB

Water1 appears to be an exception in that it has no corresponding tile name in FMB and so can only be applied by 'painting' the greyscale value directly onto map_T ... is there a way that a tile name could be assigned to this (e.g. CoastLake, perhaps), so that it could be used when 'painting' textures in FMB?

The only way to show actual water is via map_c - the base colour being defined by the entry under [WATER] in load.ini, being either the colour of a .tga file or a value given by:
WaterColorATI = R/255 G/255 B/255
WaterColorNV = R/255 G/255 B/255
- where R, G & B are the actual RGB colour values; so when each is divided by 255, they will give decimal values, e.g.
WaterColorATI = 0.596 0.501 0.439
WaterColorNV = 0.596 0.501 0.439
would be the decimal values corresponding to a muddy brown colour having approximate RGB 152,128,112

The saturation of the water colour relates to the water depth and is defined by the greyscale value in map_c. To evaluate the effects of this, I made a rectangular selection across my test sample of MYmap_c and filled it with a gradient-fill, from pure black to pure white. On loading the map into FMB, this showed that:

Deep water will have low colour saturation and a corresponding low greyscale value. As the greyscale value rises, the colour saturation increases, giving the appearance of increasingly shallow water. At a greyscale value of approximately 88, surf lines begin to appear, becoming progessively stronger to 140, then fading out at approximately 148, although some water texture effect remains visible up to around 168.

The length of the surf lines can be controlled by adjusting the steepness of the curve of greyscale values above 88, i.e. compressing the range of values will shorten the lines.

Any greyscale value in map_c below 127 will show as water, overriding any value in map_T, however for values between 128 and 168, any underlying texture in map_T will show through, which can lead to some interesting texture effects. Any  value above 168 in map_c, is treated as white and will be regarded as land.

I would really appreciate confirmation or correction of my conclusions above, from those more experienced and knowlegable in such matters.

Many thanks,

Terry
Logged

SAS~Malone

  • flying as #46 with the FAC
  • Editor
  • member
  • Offline Offline
  • Posts: 14562
  • proud member of that 'other' site
Re: Water effects
« Reply #1 on: February 13, 2012, 10:11:52 PM »

nice one, Terry. :D  i think this subject has been touched on before, but nowhere near as well explained as yours.
much appreciated by many, i'm sure. cheers!
Logged
.....taking fun seriously since 1968.....  8)

farang65

  • never two weeks two decades
  • SAS Team
  • member
  • Offline Offline
  • Posts: 2787
  • Fortress Formosa
Re: Water effects
« Reply #2 on: February 14, 2012, 06:21:39 PM »

Hi Terry,

There has always been intrigue into water ocean/river colours on a map.
A few people have looked into it.

I''m interested in this as I'd like to make Northern Borneo rivers a brown colour while oceans blue.

This would give alot of natural qualities to a map.

I believe  one person looked at using rgb 90 on Mymap_c to change the colour of rivers and  shallow bays etc.

I'll check around for the threads later.

Kirby
Logged

mandrill

  • Modder
  • member
  • Offline Offline
  • Posts: 785
Re: Water effects
« Reply #3 on: February 15, 2012, 07:00:13 AM »

Tabbycat, much of what you wrote is the given knowledge re water values. However, you have added some extra info of your own re surf lines and the overlap between land and water extending all the way up to 168.

Normally, I have drawn in lakes and rivers in 0 on 255 "land" in my map C and then blurred the outlying parts of the lakes and all the width of the rivers to get shallows and variations in the depth effect.
Logged

SAS~Tom2

  • SAS Honourable Member
  • member
  • Offline Offline
  • Posts: 7954
  • no sweat
Re: Water effects
« Reply #4 on: February 15, 2012, 07:10:39 AM »

Hi Terry,

There has always been intrigue into water ocean/river colours on a map.
A few people have looked into it.

I''m interested in this as I'd like to make Northern Borneo rivers a brown colour while oceans blue.

This would give alot of natural qualities to a map.

I believe  one person looked at using rgb 90 on Mymap_c to change the colour of rivers and  shallow bays etc.

I'll check around for the threads later.

Kirby

Interisting info by tabbycat..not that I pretend to understand all ;). :)

Farang65: Managing different colours for different section of water areas e.g. rivers and sea would rock. :) I tried to get more info on the South Vietnam area and what I found was that the ocean colour is often lighter blue or greenish while the rivers look brownish, yellowish or even red.
Playing with the water NVidia and Ati settings is fun. Can anyone explain why many maps have different entries for Ati and NVidia water, often red around 0.010 and blue around 0.030-0.060 higher values at the minimum? Is there a default equation?

E.g.: redko's desert repaint..

[WATER]
Water    = water/PacificWater.tga
WaterColorATI = 0.140 0.195 0.230
//WaterColorATI = 0.150 0.225 0.180
WaterColorNV  = 0.140 0.205 0.268
//WaterColorNV  = 0.165 0.264 0.233



Edit, sorry for misspell of your name, tabbycat..!
Logged

tabbycat

  • member
  • Offline Offline
  • Posts: 44
Re: Water effects
« Reply #5 on: February 15, 2012, 08:08:45 AM »

Can anyone explain why many maps have different entries for Ati and NVidia water, often red around 0.010 and blue around 0.030-0.060 higher values at the minimum? Is there a default equation?

I believe that this is because ATI (now AMD) and Nvidia cards render certain colours slightly differently; so to get exactly the same colour displayed for users of either card will require different values. I have no knowledge of a formula to convert from one to the other, unfortunately. On the other hand, I think that to be able to see any difference, you would need to view the same RGB value produced by both brands of video card on the same monitor - somewhat impractical for most of us ;)

For practical purposes, I strongly suspect that the minor difference is irrelevant, as the type of monitor used, monitor setup and its corresponding ICC profile will have far more effect on colour display than the brand of video card.

As a keen amateur photographer, I do a lot of photo editing work in Lightroom and Photoshop; so both of my monitors are fully calibrated using SpyderPro hardware and ColourEyes DisplayPro software - even so, because the monitors are different brands, there is still a slight difference between the two that I have been unable to resolve. It follows that the colours that I see on my screens will most likely be noticably different to those seen by others using different monitors, especially if using the default Windows ICC profile.

What is boils down to, is that only those using colour-calibrated display systems will see (approximately) the same colour for any given RGB value, everyone else will be seeing variations of that colour; so IMHO, variations of a few hundredths of a decimal point in colour values defined in IL-2 are not going to be that critical  :)

Terry
Logged

SAS~Tom2

  • SAS Honourable Member
  • member
  • Offline Offline
  • Posts: 7954
  • no sweat
Re: Water effects
« Reply #6 on: February 15, 2012, 09:01:41 AM »

That is a great response, Terry! :)
I also have my CRT monitor, which I somehow prefer over the flatscreens I checked at home, calibrated to my temperature and colour likings. Plus with graphics drivers, at least Ati and surely also NVidia, I fumbled around with colour temperature values.
I assume you are right and getting the correct value for the graphics card manufacturer not ran by the map artist is more guessing than applying probably.

BTW I visited Devon twice, Plymouth and the dartmoor of course and loved it. Yet TBH my favourite town in the general area was Newquay in Cornwall. It was summer and the city, the beach, the (IIRC) gulf course, the surfers-magic :D.

Thorsten


Sorry for my typos today, hangover from hardwork
Logged

Avala

  • Modder
  • member
  • Offline Offline
  • Posts: 370
Re: Water effects
« Reply #7 on: February 26, 2012, 08:33:03 PM »

Hi Terry,

There has always been intrigue into water ocean/river colours on a map.
A few people have looked into it.

I''m interested in this as I'd like to make Northern Borneo rivers a brown colour while oceans blue.

This would give alot of natural qualities to a map.

I believe  one person looked at using rgb 90 on Mymap_c to change the colour of rivers and  shallow bays etc.

I'll check around for the threads later.

Kirby

Late reply, but this can be done. You set rivers like rgb 90 on Map_C (or even less, depend on how much visibility you want). Make texture in, let's say, brown tones. Paint rgb value for Water2 (thats shallow water, used for corals) on your Map_T on the places where you river are. Then set water in the load.ini file in some nice oceanic blue.

The result will be blue for ocean, and mix of blue and brown for rivers. Because water2 shows texture through the water. And it even need not to be some real texture, plain brown color is enough, just to add tint to the water.

BTW, water in load.ini file can go to 999, for example:

[WATER]
Water    = water/PacificWater.tga
WaterColorATI = 0.000 0.700 0.999
//WaterColorATI = 0.100 0.175 0.230
WaterColorATI = 0.000 0.700 0.999
//WaterColorNV  = 0.100 0.185 0.268

If you don't want water to be any brown or purple, avoid red.
Logged

slipper

  • Modder
  • member
  • Offline Offline
  • Posts: 920
Re: Water effects
« Reply #8 on: April 13, 2012, 07:17:21 AM »

Terry,

Great post above explaining how water is controlled in game mate. I have a question however, following your advice above i have been trying to place surf on a map i am editing, but i am having no luck at all, is there any trick to it please?

I created three similar rectangles on  my map_c and filled them with a gradient fill, i also painted each rectangle with a texture in unlocked_FMB corresponding to water=0, water=2 and water=3.

however when i load the game, i see three rectangles with water and land, but no surf at the waters edge? I even tested to make sure the greyscales were between 88 and 140.

Any ideas please?

regards

slipper
Logged

tabbycat

  • member
  • Offline Offline
  • Posts: 44
Re: Water effects
« Reply #9 on: April 13, 2012, 07:40:44 AM »

@slipper ~ I'll have a dig around and see if I've still got my original test files - if I have, I'll post up some examples, along with the relevent values used, which may help you. Won't be 'till tomorrow though, as I'm going out shortly.

Cheers

Terry
Logged

slipper

  • Modder
  • member
  • Offline Offline
  • Posts: 920
Re: Water effects
« Reply #10 on: April 13, 2012, 08:04:06 AM »

Thanks alot Terry, much appreciated.

regards

slipper
Logged

slipper

  • Modder
  • member
  • Offline Offline
  • Posts: 920
Re: Water effects
« Reply #11 on: April 13, 2012, 01:47:09 PM »

Thanks Boomer,

for all the info above mate. With your help and others i have been making some good progress, i have read most of the posts on water i could find, but even following them i cannot seem to get surf showing.

As i have said before i am editing an existing map, so the map_c was not made by myself and as i am learning i do not really know if it is all set up ok for surf.

Funnily enough your last post above seems to describe what i am getting with no surf at the coast (where i want it), but surf on the rivers (where i do not want it), so i might look at that more closely.

thanks again

slipper
Logged
Pages: [1] 2   Go Up
 

Page created in 0.036 seconds with 25 queries.