[orx-dnk3] Work-around problems with GLES back-end
This commit is contained in:
@@ -109,7 +109,7 @@ class ViewDepthFacet : ColorBufferFacetCombiner(setOf(FacetType.VIEW_POSITION),
|
|||||||
override fun generateShader(): String = "o_$targetOutput.r = v_viewPosition.z;"
|
override fun generateShader(): String = "o_$targetOutput.r = v_viewPosition.z;"
|
||||||
}
|
}
|
||||||
class ClipDepthFacet : ColorBufferFacetCombiner(setOf(FacetType.CLIP_POSITION), "clipDepth", ColorFormat.R, ColorType.FLOAT32) {
|
class ClipDepthFacet : ColorBufferFacetCombiner(setOf(FacetType.CLIP_POSITION), "clipDepth", ColorFormat.R, ColorType.FLOAT32) {
|
||||||
override fun generateShader(): String = "o_$targetOutput.r = gl_FragCoord.z;"
|
override fun generateShader(): String = "o_$targetOutput = gl_FragCoord.z;"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -644,7 +644,7 @@ class PBRMaterial : Material {
|
|||||||
light.projection(it) * look)
|
light.projection(it) * look)
|
||||||
|
|
||||||
if (light.shadows is Shadows.DepthMappedShadows) {
|
if (light.shadows is Shadows.DepthMappedShadows) {
|
||||||
shadeStyle.parameter("lightShadowMap$index", it.depthBuffer ?: TODO())
|
shadeStyle.parameter("lightShadowMap$index", it.depthBuffer?:error("no depth buffer for $it"))
|
||||||
}
|
}
|
||||||
|
|
||||||
if (light.shadows is Shadows.ColorMappedShadows) {
|
if (light.shadows is Shadows.ColorMappedShadows) {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ val IrradianceProbePass = RenderPass(listOf(DiffuseIrradianceFacet()))
|
|||||||
|
|
||||||
val DefaultOpaquePass = RenderPass(listOf(LDRColorFacet()), renderOpaque = true, renderTransparent = false)
|
val DefaultOpaquePass = RenderPass(listOf(LDRColorFacet()), renderOpaque = true, renderTransparent = false)
|
||||||
val DefaultTransparentPass = RenderPass(listOf(LDRColorFacet()), renderOpaque = false, renderTransparent = true, depthWrite = false)
|
val DefaultTransparentPass = RenderPass(listOf(LDRColorFacet()), renderOpaque = false, renderTransparent = true, depthWrite = false)
|
||||||
val LightPass = RenderPass(emptyList())
|
val LightPass = RenderPass(listOf(ClipDepthFacet()))
|
||||||
val VSMLightPass = RenderPass(listOf(MomentsFacet()))
|
val VSMLightPass = RenderPass(listOf(MomentsFacet()))
|
||||||
|
|
||||||
fun RenderPass.createPassTarget(width: Int, height: Int, depthFormat: DepthFormat = DepthFormat.DEPTH24, multisample: BufferMultisample = this.multisample): RenderTarget {
|
fun RenderPass.createPassTarget(width: Int, height: Int, depthFormat: DepthFormat = DepthFormat.DEPTH24, multisample: BufferMultisample = this.multisample): RenderTarget {
|
||||||
@@ -31,6 +31,10 @@ fun RenderPass.createPassTarget(width: Int, height: Int, depthFormat: DepthForma
|
|||||||
colorBuffer(combiner.targetOutput, combiner.format, combiner.type)
|
colorBuffer(combiner.targetOutput, combiner.format, combiner.type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Temporary fix for GLES back-end
|
||||||
|
if (combiners.isEmpty()) {
|
||||||
|
colorBuffer()
|
||||||
|
}
|
||||||
depthBuffer(depthFormat)
|
depthBuffer(depthFormat)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,8 +86,6 @@ class SceneRenderer {
|
|||||||
val mapSize = (shadowLight.shadows as Shadows.MappedShadows).mapSize
|
val mapSize = (shadowLight.shadows as Shadows.MappedShadows).mapSize
|
||||||
pass.createPassTarget(mapSize, mapSize, DepthFormat.DEPTH_STENCIL)
|
pass.createPassTarget(mapSize, mapSize, DepthFormat.DEPTH_STENCIL)
|
||||||
}
|
}
|
||||||
target.clearDepth(depth = 1.0)
|
|
||||||
|
|
||||||
val look = shadowLight.view(it.node)
|
val look = shadowLight.view(it.node)
|
||||||
val materialContext = MaterialContext(pass, context.lights, context.fogs, shadowLightTargets, emptyMap(), 0)
|
val materialContext = MaterialContext(pass, context.lights, context.fogs, shadowLightTargets, emptyMap(), 0)
|
||||||
drawer.isolatedWithTarget(target) {
|
drawer.isolatedWithTarget(target) {
|
||||||
|
|||||||
Reference in New Issue
Block a user