Advertisement
BobTheHunted

Arma 3 v1.60 Lighting Update Documentation - W.I.P.

Aug 27th, 2017
369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 7.92 KB | None | 0 0
  1. //--------------------------------------------------------------------------------
  2. // Early Documentation posted by Cre8or in the A3 #terrain_makers Discord channel:
  3. //--------------------------------------------------------------------------------
  4.  
  5.  
  6. class Lighting7
  7. {                                                         // = 17:05 (on October 10th 2008 - this is 100% dependent on date and time!)
  8.                                                           // Parameter syntax: {{R, G, B}, INTENSITY};
  9.     diffuse[]               = {{0.90, 0.40, 0.20}, 8.0};  // The color of the sun-/moonlight - affects both the terrain and all objects
  10.     diffuseCloud[]          = {{0.90, 0.40, 0.20}, 8.0};  // Same as above (frankly, I don't know what the difference between the 2 is)
  11.     ambient[]               = {{0.36, 0.41, 0.47}, 8.4};  // The color of the terrain when not illuminated by the sun/moon
  12.     ambientCloud[]          = {{0.36, 0.41, 0.47}, 8.4};  // Same as above
  13.     ambientMid[]            = {{0.45, 0.51, 0.55}, 7.4};  // The color of objects when not illuminated by the sun/moon
  14.     ambientMidCloud[]       = {{0.45, 0.51, 0.55}, 7.4};  // Same as above
  15.     groundReflection[]      = {{0.40, 0.43, 0.45}, 7.0};  // What it says - visible within 1-2 meters above ground
  16.                                                           // I recommend spawning an Ghosthawk and looking at its underside to see what this does
  17.     groundReflectionCloud[] = {{0.40, 0.43, 0.45}, 7.0};  // Same as above
  18.     sky[]                   = {{0.14, 0.25, 0.42}, 8.8};  // Color of the sky, doesn't affect areas around/near the sun
  19.     skyAroundSun[]          = {{0.85, 0.48, 0.05}, 11.8}; // Color of the sky around/near the sun, overwrites sky color in those areas
  20.     fogColor[]              = {{0.50, 0.55, 0.63}, 5.4};  // Color of the fog
  21.     cloudsColor[]           = {{0.45, 1.00, 1.00}, 12.2}; // Color of the clouds, however results will vary when looking from above/below
  22. };
  23.  
  24.  
  25. //----------------------------------------------------------
  26. // Further clarification on some parameters provided by Uro:
  27. //----------------------------------------------------------
  28. //
  29. // diffuse/diffuseCloud is the direct lighting from the sun when the sun object is revealed or hidden behind clouds.
  30. //
  31. // Similarly, ambient/ambientCloud/ambientMid/ambientMidCloud/groundReflection/groundReflectionCloud are in relation to light sources from different angles.  ambient = above ground / ambientMid = from the side / groundReflection = from the bottom.
  32. //
  33. // bidirect[] = {}; is the light from the opposite direction than the sun.  This value is not a part of the LightingNew classes
  34. //
  35. // Uro: also one important factor for immersion is the fogColour array, it defines the fog colour with a few caveats.  the skycolour param will have an effect on the colour of the fog you end up with so your actual fog colour will be a blend of the 2 parameters.  The fogcolour also has an effect on the horizont line, where the VD ends it ceates a gradient that blends into the sky, so if for example you completely disable fogcolor it still effects how the skybox is drawn overall.
  36.  
  37.  
  38. //------------------------------------------------------------------------------
  39. // Cre8or's comments regarding date and time relative to lighting configuration:
  40. //------------------------------------------------------------------------------
  41. //
  42. // The way I established what time of day goes with each lighting class was indeed trial and error, as the classes are indeed tied to multiple factors, such as the terrain's geographic location and the date (month and year included), however they are not tied to the "time of day."
  43. // When I started, I picked a date/month that gave me the amount of sunlight in a full day that I wanted - in my case, October 10th did the trick
  44. // Next, I wanted to know which time of day was the closest to each of my lighting classes
  45. // So I went in all of the classes and changed the sunOrMoon parameter to 0, except for one class (where I changed it to 1)
  46. // Then I simply cycled through the time of day until I found the hour/time where the environment was the brightest, and I wrote that time down as a comment next to the lighting class
  47.  
  48.  
  49. //---------------------------------------------
  50. // Mondkalb's comments regarding date and time:
  51. //---------------------------------------------
  52. //
  53. // The classes are not tied to hours in the day, but instead to combinations of sunAngle and overcast.
  54. // This way your lighting stays consistent, but the days will be longer or shorter depending on the seasons.
  55.  
  56.  
  57. //---------------------------------------------------
  58. // Mondkalb's comments regarding config organization:
  59. //---------------------------------------------------
  60. //
  61. // I have my lighting configs divided into three .hpps, each with 13 lightings and one extra for the underwater stuff
  62. // sorted into the three overcast levels:
  63. // 25, 60, 85
  64.  
  65.  
  66. //-------------------------------------------------------------------------------------
  67. // Conversation regarding lighting configuration being affected by terrain coordinates:
  68. //-------------------------------------------------------------------------------------
  69. //
  70. // Rylan: What determines which classes apply to what coordinates?
  71. //
  72. // Mondkalb: The engine's geoid simulation.
  73. //
  74. // Mondkalb: I havent checked in ArmA 3, but in all games from OFP to ArmA 2, the sky was correctly modelled depending on where the map placed you in the world. S/N hemi
  75. // Additionally, day and night transitions are faster near the equator and longer near the poles.
  76. //
  77. // Rylan: How should I insert this into the document?  I'm still not entirely sure exactly what it means
  78. //
  79. // Mondkalb: Via config you control this through the "longtitude =" and "latitude=" parameters
  80. //     class myTerrain : CAWorld
  81. //     {
  82. //         latitude               = -51.0;
  83. //         longitude              = 11.0;
  84. //     };
  85. //
  86. // Rylan: How could you find out which lighting classes those coordinates would use?
  87. //
  88. // Mondkalb: Trial and error.
  89.  
  90.  
  91. //-----------------------------------------------------------------------------------
  92. // Conversation regarding the use of each lighting class and what purpose they serve:
  93. //-----------------------------------------------------------------------------------
  94. //
  95. //
  96. // Rylan: So, in the "LightingNew" subclasses, what does each one do?  For example Lighting1 vs Lighting2 vs Lighting44?
  97. // I don't understand why there are so many of them.
  98. //
  99. //
  100. // Ice: @Rylan @Cre8or posted this the other day, did you see it?
  101. //
  102. //
  103. // Rylan: @Ice I did, but that doesn't say anything about why there are 44 of them.
  104. // Shouldn't there only be 24 if it's time of day?
  105. // Or even 48?
  106. // Why 44?
  107. // I don't understand the logic here
  108. //
  109. //
  110. // Cre8or: @Rylan IIRC there are 45 of them, divided into 4 categories.
  111. // The first 3 categories cover a full day/night cycle each, but at different overcast values (0.25, 0.6, 0.8).
  112. // Each set encompasses 13 classes, the first one ranging from Lighting0 to Lighting12.
  113. // Each of these classes covers a different sun angle, between each angle the engine interpolates between the neighboring classes.
  114. // Currently, the sun angles of all 13 classes are as follows:
  115. //
  116. // Lighting0    -24
  117. // Lighting1    -12
  118. // Lighting2    -11
  119. // Lighting3    -10
  120. // Lighting4    -5
  121. // Lighting5    -2
  122. // Lighting6    0
  123. // Lighting7    2
  124. // Lighting8    6
  125. // Lighting9    12
  126. // Lighting10   24
  127. // Lighting11   45
  128. // Lighting12   90
  129. //
  130. // Then, from Lighting13 to Lighting25, the cycle repeats, and then again from 26 to 38.
  131. // As for the remaining classes (39 to 44), I'm not entirely sure, but it seems like they handle the underwater lighting.
  132. //
  133. //-------------------------
  134. // Summary provided by Uro:
  135. //-------------------------
  136. //
  137. // Lighting 0-10  = day/night w/ clear sky
  138. // Lighting 11-21 = day/night w/ overcast sky
  139. // Lighting 22-71 address lighting underwater at specific depths governed by the "height = -0.001"; param
  140. // Also when in-game all lighting values (diffuse light, ambient light) will remain the same from overcast 0 - 0.4.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement