Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
map_making:lighting_guide [2020/07/31 02:06]
fiveman1
map_making:lighting_guide [2021/06/23 16:37] (current)
fiveman1
Line 1: Line 1:
-=====Lighting guide/lighting script basics=====+======Lighting guide/lighting script basics======
  
-===Environmental lighting===+===== Environmental lighting =====
  
 Roblox Bhop and Surf use the Shadowmap lighting technology. To use that in Studio, in the explorer window, navigate to Lighting. Click on it and look at the properties. The Technology property needs to be changed to ''Shadowmap''. Roblox Bhop and Surf use the Shadowmap lighting technology. To use that in Studio, in the explorer window, navigate to Lighting. Click on it and look at the properties. The Technology property needs to be changed to ''Shadowmap''.
  
-==Most important game.Lighting properties==+==== Most important game.Lighting properties ====
  
   * Ambient (default: 0,0,0)   * Ambient (default: 0,0,0)
Line 14: Line 14:
     * Controls the tint of the sun     * Controls the tint of the sun
   * GlobalShadows (default: true)   * GlobalShadows (default: true)
-    * If false, there will be no shadows (not recommended, tweak part's CastShadow properties instead)+    * If false, there will be no shadows (it may look better to tweak part's CastShadow properties instead)
   * OutdoorAmbient (default: 127,127,127)   * OutdoorAmbient (default: 127,127,127)
     * Controls the color/brightness of the outdoors     * Controls the color/brightness of the outdoors
   * ClockTime (default: 14)   * ClockTime (default: 14)
-    * Controls the time of day+    * Controls the time of day and position of the sun
   * GeographicLatitude (default: 41.733)   * GeographicLatitude (default: 41.733)
-    * Controls the latitude+    * Controls the latitude and position of the sun
   * FogColor (default: 192,192,192)   * FogColor (default: 192,192,192)
     * Controls the color of fog     * Controls the color of fog
Line 29: Line 29:
 //Note: both ClockTime and GeographicLatitude are used to control the position of the sun// //Note: both ClockTime and GeographicLatitude are used to control the position of the sun//
  
-==Basics for environmental lighting (game.Lighting)==+==== Basics for environmental lighting (game.Lighting) ====
  
 To change game.Lighting properties for your map, you need to add a script to your map model. To change game.Lighting properties for your map, you need to add a script to your map model.
  
 Example: Example:
-  local l = game.Lighting+<code Lua>local l = game.Lighting</code>
 Assign a variable name to game.Lighting for ease of use, here we just use ''l'' Assign a variable name to game.Lighting for ease of use, here we just use ''l''
-  l.Ambient = Color3.fromRGB(100,100,100) +<code Lua> 
-  l.ClockTime = 12 +l.Ambient = Color3.fromRGB(100,100,100) 
-  l.GeographicLatitude = 21+l.ClockTime = 12 
 +l.GeographicLatitude = 21 
 +</code>
 Increase the Ambient value to make shadows less dark so indoor areas have more visibility. Change the position of the sun so it is more directly overhead and creates less shadows. Increase the Ambient value to make shadows less dark so indoor areas have more visibility. Change the position of the sun so it is more directly overhead and creates less shadows.
-   
  
-==Related==+For properties that use Color3 values, simply use ''Color3.fromRGB(R,G,B)'' and fill in the R,G,B with the corresponding red, blue, and green values of your choice. The others just use numbers. 
 + 
 +====How to add a Skybox===== 
 + 
 +Create a Sky object in studio and put it inside your map model. Follow the instructions on this [[https://developer.roblox.com/en-us/articles/Custom-Skyboxes|Roblox Developer wiki article about custom skyboxes]] if you need help. 
 + 
 +Next, put a script inside the Sky object. The script should say: 
 + 
 +<code Lua> 
 +script.Parent.Parent = game.Lighting 
 +</code> 
 + 
 +All this does is change the parent of script.Parent (the Sky object) to game.Lighting. This just moves the Sky from your map model to game.Lighting where it belongs. 
 + 
 +Finally, turn off the CelestialBodiesShown property of the Sky object if the skybox already has a sun, otherwise you will have two suns (the sun from the skybox images, and the sun added by Roblox). 
 + 
 +===== Related =====
   *[[https://www.youtube.com/watch?v=_PH4p4Z9YSo|Simple script tutorial for bhop/surf (skyboxes, terrain, lighting) (Youtube)]]   *[[https://www.youtube.com/watch?v=_PH4p4Z9YSo|Simple script tutorial for bhop/surf (skyboxes, terrain, lighting) (Youtube)]]
   *[[https://docs.google.com/document/d/1zNFR_TFEGBaDAMPzVrrD53hYMK-C3BGqb-JMRC8yp4A/edit#heading=h.yoex4xs80bc4|Small collection of lighting presets intended for bhop maps]]   *[[https://docs.google.com/document/d/1zNFR_TFEGBaDAMPzVrrD53hYMK-C3BGqb-JMRC8yp4A/edit#heading=h.yoex4xs80bc4|Small collection of lighting presets intended for bhop maps]]
Navigation