User Tools

Site Tools


gamedev:ieslightprofiles

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
gamedev:ieslightprofiles [2020/10/27 18:15] – [Drag[en]gine IES Pack] dragonlordgamedev:ieslightprofiles [2020/11/24 09:57] (current) – [IES Image Module] dragonlord
Line 16: Line 16:
  
 If you want to access profile data in game scripts you have to reverse the gamma by using "pow(pixel, 2.2)". If you want to access profile data in game scripts you have to reverse the gamma by using "pow(pixel, 2.2)".
 +</WRAP>
 +
 +<WRAP center 100%>
 +<WRAP center box 450px>
 +{{youtube>LGBZLfGvm6M?medium}}
 +<WRAP centeralign>IES file handling</WRAP>
 +</WRAP>
 </WRAP> </WRAP>
  
Line 26: Line 33:
   <texture name='material'>   <texture name='material'>
     <image property='color.omnidir.equirect'>/shareddata/materials/light/profiles/display.ies</image>     <image property='color.omnidir.equirect'>/shareddata/materials/light/profiles/display.ies</image>
 +    <color property='omnidir.rotate.spot' r='0.25'/>
   </texture>   </texture>
 </skin> </skin>
Line 32: Line 40:
 The path to the IES file can be relative (to the directory the *.deskin is located in) or absolute. Using relative path makes skins easy to move between directories or game projects. The name of the texture is not important. Lights always use the first texture defined in a skin file. The path to the IES file can be relative (to the directory the *.deskin is located in) or absolute. Using relative path makes skins easy to move between directories or game projects. The name of the texture is not important. Lights always use the first texture defined in a skin file.
  
-If you want to use IES profiles for spot and projector type light sources you have to rotate the image first. This is required because IES profiles typically have the image shining down the Y-Axis. Spot and projector type light sources on the other hand shine along the Z-Axis. The image has to be rotated by 90° around the X-Axis to line them up. This example modifies the skin from above to work with spot lights. The [[gamedev:textureproperties:omnidir_rotate|omnidir.rotate]] expects values in the range from 0 (0°) to 1 (360°). Hence 0.25 represents a 90° rotation. +If you want to use IES profiles for spot and projector type light sources you have to rotate the image first. This is required because IES profiles typically have the image shining down the Y-Axis. Spot and projector type light sources on the other hand shine along the Z-Axis. The image has to be rotated by 90° around the X-Axis to line them up. This example above contains such a rotation using [[gamedev:textureproperties:omnidir_rotate_spot|omnidir.rotate.spot]]. The texture property expects values in the range from 0 (0°) to 1 (360°). Hence 0.25 represents a 90° rotation. The components map to axes like this: red -> X-Axis, green -> Y-Axis, blue -> Z-Axis. Not set components are 0 hence no rotation.
-The components map to axes like this: red -> X-Axis, green -> Y-Axis, blue -> Z-Axis. Not set components are 0 hence no rotation. +
- +
-<code xml><?xml version="1.0" encoding="ISO-8859-1"?> +
-<skin> +
-  <texture name='material'> +
-    <image property='color.omnidir.equirect'>/shareddata/materials/light/profiles/display.ies</image> +
-    <color property='omnidir.rotate' r='0.25'/> +
-  </texture> +
-</skin> +
-</code>+
  
-Using this modified light skin on point type light sources is not going to work since the rotation would make the light shine now along the Z-Axis which is most likely not what you want to achieveHence if you want to use a an IES profile on both point and spot or projector type light sources you have to create two individual skin files.+As note there exist two rotation properties: [[gamedev:textureproperties:omnidir_rotate|omnidir.rotate]] and [[gamedev:textureproperties:omnidir_rotate_spot|omnidir.rotate.spot]]. The difference is that [[gamedev:textureproperties:omnidir_rotate|omnidir.rotate]] applies to all light sources including point lights whereas [[gamedev:textureproperties:omnidir_rotate_spot|omnidir.rotate.spot]] applies only to spot and projector type light resources. Using this property allows to create light skins which are compatible for all light sources.
  
 ====== Drag[en]gine IES Pack ====== ====== Drag[en]gine IES Pack ======
gamedev/ieslightprofiles.txt · Last modified: 2020/11/24 09:57 by dragonlord