mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
lightmaprenderer: removing minOf()
This commit is contained in:
@@ -71,7 +71,7 @@ internal object LightmapHDRMap : Disposable {
|
||||
1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,
|
||||
1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,
|
||||
1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,
|
||||
1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f // isn't it beautiful?
|
||||
1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f,1.0000f, 1f // isn't it beautiful?
|
||||
)
|
||||
|
||||
val ptr = UnsafeHelper.allocate(4L * THE_LUT.size)
|
||||
|
||||
@@ -734,7 +734,7 @@ object LightmapRenderer {
|
||||
// input: 0..1 for int 0..1023
|
||||
private fun hdr(intensity: Float): Float {
|
||||
val intervalStart = (intensity * CHANNEL_MAX).floorInt()
|
||||
val intervalEnd = minOf(LightmapHDRMap.lastIndex, (intensity * CHANNEL_MAX).floorInt() + 1)
|
||||
val intervalEnd = (intensity * CHANNEL_MAX).floorInt() + 1
|
||||
|
||||
if (intervalStart == intervalEnd) return LightmapHDRMap[intervalStart]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user