Created
March 4, 2021 13:10
-
-
Save gwaldron/e60c7ce2b0eb1ebb7418249caaebb5ba to your computer and use it in GitHub Desktop.
Vertical scale shader for osgEarth 3.x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<terrainshader> | |
<code> | |
<![CDATA[ | |
#pragma version 330 | |
#pragma vp_location vertex_model | |
#pragma vp_entryPoint verticalScale | |
uniform float scale = 1.0; | |
vec3 vp_Normal; | |
float oe_terrain_getElevation(); | |
void verticalScale(inout vec4 vertex) | |
{ | |
float elev = oe_terrain_getElevation(); | |
vec3 offset = vp_Normal * elev * (scale-1.0); | |
vertex.xyz += offset; | |
} | |
]]> | |
</code> | |
</terrainshader> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment