forked from gwaldron/osgearth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclouds.earth
35 lines (29 loc) · 1.04 KB
/
clouds.earth
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!--
osgEarth Sample - Rendering a cloud layer with a layer shader
-->
<map name="Imagery with clouds" type="geocentric">
<image name="readymap_imagery" driver="tms">
<url>http://readymap.org/readymap/tiles/1.0.0/7/</url>
</image>
<image name="clouds" driver="osg">
<url>../data/cloud_combined_2048.jpg</url>
<profile>global-geodetic</profile>
<shader>
<![CDATA[
#pragma vp_entryPoint raiseClouds
#pragma vp_location vertex_view
vec3 oe_UpVectorView;
const float cloudsAlt = 20000.0;
void raiseClouds(inout vec4 vv) {
vv.xyz += oe_UpVectorView*cloudsAlt;
}
[break]
#pragma vp_entryPoint alphaOut
#pragma vp_location fragment_coloring
void alphaOut(inout vec4 color) {
color.a *= clamp(distance(color.rgb, vec3(0.0,0.0,0.0)), 0.0, 1.0);
}
]]>
</shader>
</image>
</map>