Site Tools


tutorial:ds3-gparam-basics

Differences

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

Link to this comparison view

Next revision
Previous revision
tutorial:ds3-gparam-basics [2025/02/26 01:46] – created admintutorial:ds3-gparam-basics [2025/02/27 00:45] (current) admin
Line 1: Line 1:
 ====== Map Lighting Tutorial (DS3) ====== ====== Map Lighting Tutorial (DS3) ======
 +Authors: Abyss1ne
  
 The Dark Souls 3 lighting system is really unique and complicated to mess with, so here it is a tutorial teaching you the basics on how to modify it. First of all, we need to understand the file type used for lighting and where it can be found. The Dark Souls 3 lighting system is really unique and complicated to mess with, so here it is a tutorial teaching you the basics on how to modify it. First of all, we need to understand the file type used for lighting and where it can be found.
Line 16: Line 17:
 Let’s start talking about the LIGHT section, what exactly it does? Well, this category will deal with the position of the light’s direction, the color it will use, the strength of that color, the strength of the light’s reflection and the SSAO of it. Let’s start talking about the LIGHT section, what exactly it does? Well, this category will deal with the position of the light’s direction, the color it will use, the strength of that color, the strength of the light’s reflection and the SSAO of it.
  
- +<code XML> 
-                [LIGHT ANGLE] +[LIGHT ANGLE] 
 <param name1="Directional Light Angle0" name2="Angle" type="Float2"> <param name1="Directional Light Angle0" name2="Angle" type="Float2">
 <value id="0">**-1,559945 -0,0713**</value> <value id="0">**-1,559945 -0,0713**</value>
 +</code>
  
 The bold numbers above are, in order, the Y Axis and the X Axis of the light’s angle. The bold numbers above are, in order, the Y Axis and the X Axis of the light’s angle.
  
- +<code XML> 
-                  [LIGHT COLOR]  +[LIGHT COLOR]  
- <param name1="Directional Light DiffColor0" name2="DiffColor" type="Float4"> +<param name1="Directional Light DiffColor0" name2="DiffColor" type="Float4"> 
-        <value id="0">**0,919829 0,757829 0,698302 22**</value>+<value id="0">**0,919829 0,757829 0,698302 22**</value
 +</code>
  
 The bold numbers above are, in order, the following: The bold numbers above are, in order, the following:
 **RED/GREEN/BLUE and ALPHA** (The alpha number controls how strong will be the light) **RED/GREEN/BLUE and ALPHA** (The alpha number controls how strong will be the light)
  
- +<code XML> 
-              [LIGHT REFLEXTION COLOR] +[LIGHT REFLECTION COLOR] 
 <param name1="Directional Light SpecColor0" name2="SpecColor" type="Float4"> <param name1="Directional Light SpecColor0" name2="SpecColor" type="Float4">
-        <value id="0">**0,770774 0,895567 1 16**</value>+<value id="0">**0,770774 0,895567 1 16**</value
 +</code>
  
 The bold numbers above are, in order, the following: The bold numbers above are, in order, the following:
 **RED/BLUE/GREEN and ALPHA** (The alpha number controls how strong will be the light) **RED/BLUE/GREEN and ALPHA** (The alpha number controls how strong will be the light)
  
-              [LIGHT REFLEXTION STRENGTH]   +<code XML> 
- <param name1="**Directional Light Sharpness0**" name2="Sharpness" type="Float"> +[LIGHT REFLECTION STRENGTH]   
-        <value id="0">**1,6**</value>+<param name1="**Directional Light Sharpness0**" name2="Sharpness" type="Float"> 
 +<value id="0">**1,6**</value>
  
-              [SSAO STRENGTH] +[SSAO STRENGTH] 
 <param name1="**Directional Light SsaoWeight0**" name2="SsaoWeight" type="Float"> <param name1="**Directional Light SsaoWeight0**" name2="SsaoWeight" type="Float">
-        <value id="0">**1**</value> +<value id="0">**1**</value> 
- +</code>
  
 (Just one more observation, avoid changing the light angle, Fromsoftware usually uses mixed lighting where they have both light that is directed to a location as shadow and light that are already pre rendered on the assets, imagine something like they paint over an asset a shadow or a light, if you rotate the light angle 0, shadows and light won't be in the same direction of the ones that were painted over the assets.) (Just one more observation, avoid changing the light angle, Fromsoftware usually uses mixed lighting where they have both light that is directed to a location as shadow and light that are already pre rendered on the assets, imagine something like they paint over an asset a shadow or a light, if you rotate the light angle 0, shadows and light won't be in the same direction of the ones that were painted over the assets.)
Line 53: Line 57:
 Now that I have presented the 5 main observations of what controls some characteristics of the LIGHT, I will need you to make a mental effort to understand one point, let's imagine the following: Now that I have presented the 5 main observations of what controls some characteristics of the LIGHT, I will need you to make a mental effort to understand one point, let's imagine the following:
  
- +<code XML> 
- +<param name1="Directional Light DiffColor0" name2="DiffColor" type="Float4"> 
-      <param name1="Directional Light DiffColor0" name2="DiffColor" type="Float4"> +<value id="0">0,919829 0,757829 0,698302 22</value> 
-        <value id="0">0,919829 0,757829 0,698302 22</value> +<value id="1">0,141176 0,141176 0,14902 4,001954</value> 
-        <value id="1">0,141176 0,141176 0,14902 4,001954</value> +<value id="2">1 1 1 1</value> 
-        <value id="2">1 1 1 1</value> +<value id="3">1 1 1 1</value> 
-        <value id="3">1 1 1 1</value> +<value id="4">1 1 1 1</value> 
-        <value id="4">1 1 1 1</value> +<value id="10">1,045 0,86 0,81 2,75</value> 
-        <value id="10">1,045 0,86 0,81 2,75</value> +</code>
- +
  
 In this part of gparam, we have the colour of some ID lighting: In this part of gparam, we have the colour of some ID lighting:
  
 +<code XML>
 Value id="0" / Value id="1" / Value id="2" / Value id="3" / Value id="4" / Value id="10" Value id="0" / Value id="1" / Value id="2" / Value id="3" / Value id="4" / Value id="10"
 +</code>
  
 Sounds confusing but imagine you are editing a piece of mapstudio map, there are two sections of information where you can set these ids Sounds confusing but imagine you are editing a piece of mapstudio map, there are two sections of information where you can set these ids
  
 +<code XML>
 LightSetID  [     ] LightSetID  [     ]
 FogParamID  [     ] FogParamID  [     ]
 +</code>
  
 When you set a LightSetID for that mappiece using mapstudio, it will use the info stored on that id to light that mappiece. Some maps have dozens of ids, and those ids were hand produced by a Fromsoftware lighting desinger. Usually the light 0 is the general light that the map has, and the other ids are for other peculiarities of the map like grass, very distant objects, among other things. When you set a LightSetID for that mappiece using mapstudio, it will use the info stored on that id to light that mappiece. Some maps have dozens of ids, and those ids were hand produced by a Fromsoftware lighting desinger. Usually the light 0 is the general light that the map has, and the other ids are for other peculiarities of the map like grass, very distant objects, among other things.
Line 80: Line 84:
 Now let's imagine the following, each Value ID has 4 lights that can be directed and configured. Now let's imagine the following, each Value ID has 4 lights that can be directed and configured.
  
 +<code XML>
  <param name1="Directional Light DiffColor0  <param name1="Directional Light DiffColor0
  <param name1="Directional Light DiffColor1      <param name1="Directional Light DiffColor1    
  <param name1="Directional Light LocalLight DiffColor1   <param name1="Directional Light LocalLight DiffColor1 
  <param name1="Directional Light LocalLight DiffColor2"  <param name1="Directional Light LocalLight DiffColor2"
 +</code>
  
 They seems to be pretty much the same thing, but they arent. Take a look at this: They seems to be pretty much the same thing, but they arent. Take a look at this:
  
 +<code XML>
  <param name1="Directional    >>|Light|<<     Diff    >>|Color0|<<  <param name1="Directional    >>|Light|<<     Diff    >>|Color0|<<
  <param name1="Directional    >>|Light|<<     Diff    >>|Color1|<<      <param name1="Directional    >>|Light|<<     Diff    >>|Color1|<<    
  <param name1="Directional Light     >>|LocalLight|<<    Diff   >>|Color1|<<  <param name1="Directional Light     >>|LocalLight|<<    Diff   >>|Color1|<<
  <param name1="Directional Light     >>|LocalLight|<<    Diff   >>|Color2|<<  <param name1="Directional Light     >>|LocalLight|<<    Diff   >>|Color2|<<
 +</code>
  
  
 Each id has these 4 lights   Each id has these 4 lights  
-- |Light|   |Color0| +  - |Light|   |Color0| 
-- |Light|   |Color1| +  - |Light|   |Color1| 
-- |LocalLight|   |Color1| +  - |LocalLight|   |Color1| 
-- |LocalLight|   |Color2| +  - |LocalLight|   |Color2|
- +
  
 Every light will always have Light color 0 and Light color 1 active and visible, but near the end of this portion of the XML that takes care of the light part you will find  Every light will always have Light color 0 and Light color 1 active and visible, but near the end of this portion of the XML that takes care of the light part you will find 
  
 +<code XML>
 +<param name1="Directional Enable LocalLight1" name2="Enable LocalLight1" type="BoolB">
 +    <value id="0">**False**</value>
  
- <param name1="Directional Enable LocalLight1" name2="Enable LocalLight1" type="BoolB"> +<param name1="Directional Enable LocalLight2" name2="Enable LocalLight1" type="BoolB"> 
-        <value id="0">**False**</value> +    <value id="0">**False**</value> 
- +</code>
- <param name1="Directional Enable LocalLight2" name2="Enable LocalLight1" type="BoolB"> +
-        <value id="0">**False**</value> +
  
 This part is the section that tells you whether a light has the local light ON or OFF (TRUE and FALSE). This part is the section that tells you whether a light has the local light ON or OFF (TRUE and FALSE).
  
 Local Light 1 and Local Light 2 generally illuminate the entire asset, be it chr, obj or mappiece. Local Light 1 and Local Light 2 generally illuminate the entire asset, be it chr, obj or mappiece.
- 
---------------------------------------------------------------------------------------- 
- 
  
 Now that we have looked at what controls light, let's take a step back and look at something mentioned earlier how the gparam structure is divided: Now that we have looked at what controls light, let's take a step back and look at something mentioned earlier how the gparam structure is divided:
Line 131: Line 133:
 It will follow a similar structure to the light part, much of this you will have to test and experience personally. It will follow a similar structure to the light part, much of this you will have to test and experience personally.
  
 +<code XML>
 <param name1="Fog-Color" name2="Color" type="Float4"> <param name1="Fog-Color" name2="Color" type="Float4">
-        <value id="0">**0,802986 0,718366 0,67493 0,683**</value> +<value id="0">**0,802986 0,718366 0,67493 0,683**</value> 
-                       RED      GREEN    BLUE     Alpha                 +               RED      GREEN    BLUE     Alpha                 
 +</code>
  
 The bold numbers above are, in order, the following: The bold numbers above are, in order, the following:
 **RED/GREEN/BLUE and ALPHA** (The alpha number controls how strong will be the fog) **RED/GREEN/BLUE and ALPHA** (The alpha number controls how strong will be the fog)
  
 +<code XML>
 <param name1="Fog-heightColor" name2="heightColor" type="Float4"> <param name1="Fog-heightColor" name2="heightColor" type="Float4">
         <value id="0">**0,802986 0,718366 0,72493 0,423**</value>         <value id="0">**0,802986 0,718366 0,72493 0,423**</value>
 +</code>
  
 The bold numbers above are, in order, the following: The bold numbers above are, in order, the following:
Line 150: Line 153:
 Basically changing the Fog-Dist will manage the horizontal distance from the fog to the player. On the other hand, Fog-heightDist will do the same but vertically. Basically changing the Fog-Dist will manage the horizontal distance from the fog to the player. On the other hand, Fog-heightDist will do the same but vertically.
  
- +<code XML>
   <param name1="**Fog-Dist**" name2="Dist" type="Float">   <param name1="**Fog-Dist**" name2="Dist" type="Float">
         <value id="0">**22,8**</value>         <value id="0">**22,8**</value>
Line 157: Line 159:
   <param name1="**Fog-heightDist**" name2="heightDist" type="Float">   <param name1="**Fog-heightDist**" name2="heightDist" type="Float">
         <value id="0">**13**</value>         <value id="0">**13**</value>
- +</code>
  
 The last two options, Fog-fogAlpha and Fog-fogContrast, will control how full an environment will become with the fog or how visible fog becomes by changing these two options. The last two options, Fog-fogAlpha and Fog-fogContrast, will control how full an environment will become with the fog or how visible fog becomes by changing these two options.
    
 +<code XML>
  <param name1="Fog-fogAlpha" name2="Alpha" type="Float">  <param name1="Fog-fogAlpha" name2="Alpha" type="Float">
         <value id="0">**1**</value>         <value id="0">**1**</value>
Line 168: Line 169:
  <param name1="Fog-fogContrast" name2="Contrast" type="Float">  <param name1="Fog-fogContrast" name2="Contrast" type="Float">
         <value id="0">**0,54**</value>         <value id="0">**0,54**</value>
- +</code>
- +
----------------------------------------------------------------------------------------+
  
 To end this tutorial, let’s talk a little bit about some PosEffects examples and the last options and sections on the gparam file: To end this tutorial, let’s talk a little bit about some PosEffects examples and the last options and sections on the gparam file:
tutorial/ds3-gparam-basics.1740534417.txt.gz · Last modified: by admin