コード例 #1
0
 public static void Extract(Light l, ref DirectionalLight dir)
 {
     dir.instanceID          = l.GetInstanceID();
     dir.mode                = Extract(l.lightmapBakeType);
     dir.shadow              = l.shadows != LightShadows.None;
     dir.direction           = l.transform.forward;
     dir.color               = LinearColor.Convert(l.color, l.intensity);
     dir.indirectColor       = ExtractIndirect(l);
     dir.penumbraWidthRadian = l.shadows == LightShadows.Soft ? (Mathf.Deg2Rad * l.shadowAngle) : 0.0f;
 }
コード例 #2
0
 public static void Extract(Light l, ref DirectionalLight dir)
 {
     dir.instanceID          = l.GetInstanceID();
     dir.mode                = LightmapperUtils.Extract(l.lightmapBakeType);
     dir.shadow              = (l.shadows != LightShadows.None);
     dir.direction           = l.transform.forward;
     dir.color               = LinearColor.Convert(l.color, l.intensity);
     dir.indirectColor       = LightmapperUtils.ExtractIndirect(l);
     dir.penumbraWidthRadian = ((l.shadows != LightShadows.Soft) ? 0f : (0.0174532924f * l.shadowAngle));
 }
コード例 #3
0
 public static void Extract(Light l, ref PointLight point)
 {
     point.instanceID    = l.GetInstanceID();
     point.mode          = LightmapperUtils.Extract(l.lightmapBakeType);
     point.shadow        = (l.shadows != LightShadows.None);
     point.position      = l.transform.position;
     point.color         = LinearColor.Convert(l.color, l.intensity);
     point.indirectColor = LightmapperUtils.ExtractIndirect(l);
     point.range         = l.range;
     point.sphereRadius  = ((l.shadows != LightShadows.Soft) ? 0f : l.shadowRadius);
 }
コード例 #4
0
 public static void Extract(Light l, ref DiscLight disc)
 {
     disc.instanceID    = l.GetInstanceID();
     disc.mode          = Extract(l.lightmapBakeType);
     disc.shadow        = l.shadows != LightShadows.None;
     disc.position      = l.transform.position;
     disc.orientation   = l.transform.rotation;
     disc.color         = LinearColor.Convert(l.color, l.intensity);
     disc.indirectColor = ExtractIndirect(l);
     disc.range         = l.range;
     disc.radius        = l.areaSize.x;
 }
コード例 #5
0
 public static void Extract(Light l, ref PointLight point)
 {
     point.instanceID    = l.GetInstanceID();
     point.mode          = Extract(l.lightmapBakeType);
     point.shadow        = l.shadows != LightShadows.None;
     point.position      = l.transform.position;
     point.color         = LinearColor.Convert(l.color, l.intensity);
     point.indirectColor = ExtractIndirect(l);
     point.range         = l.range;
     point.sphereRadius  = l.shadows == LightShadows.Soft ? l.shadowRadius : 0.0f;
     point.falloff       = FalloffType.Legacy;
 }
コード例 #6
0
 public static void Extract(Light l, ref RectangleLight rect)
 {
     rect.instanceID    = l.GetInstanceID();
     rect.mode          = LightmapperUtils.Extract(l.lightmapBakeType);
     rect.shadow        = (l.shadows != LightShadows.None);
     rect.position      = l.transform.position;
     rect.orientation   = l.transform.rotation;
     rect.color         = LinearColor.Convert(l.color, l.intensity);
     rect.indirectColor = LightmapperUtils.ExtractIndirect(l);
     rect.range         = l.range;
     rect.width         = l.areaSize.x;
     rect.height        = l.areaSize.y;
 }
コード例 #7
0
 public static void Extract(Light l, ref SpotLight spot)
 {
     spot.instanceID     = l.GetInstanceID();
     spot.mode           = LightmapperUtils.Extract(l.lightmapBakeType);
     spot.shadow         = (l.shadows != LightShadows.None);
     spot.position       = l.transform.position;
     spot.orientation    = l.transform.rotation;
     spot.color          = LinearColor.Convert(l.color, l.intensity);
     spot.indirectColor  = LightmapperUtils.ExtractIndirect(l);
     spot.range          = l.range;
     spot.sphereRadius   = ((l.shadows != LightShadows.Soft) ? 0f : l.shadowRadius);
     spot.coneAngle      = l.spotAngle * 0.0174532924f;
     spot.innerConeAngle = LightmapperUtils.ExtractInnerCone(l);
 }
コード例 #8
0
 public static void Extract(Light l, ref SpotLight spot)
 {
     spot.instanceID     = l.GetInstanceID();
     spot.mode           = Extract(l.lightmapBakeType);
     spot.shadow         = l.shadows != LightShadows.None;
     spot.position       = l.transform.position;
     spot.orientation    = l.transform.rotation;
     spot.color          = LinearColor.Convert(l.color, l.intensity);
     spot.indirectColor  = ExtractIndirect(l);
     spot.range          = l.range;
     spot.sphereRadius   = l.shadows == LightShadows.Soft ? l.shadowRadius : 0.0f;
     spot.coneAngle      = l.spotAngle * Mathf.Deg2Rad;
     spot.innerConeAngle = ExtractInnerCone(l);
     spot.falloff        = FalloffType.Legacy;
 }
コード例 #9
0
        public static void Extract(Light l, ref DirectionalLight dir)
        {
            dir.instanceID  = l.GetInstanceID();
            dir.mode        = LightmapperUtils.Extract(l.lightmapBakeType);
            dir.shadow      = (l.shadows > LightShadows.None);
            dir.position    = l.transform.position;
            dir.orientation = l.transform.rotation;
            Color       cct           = LightmapperUtils.ExtractColorTemperature(l);
            LinearColor color         = LinearColor.Convert(l.color, l.intensity);
            LinearColor indirectColor = LightmapperUtils.ExtractIndirect(l);

            LightmapperUtils.ApplyColorTemperature(cct, ref color);
            LightmapperUtils.ApplyColorTemperature(cct, ref indirectColor);
            dir.color               = color;
            dir.indirectColor       = indirectColor;
            dir.penumbraWidthRadian = ((l.shadows == LightShadows.Soft) ? (0.0174532924f * l.shadowAngle) : 0f);
        }
コード例 #10
0
            public static void Extract(Light l, ref DirectionalLight dir)
            {
                dir.instanceID  = l.GetInstanceID();
                dir.mode        = Extract(l.lightmapBakeType);
                dir.shadow      = l.shadows != LightShadows.None;
                dir.position    = l.transform.position;
                dir.orientation = l.transform.rotation;

                Color       cct           = ExtractColorTemperature(l);
                LinearColor directColor   = LinearColor.Convert(l.color, l.intensity);
                LinearColor indirectColor = ExtractIndirect(l);

                ApplyColorTemperature(cct, ref directColor);
                ApplyColorTemperature(cct, ref indirectColor);
                dir.color               = directColor;
                dir.indirectColor       = indirectColor;
                dir.penumbraWidthRadian = l.shadows == LightShadows.Soft ? (Mathf.Deg2Rad * l.shadowAngle) : 0.0f;
            }
コード例 #11
0
        public static void Extract(Light l, ref PointLight point)
        {
            point.instanceID = l.GetInstanceID();
            point.mode       = LightmapperUtils.Extract(l.lightmapBakeType);
            point.shadow     = (l.shadows > LightShadows.None);
            point.position   = l.transform.position;
            Color       cct           = LightmapperUtils.ExtractColorTemperature(l);
            LinearColor color         = LinearColor.Convert(l.color, l.intensity);
            LinearColor indirectColor = LightmapperUtils.ExtractIndirect(l);

            LightmapperUtils.ApplyColorTemperature(cct, ref color);
            LightmapperUtils.ApplyColorTemperature(cct, ref indirectColor);
            point.color         = color;
            point.indirectColor = indirectColor;
            point.range         = l.range;
            point.sphereRadius  = ((l.shadows == LightShadows.Soft) ? l.shadowRadius : 0f);
            point.falloff       = FalloffType.Legacy;
        }
コード例 #12
0
        public static void Extract(Light l, ref DiscLight disc)
        {
            disc.instanceID  = l.GetInstanceID();
            disc.mode        = LightmapperUtils.Extract(l.lightmapBakeType);
            disc.shadow      = (l.shadows > LightShadows.None);
            disc.position    = l.transform.position;
            disc.orientation = l.transform.rotation;
            Color       cct           = LightmapperUtils.ExtractColorTemperature(l);
            LinearColor color         = LinearColor.Convert(l.color, l.intensity);
            LinearColor indirectColor = LightmapperUtils.ExtractIndirect(l);

            LightmapperUtils.ApplyColorTemperature(cct, ref color);
            LightmapperUtils.ApplyColorTemperature(cct, ref indirectColor);
            disc.color         = color;
            disc.indirectColor = indirectColor;
            disc.range         = l.range;
            disc.radius        = l.areaSize.x;
            disc.falloff       = FalloffType.Legacy;
        }
コード例 #13
0
        public static void Extract(Light l, ref RectangleLight rect)
        {
            rect.instanceID  = l.GetInstanceID();
            rect.mode        = LightmapperUtils.Extract(l.lightmapBakeType);
            rect.shadow      = (l.shadows > LightShadows.None);
            rect.position    = l.transform.position;
            rect.orientation = l.transform.rotation;
            Color       cct           = LightmapperUtils.ExtractColorTemperature(l);
            LinearColor color         = LinearColor.Convert(l.color, l.intensity);
            LinearColor indirectColor = LightmapperUtils.ExtractIndirect(l);

            LightmapperUtils.ApplyColorTemperature(cct, ref color);
            LightmapperUtils.ApplyColorTemperature(cct, ref indirectColor);
            rect.color         = color;
            rect.indirectColor = indirectColor;
            rect.range         = l.range;
            rect.width         = l.areaSize.x;
            rect.height        = l.areaSize.y;
            rect.falloff       = FalloffType.Legacy;
        }
コード例 #14
0
        public static void Extract(Light l, ref SpotLight spot)
        {
            spot.instanceID  = l.GetInstanceID();
            spot.mode        = LightmapperUtils.Extract(l.lightmapBakeType);
            spot.shadow      = (l.shadows > LightShadows.None);
            spot.position    = l.transform.position;
            spot.orientation = l.transform.rotation;
            Color       cct           = LightmapperUtils.ExtractColorTemperature(l);
            LinearColor color         = LinearColor.Convert(l.color, l.intensity);
            LinearColor indirectColor = LightmapperUtils.ExtractIndirect(l);

            LightmapperUtils.ApplyColorTemperature(cct, ref color);
            LightmapperUtils.ApplyColorTemperature(cct, ref indirectColor);
            spot.color          = color;
            spot.indirectColor  = indirectColor;
            spot.range          = l.range;
            spot.sphereRadius   = ((l.shadows == LightShadows.Soft) ? l.shadowRadius : 0f);
            spot.coneAngle      = l.spotAngle * 0.0174532924f;
            spot.innerConeAngle = LightmapperUtils.ExtractInnerCone(l);
            spot.falloff        = FalloffType.Legacy;
            spot.angularFalloff = AngularFalloffType.LUT;
        }
コード例 #15
0
 public static LinearColor ExtractIndirect(Light l)
 {
     return(LinearColor.Convert(l.color, l.intensity * l.bounceIntensity));
 }
コード例 #16
0
            public static LinearColor ExtractIndirect(Light l)
            {
                LinearColor result = LinearColor.Convert(l.color, l.intensity * l.bounceIntensity);

                return(result);
            }