Skip to content

Commit

Permalink
add missing glsl files
Browse files Browse the repository at this point in the history
  • Loading branch information
gwaldron committed Feb 7, 2015
1 parent 6c6ff05 commit 87a9fff
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/osgEarthUtil/ContourMap.frag.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#version $GLSL_VERSION_STR
$GLSL_DEFAULT_PRECISION_FLOAT

#pragma vp_entryPoint "oe_contour_fragment"
#pragma vp_location "fragment_coloring"

uniform sampler1D oe_contour_xfer;
uniform float oe_contour_opacity;
varying float oe_contour_lookup;

void oe_contour_fragment( inout vec4 color )
{
vec4 texel = texture1D( oe_contour_xfer, oe_contour_lookup );
color.rgb = mix(color.rgb, texel.rgb, texel.a * oe_contour_opacity);
}
17 changes: 17 additions & 0 deletions src/osgEarthUtil/ContourMap.vert.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#version $GLSL_VERSION_STR
$GLSL_DEFAULT_PRECISION_FLOAT

#pragma vp_entryPoint "oe_contour_vertex"
#pragma vp_location "vertex_model"

attribute vec4 oe_terrain_attr;
uniform float oe_contour_min;
uniform float oe_contour_range;
varying float oe_contour_lookup;

void oe_contour_vertex(inout vec4 VertexModel)
{
float height = oe_terrain_attr[3];
float height_normalized = (height-oe_contour_min)/oe_contour_range;
oe_contour_lookup = clamp( height_normalized, 0.0, 1.0 );
}

0 comments on commit 87a9fff

Please sign in to comment.