mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +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>>
|
||||
*/
|
||||
|
||||
//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(scalar: Float) : this(FloatVector.scalars(SPECIES, scalar, scalar, scalar, scalar))
|
||||
constructor() : this(FloatVector.zero(SPECIES))
|
||||
|
||||
@@ -777,12 +777,8 @@ object LightmapRenderer {
|
||||
/** To eliminated visible edge on the gradient when 255/1023 is exceeded */
|
||||
internal fun Cvec.normaliseToHDR(): Cvec {
|
||||
// equation: hdr(this.coerceIn)
|
||||
return Cvec(
|
||||
hdr(this.vec.lane(0).coerceIn(0f, 1f)),
|
||||
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 arr = this.vec.toArray().map { hdr(it.coerceIn(0f, 1f)) }
|
||||
return Cvec(arr.toFloatArray())
|
||||
}
|
||||
|
||||
val histogram: Histogram
|
||||
|
||||
Reference in New Issue
Block a user