Closed YHLpuyu closed 1 month ago
There is a built-in function called oe_terrain_getElevation
you can call to get the height like so:
float oe_terrain_getElevation(in vec2 uv);
in vec4 oe_layer_tilec;
void oe_contour_fragment(inout vec4 color)
{
float height = oe_terrain_getElevation(oe_layer_tilec.st);
...
}
thanks , i read the contourmap.glsl, and enable get height. But i want draw contour line above terrain tile, both see the imagery on the earth.
i use step
,mod
in FS shader only draw slice of contour, the backgorund is white, if i don't set some color. i wish the background can contains imagelayer like tmsimagelayer
. there is a screenshot in cesium, red line is contour line, background is texture of imagery
is there a texture of terrain tile?
Then you should put the shader on the imagery layer.
<TMSImage name="ReadyMap 15m Imagery">
<url>https://readymap.org/readymap/tiles/1.0.0/7/</url>
<shader>
<![CDATA[
#pragma vp_function contour_line fragment
in vec4 oe_layer_tilec;
float oe_terrain_getElevation(in vec2 uv);
void contour_line(inout vec4 color) {
float height = oe_terrain_getElevation(oe_layer_tilec.st);
color = mix(color, vec4(1,0,0,1), step(mod(height, 100.0), 1.0));
}
]]>
</shader>
</TMSImage>
Thank you very much for your help.
Thank you very much for your help.
I want draw contour line instead of the all surface, so is there a way i can get imagery in FS, and just draw contour line. like below: