/usr/share/osgearth/maps/geomshader.earth is in osgearth-data 2.9.0+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | <!--
osgEarth Sample - Geometry Shader
This example shows how to inject a GLSL Geometry Shader into the Terrain
Rendering pipeline.
-->
<map name="readymap.org" type="geocentric">
<image name="readymap_imagery" driver="tms">
<url>http://readymap.org/readymap/tiles/1.0.0/7/</url>
</image>
<elevation name="readymap_elevation" driver="tms">
<url>http://readymap.org/readymap/tiles/1.0.0/116/</url>
</elevation>
<terrainshader>
<code><![CDATA[
#version 330
#pragma vp_entryPoint demo
#pragma vp_location geometry
layout(triangles) in;
layout(triangle_strip) out;
layout(max_vertices = 3) out;
// Internal helper functions:
void VP_LoadVertex(in int);
void VP_EmitModelVertex();
uniform float osg_FrameTime;
vec3 vp_Normal;
vec2 rotate(in vec2 p, in float angle)
{
return vec2(cos(angle)*p.x + sin(angle)*p.y,
cos(angle)*p.y - sin(angle)*p.x);
}
void demo()
{
float strength = mod(osg_FrameTime, 6.28);
// For each vertex in the input triangle:
for(int i=0; i < 3; ++i)
{
// Loads per-vertex data "i" into the stage globals:
VP_LoadVertex(i);
// Transform the vertex:
vec4 pos = gl_in[i].gl_Position;
pos.xy = rotate(pos.xy, strength);
gl_Position = pos;
// Copies stage globals to output and calls EmitVertex():
VP_EmitModelVertex();
}
EndPrimitive();
}
]]></code>
</terrainshader>
</map>
|