Bump to OPENRNDR 0.3.43-rc.14
This commit is contained in:
@@ -445,7 +445,7 @@ class PBRMaterial : Material {
|
||||
if (rt is ProgramRenderTarget || materialContext.pass === DefaultPass || materialContext.pass === DefaultOpaquePass || materialContext.pass == DefaultTransparentPass) {
|
||||
this.output(it.targetOutput, ShadeStyleOutput(0))
|
||||
} else {
|
||||
val index = rt.colorBufferIndex(it.targetOutput)
|
||||
val index = rt.colorAttachmentIndexByName(it.targetOutput) ?: error("no such attachment ${it.targetOutput}")
|
||||
val type = rt.colorBuffer(index).type
|
||||
val format = rt.colorBuffer(0).format
|
||||
this.output(it.targetOutput, ShadeStyleOutput(index, format, type))
|
||||
@@ -521,7 +521,7 @@ class PBRMaterial : Material {
|
||||
|
||||
is SpotLight -> {
|
||||
shadeStyle.parameter("lightPosition$index", (node.worldTransform * Vector4.UNIT_W).xyz)
|
||||
shadeStyle.parameter("lightDirection$index", ((normalMatrix(node.worldTransform)) * light.direction).normalized)
|
||||
shadeStyle.parameter("lightDirection$index", ((normalMatrix(node.worldTransform)) * light.direction.xyz0).normalized.xyz)
|
||||
shadeStyle.parameter("lightConstantAttenuation$index", light.constantAttenuation)
|
||||
shadeStyle.parameter("lightLinearAttenuation$index", light.linearAttenuation)
|
||||
shadeStyle.parameter("lightQuadraticAttenuation$index", light.quadraticAttenuation)
|
||||
@@ -546,7 +546,7 @@ class PBRMaterial : Material {
|
||||
}
|
||||
is DirectionalLight -> {
|
||||
shadeStyle.parameter("lightPosition$index", (node.worldTransform * Vector4.UNIT_W).xyz)
|
||||
shadeStyle.parameter("lightDirection$index", ((normalMatrix(node.worldTransform)) * light.direction).normalized)
|
||||
shadeStyle.parameter("lightDirection$index", ((normalMatrix(node.worldTransform)) * light.direction.xyz0).normalized.xyz)
|
||||
if (light.shadows is Shadows.MappedShadows) {
|
||||
context.shadowMaps[light]?.let {
|
||||
val look = light.view(node)
|
||||
@@ -565,7 +565,7 @@ class PBRMaterial : Material {
|
||||
}
|
||||
|
||||
is HemisphereLight -> {
|
||||
shadeStyle.parameter("lightDirection$index", ((normalMatrix(node.worldTransform)) * light.direction).normalized)
|
||||
shadeStyle.parameter("lightDirection$index", ((normalMatrix(node.worldTransform)) * light.direction.xyz0).normalized.xyz)
|
||||
shadeStyle.parameter("lightUpColor$index", light.upColor)
|
||||
shadeStyle.parameter("lightDownColor$index", light.downColor)
|
||||
|
||||
|
||||
@@ -117,7 +117,8 @@ class SceneRenderer {
|
||||
outputPassTarget?.let { target ->
|
||||
pass.combiners.forEach {
|
||||
if (it is ColorBufferFacetCombiner) {
|
||||
val index = target.colorBufferIndex(it.targetOutput)
|
||||
val index = target.colorAttachmentIndexByName(it.targetOutput)
|
||||
?: error("no such attachment ${it.targetOutput}")
|
||||
target.blendMode(index, it.blendMode)
|
||||
}
|
||||
}
|
||||
@@ -128,7 +129,8 @@ class SceneRenderer {
|
||||
|
||||
outputPassTarget?.let { output ->
|
||||
for (combiner in pass.combiners) {
|
||||
buffers[combiner.targetOutput] = output.colorBuffer(combiner.targetOutput)
|
||||
buffers[combiner.targetOutput] = (output.colorAttachmentByName(combiner.targetOutput) as? ColorBufferAttachment)?.colorBuffer
|
||||
?: error("no such attachment: ${combiner.targetOutput}")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -226,9 +228,8 @@ class SceneRenderer {
|
||||
val nodeInverse = it.node.worldTransform.inversed
|
||||
|
||||
|
||||
|
||||
val jointTransforms = (skinnedMesh.joints zip skinnedMesh.inverseBindMatrices)
|
||||
.map{ (nodeInverse * it.first.worldTransform * it.second) }
|
||||
.map { (nodeInverse * it.first.worldTransform * it.second) }
|
||||
// val jointNormalTransforms = jointTransforms.map { Matrix44.IDENTITY }
|
||||
|
||||
val shadeStyle = primitive.material.generateShadeStyle(materialContext, primitiveContext)
|
||||
@@ -269,7 +270,7 @@ class SceneRenderer {
|
||||
.forEach {
|
||||
val primitive = it.content
|
||||
drawer.isolated {
|
||||
val primitiveContext = PrimitiveContext(true, false)
|
||||
val primitiveContext = PrimitiveContext(true, false)
|
||||
val shadeStyle = primitive.primitive.material.generateShadeStyle(materialContext, primitiveContext)
|
||||
shadeStyle.parameter("viewMatrixInverse", drawer.view.inversed)
|
||||
primitive.primitive.material.applyToShadeStyle(materialContext, shadeStyle)
|
||||
|
||||
Reference in New Issue
Block a user