|
![](/i/fill.gif) |
Le 13/05/2012 15:41, Jörg 'Yadgar' Bleimann nous fit lire :
> Hi(gh)!
>
> With a new computer finally at hand, I wanted to upgrade my POVSolar
> (and, thus, also POVEarth) project, replacing the simple 2048 x 1024
> surface and clouds texture by a more sophisticated one. After adding
> separate textures for surface (i. e. land, sea and sea ice) and clouds
> (on a slightly larger sphere to make them float at 5 kms above the
> surface), I also want to add a "city lights" texture showing only up on
> the night side of Earth.
>
> To achieve this, I added the "city lights" image_map as a new texture
> layer beneath the daylight surface image_map - but to make it appear on
> the night side only, I'll also somehow have to add a gradient pattern
> for the alpha channel of the daylight surface texture. Unfortunately,
> the official manual is silent about this - it only contains notes on
> assigning alpha values to index colours or using the alpha channel
> provided with the image file...
>
> So, how can I add an alpha gradient to my daylight image_map?
>
gimp ?
Add a alpha canal, edit as convenient that layer, save as flattened png.
Now, the hard part is that excepted for equinoxe, the day vs night line
does not go through the poles and the projection used to make the map
does not help.
Equinox is easy: rectangular, full height. The edge on left & right
might be large enough for whatever needed gradient.
Post a reply to this message
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
Hi(gh)!
On 14.05.2012 12:41, Tek wrote:
>
> It's possible to add an alpha gradient to an image map like this:
>
> pigment {
> gradient y
> pigment_pattern {
> [0 image_map {<your image> }]
> [1 image_map {<your image> transmit all 1 }]
> }
> }
>
> So the gradient blends between opaque and transparent versions of the map.
I tried this, but got strangely distorted bitmaps with sharp boundaries
between day and night texture (see attached image). Also, what was meant
to be a rendering centered around North Pole turned out to show mostly
North America...
Here is my code:
#declare sc=1000;
#declare bodies = array [81][12]
{
{ 0, 696000, -1, -1, 7.25, 0,
0, 0, 0, 0.000009, 63.87, 286.125 },
// 0 - Sun
{ 57909100, 2439.7, -1, -1, 2.11, 7.005,
0.205630, 29.124, 48.331, 0.00059, 61.45, 281.01 },
// 1 - Mercury
{ 108208930, 6051.8, -1, -1, 177.36, 3.39471,
0.0068, 54.85229, 76.67069, 0.00019, 67.16, 272.76 }, //
2 - Venus
{ 149597887.5, 6378.14, 6378.14, 6356.8, 23.439281, 0,
0.016710219, 114.20783, -1, 0.0033528, 90, 90 }
// 3 - Earth
[...]
}
#declare east=1;
#if (east)
#declare Pos_Earth = bodies[3][0]*<sin(radians(0)), 0,
cos(radians(0))>; // eastern hemisphere in daylight
#else
#declare Pos_Earth = bodies[3][0]*<sin(radians(180)), 0,
cos(radians(180))>; // western hemisphere in daylight
#end
#macro SetAxis(dec, ras)
rotate <bodies[3][4]-(90-dec), 0, 0>
rotate <0, 90-ras, 0>
#end
#declare T_Earth_Night =
texture
{
pigment
{
image_map
{
png "solarsys/ev5826_land_ocean_ice_lights_8192.png"
map_type 1
interpolate 2
}
// scale <1, 1, 0.5>
}
finish
{
ambient 1
diffuse 0
}
}
#declare T_Earth_Day =
texture
{
pigment
{
image_map
{
png "solarsys/ev11612_land_ocean_ice_8192_POV.png"
map_type 1
interpolate 2
}
// scale <1, 1, 0.5>
}
finish { F_Standard_Planetary_Surface }
}
union
{
sphere // Earth, surface
{
0, 1
texture
{
gradient z
texture_map
{
[0 T_Earth_Day]
[0.45 T_Earth_Day]
[0.55 T_Earth_Night]
[1 T_Earth_Night]
}
scale 2
translate <0, 0, -1>
}
scale <bodies[3][1], bodies[3][2], bodies[3][3]>/sc
}
sphere // Earth, clouds
{
0, 1
texture
{
pigment
{
image_map
{
png "solarsys/cloud_combined_8192a_alpha.png"
map_type 1
interpolate 2
}
}
finish { F_Standard_Planetary_Surface }
}
scale <bodies[3][1]+5, bodies[3][2]+5, bodies[3][3]+4.983270985>/sc
}
rotate -y*clock
SetAxis(bodies[3][10], bodies[3][11])
translate Pos_Earth/sc
}
#declare long =0;
#declare lat=90; // North Pole
#declare long=-long-90; // adjusting longitude to PoV-Ray's
rotation system
#declare h=20000; // orbital height (unscaled kilometres)
#declare camPos = Pos_Earth + vrotate ((6378.14 + h) *
<sin(radians(long))*cos(radians(lat)), sin(radians(lat)),
cos(radians(long))*cos(radians(lat))>, <bodies[3][4], 0, 0>);
#declare camLook = Pos_Earth;
#declare camAng = 40;
camera
{
#if (cam = 5.8)
sky camSky
#end
location camPos/sc
look_at camLook/sc
angle camAng
}
// end of code
See you in Khyberspace!
Yadgar
Post a reply to this message
Attachments:
Download 'povsolar.png' (305 KB)
Preview of image 'povsolar.png'
![povsolar.png](/povray.binaries.images/attachment/%3C4fb145a1%40news.povray.org%3E/povsolar.png?preview=1)
|
![](/i/fill.gif) |