mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 12:04:06 +09:00
minor improvement
This commit is contained in:
@@ -28,7 +28,7 @@ This time I removed the TypeProfileLevel part. It now runs slightly faster than
|
|||||||
<<append from here>>
|
<<append from here>>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//constructor(floatArray: FloatArray) : this(FloatVector.fromArray(SPECIES, floatArray, 0))
|
constructor(floatArray: FloatArray) : this(FloatVector.fromArray(SPECIES, floatArray, 0))
|
||||||
constructor(r: Float, g: Float, b: Float, a: Float) : this(FloatVector.scalars(SPECIES, r, g, b, a))
|
constructor(r: Float, g: Float, b: Float, a: Float) : this(FloatVector.scalars(SPECIES, r, g, b, a))
|
||||||
constructor(scalar: Float) : this(FloatVector.scalars(SPECIES, scalar, scalar, scalar, scalar))
|
constructor(scalar: Float) : this(FloatVector.scalars(SPECIES, scalar, scalar, scalar, scalar))
|
||||||
constructor() : this(FloatVector.zero(SPECIES))
|
constructor() : this(FloatVector.zero(SPECIES))
|
||||||
|
|||||||
@@ -777,12 +777,8 @@ object LightmapRenderer {
|
|||||||
/** To eliminated visible edge on the gradient when 255/1023 is exceeded */
|
/** To eliminated visible edge on the gradient when 255/1023 is exceeded */
|
||||||
internal fun Cvec.normaliseToHDR(): Cvec {
|
internal fun Cvec.normaliseToHDR(): Cvec {
|
||||||
// equation: hdr(this.coerceIn)
|
// equation: hdr(this.coerceIn)
|
||||||
return Cvec(
|
val arr = this.vec.toArray().map { hdr(it.coerceIn(0f, 1f)) }
|
||||||
hdr(this.vec.lane(0).coerceIn(0f, 1f)),
|
return Cvec(arr.toFloatArray())
|
||||||
hdr(this.vec.lane(1).coerceIn(0f, 1f)),
|
|
||||||
hdr(this.vec.lane(2).coerceIn(0f, 1f)),
|
|
||||||
hdr(this.vec.lane(3).coerceIn(0f, 1f))
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val histogram: Histogram
|
val histogram: Histogram
|
||||||
|
|||||||
Reference in New Issue
Block a user