commonMain.earth.worldwind.layer.ShowTessellationLayer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of worldwind-jvm Show documentation
Show all versions of worldwind-jvm Show documentation
The WorldWind Kotlin SDK (WWK) includes the library, examples and tutorials for building multiplatform 3D virtual globe applications for Android, Web and Java.
The newest version!
package earth.worldwind.layer
import earth.worldwind.draw.DrawableTessellation
import earth.worldwind.render.Color
import earth.worldwind.render.RenderContext
import earth.worldwind.render.program.BasicShaderProgram
class ShowTessellationLayer: AbstractLayer("Terrain Tessellation") {
override var isPickEnabled = false
var color = Color()
set(value) {
field.copy(value)
}
override fun doRender(rc: RenderContext) {
if (rc.terrain.sector.isEmpty) return // no terrain to render
// Use WorldWind's basic GLSL program.
val program = rc.getShaderProgram { BasicShaderProgram() }
val pool = rc.getDrawablePool()
val drawable = DrawableTessellation.obtain(pool).set(program, color, opacity)
rc.offerSurfaceDrawable(drawable, 1.0 /*z-order after surface textures*/)
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy