본문 바로가기

Google 지도 사용 라이센스/야간 텍스쳐 마스크 설정.

ko.konene 발행일 : 2012-01-25
반응형

사진 이미지

Google 지도를 통해 제공되는 사진 이미지는 사용자만이 이용할 수 있는 독점적이고 양도가 불가능한 라이센스 계약에 따라 제공됩니다. 이미지를 상업적 또는 비즈니스 환경에서 사용할 수 없으며 사용자 및 제 3자를 위한 어떠한 상업적 또는 비즈니스 목적으로도 이용할 수 없습니다.

사용자는 전체 또는 부분적으로 이미지를 복사, 역엔지니어링, 디컴파일, 분리, 변환, 수정 또는 파생물을 생성할 수 없습니다. 이미지 전체 또는 일부를 임대, 공개, 게시, 판매, 할당, 대여, 재라이센스, 시장 거래 또는 양도할 수 없으며 계약서에 명시적으로 승인되지 않은 어떠한 방식으로도 사용할 수 없습니다.

Google 지도 사용에 따라 이미지 상의 어떤 소유권을 보유하게 되는 것은 아니며, 이러한 소유권은 Google 및 기타 라이센스 제공자(해당되는 경우)가 모두 보유합니다. 이미지는 저작권의 보호를 받으며 다른 데이터 또는 소프트웨어와 병합 또는 수정되더라도 복사할 수 없습니다.


야간 텍스쳐 마스크 설정.[http://www.fspassengers.com/forum/read.php?f=9&i=6835&t=6835]
well you need to set
UseCSharpScripts = Yes

in FSEarthMasks.ini to activate scripts. Then you can program in the script what every you like. It is C# code.
It becomes read in when FSEM is started and compiled at runtime. You don't need to do anything more than changes in the Script file.
They are active at once. (well with the next FSEM start)

Programming is simple. By intention I keept the most simple structure.
It's just a pixel color change routine that goes trough every pixel. pixel for pixel.

The grid is:

That gets the pixel count in X and Y of the texture (bitmap):

Int32 vPixelCountInX = iTexture.GetPixelCountInX();
Int32 vPixelCountInY = iTexture.GetPixelCountInY();

Two nested for Loops that count through all pixel (row after row)

for (Int32 vY = 0; vY < vPixelCountInY; vY++)
{
for (Int32 vX = 0; vX < vPixelCountInX; vX++)
{


That one gets the Red green and Blue Color information of the pixel at vX,vY in the texture:
iTexture.GetPixelRGB(vX, vY, ref vRed, ref vGreen, ref vBlue);

That one is optional but you can ask if the pixel is a water pixel. Might be you don't want to change the water color...
Boolean vIsWater = iTexture.IsWaterOrWaterTransition(vX, vY);

That one builds the sumof the Color compnents.
vSum = vRed + vGreen + vBlue;

From here on you do your color changes depending on the original color values. You can do anything you like.
//DO YOUR color changes

That one is importand and limit sthe color components to the allowed color component range of 0..255 (in your manipulation you can
happen to have higher values.. so you need to cut/limit them before writing them back into the pixel)

iTexture.LimitRGBValues(ref vRed, ref vGreen, ref vBlue);

that one writes the color information it back to the pixel at position vX,vY
iTexture.SetPixelRGB(vX, vY, vRed, vGreen, vBlue);

And here are the 2 brakets that mark the end of the 2 for loops
}
}


But before you start writing a new script maybe play with the Night parameters in the FSEarthMasks.ini first.
They can be used and are used in the default script to alter the color.

This 3 build the Street detection condition (streets = light)
NightStreetGreyConditionGreyToleranceValue = 11
NightStreetConditionRGBSumLessEqualThanValue = 510
NightStreetConditionRGBSumLargerThanValue = 0

That means it is a street if difference between each Color component (red, green,blue) is lessthan 11 and the summ of the color
components between 0 and 510 includeing 510.
(You need to check the script to understand it. )

Now you have 2 cases.

1. It is a street THAN:
NightStreetLightDots1DitherProbabily = 0.01
NightStreetLightDots2DitherProbabily = 0.02
NightStreetLightDots3DitherProbabily = 0.05

are the probability for inserting 3 special bright light-pixel (dots)
that have this colors:

(dot1 full white)
ightStreetLightDot1Red = 255
NightStreetLightDot1Green = 255
NightStreetLightDot1Blue = 255

dot2
NightStreetLightDot2Red = 255
NightStreetLightDot2Green = 200
NightStreetLightDot2Blue = 140

dot3
NightStreetLightDot3Red = 255
NightStreetLightDot3Green = 180
NightStreetLightDot3Blue = 80

if non of teh probability got hit..it just changes the street color by adding this values to its components:
(so if you want to make the street looks brighter you most porbabily should do changes here)
NightStreetRedAddition = 100
NightStreetGreenAddition = 50
NightStreetBlueAddition = -50

2. It is No Street THAN

this factor is applayed to all Color components. reducing their intensity to 33% (one third)
NightNonStreetLightness = 0.3

hope that helps you somehow.

Note that the night map creation result and the seasons in general will depend very much on the services and the region.
For one service and region it might produce good result for another bad or non.

Also note that the street detection by simple checkiong the color is no real street detection. mountains withrocks that are colored in the
same range will be recogniced as street and become lightened in the night. A real street detection is a very difficult thing. You need to
detect the shape for example or what is evern better you could use street maps from other source to decide what is a street and what not.

hope i could help you.
반응형

'게임 이야기 > FSX Scenery LAB' 카테고리의 다른 글

FSEearthTiles 가장 많이 이용하는 기능  (0) 2012.01.28
FSEarthTiles 생성파일 구조  (8) 2012.01.26
Earth Tiles Key  (0) 2012.01.26
water mask  (0) 2012.01.26
TUTORIAL FOR THE PHOTOREAL SCENERY CREATION  (0) 2012.01.25

댓글