osgearth
osgearth copied to clipboard
Problems encountered using Vertical Scale?
Hello, when using VerticalScale, when the coefficient becomes larger, the earth will be enlarged, and there will be a vacancy around it. May I ask how to solve this problem?
<terrainshader>
<uniform name="scale" value="20.0"/>
<code>
<![CDATA[
#pragma vp_entryPoint applyScale
#pragma vp_location vertex_view
uniform float scale;
vec4 oe_layer_tilec;
vec3 oe_UpVectorView;
float oe_terrain_getElevation(in vec2);
void applyScale(inout vec4 vertexView)
{
float e = oe_terrain_getElevation(oe_layer_tilec);
vertexView.xyz += oe_UpVectorView*e*(scale-1.0);
}
]]>
</code>
</terrainshader>
This happens because the view frustum is computed on the CPU from the original geometry. But then, you are moving the vertices on the GPU in a shader. The CPU has no knowledge of this so it connect account for the shader's changes. There is nothing to address this in OpenSceneGraph or osgEarth.