Use Shader to change vertical scale of terrain #2453
-
I am using osgEarth to implement terrain exaggeration for an elevation layer, which involves exaggerating the terrain in a specific area. I am aware that the addEffect interface of TerrainEngine can be used to dynamically adjust the scale, but I have found that using this approach exaggerates the entire terrain rather than a specific region. I have applied a C++ shader to the GDALElevationLayer, but it seems to have no effect. Is there another method to achieve my requirement? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Elevation layers do not support layer shaders. Only Image layers do. You would somehow need to restrict the region from another (image layer) shader. |
Beta Was this translation helpful? Give feedback.
-
Thank you so much! |
Beta Was this translation helpful? Give feedback.
-
@aiqibaobei 请问你说的“TerrainEngine 的 addEffect 接口可用于动态调整地形缩放的比例”,如何实现的?可以给我个实现代码的示例吗?感谢!我在使用osgEarth 3.5 |
Beta Was this translation helpful? Give feedback.
Elevation layers do not support layer shaders. Only Image layers do. You would somehow need to restrict the region from another (image layer) shader.