lightmaprenderer: removing minOf()

This commit is contained in:
minjaesong
2019-12-05 10:34:52 +09:00
parent e4aa4d2b87
commit d3bf27e8db
2 changed files with 2 additions and 2 deletions

View File

@@ -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)

View File

@@ -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]