Reduce duplication in orx build scripts. (#240)

Co-authored-by: hamoid <abe@hamoid.com>
This commit is contained in:
Vechro
2022-06-19 09:06:16 +03:00
committed by GitHub
parent 88719292e9
commit 9f7a4899fa
74 changed files with 646 additions and 812 deletions

View File

@@ -598,6 +598,7 @@ class PBRMaterial : Material {
shadeStyle.parameter("textureNoise", noise128)
}
}
else -> {}
}
when (val source = texture.source) {
is Triplanar -> {
@@ -605,6 +606,7 @@ class PBRMaterial : Material {
shadeStyle.parameter("textureTriplanarScale$index", source.scale)
shadeStyle.parameter("textureTriplanarOffset$index", source.offset)
}
else -> {}
}
if (texture.target is TextureTarget.Height) {
val target = texture.target as TextureTarget.Height
@@ -691,6 +693,7 @@ class PBRMaterial : Material {
if (texture.target is TextureTarget.Height) {
when (val source = texture.source) {
is TextureFromColorBuffer -> shadeStyle.parameter("texture$index", source.texture)
else -> {}
}
when (val source = texture.source) {
is Triplanar -> {
@@ -698,6 +701,7 @@ class PBRMaterial : Material {
shadeStyle.parameter("textureTriplanarScale$index", source.scale)
shadeStyle.parameter("textureTriplanarOffset$index", source.offset)
}
else -> {}
}
val target = texture.target as TextureTarget.Height
shadeStyle.parameter("textureHeightScale$index", target.scale)

View File

@@ -107,6 +107,7 @@ class SceneRenderer {
blur.spread = 1.0
blur.apply(target.colorBuffer(0), target.colorBuffer(0))
}
else -> {}
}
}
}