Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

UE4 Lightmass for Large Console Games (UE4 Lightmass Deep Dive)

5,370 views

Published on

Epic Games Japan hold a meeting named "Lightmass Deep Dive" on July 30, 2016.
Osamu Satio of Square Enix Osaka gave a presentation about their Lightmass Operation for Large Console Games. EGJ translated the slide for the presentation to English and published it.
There are some movies in the slide. So we recommend downloading this slide.

Published in: Engineering
  • Hello! High Quality And Affordable Essays For You. Starting at $4.99 per page - Check our website! https://vk.cc/82gJD2
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

UE4 Lightmass for Large Console Games (UE4 Lightmass Deep Dive)

  1. 1. Lightmass Operation for Large Console Games © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  2. 2. Osamu Saito SQUARE ENIX CO., LTD. Environment Designer Developing games full of hopes and dreams © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  3. 3. Large Console Game We encountered various issues in the following 3 areas © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  4. 4. Note: This is not a “Success Story” but rather a discussion of “ongoing” issues. Because our team is still struggling to solve these issues, our workflow may change in the future. If you know of better approaches or methods, Please let me know (right after this session). © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  5. 5. Let’s start with Game © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  6. 6. © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  7. 7. Recreation of a Lounge room © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  8. 8. Photo © 2016 SQUARE ENIX CO., LTD. All Rights Reserved. Unreal Engine4
  9. 9. PhotoDoes it seem like we got the lighting right? © 2016 SQUARE ENIX CO., LTD. All Rights Reserved. Unreal Engine4
  10. 10. Photo Bad Lighting © 2016 SQUARE ENIX CO., LTD. All Rights Reserved. Unreal Engine4
  11. 11. What’s the problem? © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  12. 12. Let’s add a moving object and you will see. © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  13. 13. © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  14. 14. What is the cause? ? © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  15. 15. PLV Precomputed Lighting Volume © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  16. 16. © 2016 SQUARE ENIX CO., LTD. All Rights Reserved. These black dots
  17. 17. PLV(Precomputed Lighting Volume) is indirect lighting data which is generated in the space when using Lightmass © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  18. 18. PLV is used to light dynamic objects. © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  19. 19. Errors in PLV cause strange Lighting © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  20. 20. Since most games use dynamic meshes You should pay attention to PLV when building lighting © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  21. 21. This is the cause of the lighting error in the previous slide © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  22. 22. This © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  23. 23. Our team’s solution © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  24. 24. Re-examine sampling method Re-examine lighting method © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  25. 25. Re-examine sampling method Re-examine lighting method © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  26. 26. We reproduced the lighting error with static lights © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  27. 27. Static Light and Emissive Light are the most likely causes of errors in PLV © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  28. 28. Static Light Direct light stored in PLV Emissive Light Very poor PLV accuracy © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  29. 29. Emissive Light Very poor PLV accuracy © 2016 SQUARE ENIX CO., LTD. All Rights Reserved. Static Light Direct light stored in PLV Therefore
  30. 30. Static Light Direct light stored in PLV Emissive Light Very poor PLV accuracy Our team decided to limit their usage © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  31. 31. We decided to prohibit the use of Both static light and Emissive light with dynamic meshes. © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  32. 32. This is unfortunate, But we have no choice © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  33. 33. Re-examine sampling method Re-examine lighting method © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  34. 34. ILCQ Settings © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  35. 35. What is ILC? © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  36. 36. ILC Indirect Lighting Cache Indirect lighting caches are created for each dynamic mesh by referencing the PLV © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  37. 37. Point Sampling: one point (center of bounding box) Volume Sampling: 5×5×5 grid (equal to bounding box size) ILCQ Indirect Lighting Cache Quality © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  38. 38. ILCQ Indirect Lighting Cache Quality © 2016 SQUARE ENIX CO., LTD. All Rights Reserved. Point Sampling: one point (center of bounding box) Volume Sampling: 5×5×5 grid (equal to bounding box size)
  39. 39. ILCQ set to “Point” causes errors © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  40. 40. But ILCQ set to “Volume” is ok © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  41. 41. © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  42. 42. As a result, draw cost goes up © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  43. 43. As PLV is referenced more, the draw cost increases so Be careful when using “Volume” for large, fast-moving objects! © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  44. 44. Let’s go back to the previous PLV error © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  45. 45. Static Light Stopped direct light from being stored in PLV (our customization) Emissive Light Improved PLV accuracy (From UE4.13 onwards, PLV uses Adaptive Sampling) © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  46. 46. Let’s move on to the next topic © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  47. 47. Console © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  48. 48. Console Development always involves strict limitations © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  49. 49. For example, Memory © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  50. 50. Texture pool of Unreal Engine is 1GB by default 1GB © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  51. 51. Equal to 4K texture x 50 sheets © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  52. 52. Out of this, how much memory can actually be used for lighting? © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  53. 53. 200 MB (1/5) About 10 4K sheets © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  54. 54. For this much area? © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  55. 55. No. For this much area! © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  56. 56. Our development team’s workaround © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  57. 57. Only “BLUE” is allowed for Lightmap Density © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  58. 58. How much resolution does Lightmap Density “BLUE” represent? © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  59. 59. 1m ≈ 5 pixels © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  60. 60. © 2016 SQUARE ENIX CO., LTD. All Rights Reserved. In extreme cases we allow “GREEN”
  61. 61. © 2016 SQUARE ENIX CO., LTD. All Rights Reserved. 1m ≈ 20 pixels
  62. 62. How about “RED”? © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  63. 63. No way! 1m ≈ 80 Pixels © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  64. 64. We ran into this... © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  65. 65. Completely red map was checked in due to incorrect settings © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  66. 66. 4GB in Lightmaps alone © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  67. 67. Too big to be stored in texture pool Failed to visualize due to error © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  68. 68. Overly large files caused server access errors © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  69. 69. This upset some people... © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  70. 70. If uploaded file size exceeds 1 GB, our system would send a warning e-mail 1GB © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  71. 71. So... © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  72. 72. What if we use “BLUE”? © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  73. 73. So many Lightmap errors © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  74. 74. Intersection errors / UV seam errors Padding errors / UV grid errors © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  75. 75. Creating appropriate Lightmap UVs helps to reduce errors © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  76. 76. We had to compromise to some extent © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  77. 77. Folige lightmap error © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  78. 78. Column Lightmap error Intersection error © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  79. 79. If you know of better solutions, please let us know. We welcome your advice or suggestions. © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  80. 80. © 2016 SQUARE ENIX CO., LTD. All Rights Reserved. One more difficult topic
  81. 81. Though we said 200MB for this scale... © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  82. 82. We actually need to reduce it more © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  83. 83. Assuming we have 30 maps at this size... © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  84. 84. Lightmaps alone are 200MB×30 = 6GB © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  85. 85. This accounts for more than 1/4 of a Blu-ray disk © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  86. 86. That’s too much © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  87. 87. Today’s last topc © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  88. 88. Large © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  89. 89. In my opinion, this is the most difficult issue © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  90. 90. Large project = A large number of people involved © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  91. 91. Large project = A large number of people involved = simultaneous work © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  92. 92. Large project = A large number of people involved = simultaneous work = Number of people working on lighting goes into double digits © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  93. 93. Various methods Different preferences © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  94. 94. For consistency, We needed a standard © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  95. 95. We chose “Illuminance-based Lighting” © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  96. 96. What is Illuminance? © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  97. 97. “In photometry, illuminance is the total luminous flux incident on a surface, per unit area. It is a measure of how much the incident light illuminates the surface, wavelength-weighted by the luminosity function to correlate with human brightness perception. Similarly, luminous emittance is the luminous flux per unit area emitted from a surface. Luminous emittance is also known as luminous exitance.” © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  98. 98. “In SI derived units these are measured in lux (lx) or lumens per square metre (cd·sr·m−2). In the CGS system, the unit of illuminance is the phot, which is equal to 10000 lux. The foot-candle is a non-metric unit of illuminance that is used in photography. Illuminance was formerly often called brightness, but this leads to confusion with other uses of the word, such as to mean luminance. "Brightness" should never be used for quantitative description, but only for nonquantitative references to physiological sensations and perceptions of light. The human eye is capable of seeing somewhat more than a 2 trillion- fold range: The presence of white objects is somewhat discernible under starlight, at 5×10−5 lux, while at the bright end, it is possible to read large text at 108 lux, or about 1000 times that of direct sunlight, although this can be very uncomfortable and cause long- lasting afterimages.” © 2016 SQUARE ENIX CO., LTD. All Rights Reserved. Excerpt from Wikipedia https://en.wikipedia.org/wiki/Illuminance
  99. 99. “It is an index literally for measure of how much the incident light illuminates the object and used to indicate brightness. If the lit object is not vertical to the ray as shown in right image, illuminance of the lit object decreases, so in order to interporate this. The difference between illuminance and light flux is how to consider the dimension of the lit object. For example, a book which is closer is darker than the book which is far away. This phenomane is reffere to as low illuminance. This is why lux is used to indicate how much the light illuminates the surface of a desk While candela is used as a unit for an electric light which is a light source. The brightness per unit perceived by eyes does not depend on distance but is directly proportional to illuminance of the object. However, the brightness per unit perceived by eyes attenuates as the object gets further if dimension is too small even for the object with same dimension and illuminance. © 2016 SQUARE ENIX CO., LTD. All Rights Reserved. Extraction form Wikipedia https: //ja.wikipedia.org/wiki/%E7%85%A7%E5%BA%A6
  100. 100. In other words, “Brightness” © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  101. 101. Illuminance is a unit of human “brightness perception” © 2016 SQUARE ENIX CO., LTD. All Rights Reserved. Sunny 100,000 Lux Cloudy 5,000 Lux Office 500 Lux Underground Parking 30 Lux Street light 5 Lux Moon light 0.1 Lux
  102. 102. Why use “Illuminance”? © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  103. 103. We were often asked: “What is the sun’s intensity in terms of a directional light?” © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  104. 104. .... I have no idea © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  105. 105. How could we find the answer to this? © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  106. 106. This brought us to “Illuminance” © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  107. 107. UE4 uses various intensity standards for the 4 respective light types Unknown value Unknown value Lumens Looks like lumens but actually unknown value © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  108. 108. “Illuminance” is not affected by the type of light source because it is a unit for received light © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  109. 109. Using “Illuminance”, the intensity of the sun can be calculated for either a Point light or Directional light © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  110. 110. Using “Illuminance” allows lighting in one standard regardless of light type or material © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  111. 111. Now let’s calculate the brightness of the sun in terms of Directional light intensity © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  112. 112. This part might be a bit boring but... © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  113. 113. First, create a perfectly diffuse surface by placing a plane with the following settings: BaseColor=1.0 Roughness=1.0 Metal=0.0 Specular=0.0 © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  114. 114. Then place a Point light 1m above the surface © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  115. 115. Increase intensity until the L value in HDRVisualize mode reaches 1.0 © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  116. 116. At this point, the Lumen value of the Point light is about 1966 lm 1966/4π ≈ 156.45lx L value of 1.0 is equal to illuminance of about 156 lx © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  117. 117. Next, place a Directional light pointing directly downwards © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  118. 118. We get an L value of 1.0 when the intensity is about 3.15 So a Directional light with intensity of 3.15 corresponds to Illluminance of about 156 lx © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  119. 119. Illuminance on a sunny day is 100,000 Lux © 2016 SQUARE ENIX CO., LTD. All Rights Reserved. Sunny 100,000 Lux Cloudy 5,000 Lux Office 500 Lux Underground Parking 30 Lux Street light 5 Lux Moon light 0.1 Lux
  120. 120. 100000/156*3.14 ≈ 2012.8 is the Illuminance value of a Directional Light for a sunny day © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  121. 121. 2012.8 © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  122. 122. Adjust Exposure as necessary © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  123. 123. “illuminance” is a standard which can be applied to different light types Unknown value Unknown value Lumen Looks like lumens, but Unknown value Illuminance © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  124. 124. Using “Illuminance” as a standard makes it easier to use the real world as a reference © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  125. 125. Our team measured illuminance and IBL at regular intervals from sunrise to high noon © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  126. 126. We gathered data on Sun elevation, sun elevation angle, color temperature, light volume, and IBL © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  127. 127. Lighting environment of each time period was reproduced on UE4 and checked for accuracy... © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  128. 128. We built a standardized light rig © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  129. 129. This allowed us to standardize the various lighting methods and approaches that were being used © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  130. 130. Initial lighting design cost was reduced © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  131. 131. However © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  132. 132. Using “Illuminance” as a standard caused some errors © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  133. 133. 16 bit limitation © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  134. 134. UE4 GBuffer is limited to 16 bits per channel © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  135. 135. Maximum value of 16 bit is “65535” © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  136. 136. What happens if we use our previous 2012.8 value Directional Light to light a sphere with Roughness set at 0.0? © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  137. 137. Scene color brightness is blown out at the highlight point shown above Infinity! © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  138. 138. Conversely, with the value set to 0.001, debug view and gizmo display are blown out © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  139. 139. “Illuminance” as a standard = “Reality” as a standard © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  140. 140. HDR data of the real world is too big for 16 bit © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  141. 141. What should we do? © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  142. 142. Are there better lighting workflows? Please let us know. We are happy to hear your suggestions. © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  143. 143. Wrap up © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  144. 144. Large CS Game Watch out for lighting on dynamic objects! Save us, Shinoyama-san! Limitations are very strict Somebody please help us with light bake errors! We are proud of creating our Illuminance standard! But the Gizmo burns our eyes ;) © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  145. 145. Thank you for listening to our presentation © 2016 SQUARE ENIX CO., LTD. All Rights Reserved.
  146. 146. Please feel free to ask questions © 2016 SQUARE ENIX CO., LTD. All Rights Reserved. UnrealEngine4 is a trade mark or a registered trade mark of Epic Games. PARAGON is a trade mark or a registered trade mark of Epic Games. Blu-ray is a trade mark or a registered trade mark of Blu-ray Disc Association. Any other company names and product names used in this document are trade marks or registered trade marks of the individual companies.

×