Improve compatibility with GLES back-end

This commit is contained in:
Edwin Jakobs
2024-03-10 18:39:21 +01:00
parent b9b1b95ca0
commit e3f5e07b86
62 changed files with 182 additions and 195 deletions

View File

@@ -29,8 +29,8 @@ fun main() = application {
// sets angle and radius based on time and shape ID.
drawer.shadeStyle = shadeStyle {
vertexTransform = """
float a = c_instance + p_time * 0.1;
float r = 200 + 100 * sin(a * 0.998);
float a = float(c_instance) + p_time * 0.1;
float r = 200.0 + 100.0 * sin(a * 0.998);
x_position.x += r * sin(a);
x_position.y += r * cos(a);
""".trimIndent()

View File

@@ -1,15 +1,12 @@
import org.openrndr.application
import org.openrndr.draw.Cubemap
import org.openrndr.draw.DrawPrimitive
import org.openrndr.draw.Session
import org.openrndr.draw.shadeStyle
import org.openrndr.draw.*
import org.openrndr.extra.camera.Orbital
import org.openrndr.extra.meshgenerators.boxMesh
fun main() = application {
program {
val cubemap = Cubemap.fromUrl("file:demo-data/cubemaps/garage_iem.dds", null, session = Session.active)
val cubemap = loadCubemap("demo-data/cubemaps/garage_iem.dds", null, session = Session.active)
val cube = boxMesh()
extend(Orbital()) {

View File

@@ -5,7 +5,7 @@ import org.openrndr.extra.meshgenerators.boxMesh
fun main() = application {
program {
val cubemap1 = Cubemap.fromUrl("file:demo-data/cubemaps/garage_iem.dds", null, session = Session.active)
val cubemap1 = loadCubemap("demo-data/cubemaps/garage_iem.dds", null, session = Session.active)
val cube = boxMesh()
val cubemap2 = cubemap(cubemap1.width, format = cubemap1.format, type = cubemap1.type, levels = 2, session = Session.active)
cubemap1.copyTo(cubemap2, 0, 0)

View File

@@ -5,7 +5,7 @@ import org.openrndr.extra.meshgenerators.boxMesh
fun main() = application {
program {
val cubemap1 = Cubemap.fromUrl("file:demo-data/cubemaps/garage_iem.dds", null, session = Session.active)
val cubemap1 = loadCubemap("demo-data/cubemaps/garage_iem.dds", null, session = Session.active)
val cube = boxMesh()
val cubemap2 = cubemap(cubemap1.width, format = cubemap1.format, type = cubemap1.type, levels = 2, session = Session.active)
cubemap1.copyTo(cubemap2, 0, 0)