예제 #1
0
            internal void cctor > b__7_0(Light[] requests, NativeArray <LightDataGI> lightsOutput)
            {
                DirectionalLight directionalLight = default(DirectionalLight);
                PointLight       pointLight       = default(PointLight);
                SpotLight        spotLight        = default(SpotLight);
                RectangleLight   rectangleLight   = default(RectangleLight);
                DiscLight        discLight        = default(DiscLight);
                Cookie           cookie           = default(Cookie);
                LightDataGI      value            = default(LightDataGI);

                for (int i = 0; i < requests.Length; i++)
                {
                    Light light = requests[i];
                    switch (light.type)
                    {
                    case UnityEngine.LightType.Spot:
                        LightmapperUtils.Extract(light, ref spotLight);
                        LightmapperUtils.Extract(light, out cookie);
                        value.Init(ref spotLight, ref cookie);
                        break;

                    case UnityEngine.LightType.Directional:
                        LightmapperUtils.Extract(light, ref directionalLight);
                        LightmapperUtils.Extract(light, out cookie);
                        value.Init(ref directionalLight, ref cookie);
                        break;

                    case UnityEngine.LightType.Point:
                        LightmapperUtils.Extract(light, ref pointLight);
                        LightmapperUtils.Extract(light, out cookie);
                        value.Init(ref pointLight, ref cookie);
                        break;

                    case UnityEngine.LightType.Area:
                        LightmapperUtils.Extract(light, ref rectangleLight);
                        LightmapperUtils.Extract(light, out cookie);
                        value.Init(ref rectangleLight, ref cookie);
                        break;

                    case UnityEngine.LightType.Disc:
                        LightmapperUtils.Extract(light, ref discLight);
                        LightmapperUtils.Extract(light, out cookie);
                        value.Init(ref discLight, ref cookie);
                        break;

                    default:
                        value.InitNoBake(light.GetInstanceID());
                        break;
                    }
                    lightsOutput[i] = value;
                }
            }
예제 #2
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;
 }
예제 #3
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.Experimental.GlobalIllumination.RectangleLight o;
         o = new UnityEngine.Experimental.GlobalIllumination.RectangleLight();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
예제 #4
0
 public void Init(ref RectangleLight light)
 {
     this.instanceID     = light.instanceID;
     this.color          = light.color;
     this.indirectColor  = light.indirectColor;
     this.orientation    = light.orientation;
     this.position       = light.position;
     this.range          = light.range;
     this.coneAngle      = 0f;
     this.innerConeAngle = 0f;
     this.shape0         = light.width;
     this.shape1         = light.height;
     this.type           = LightType.Rectangle;
     this.mode           = light.mode;
     this.shadow         = ((!light.shadow) ? 0 : 1);
 }
예제 #5
0
 public void Init(ref RectangleLight light)
 {
     instanceID     = light.instanceID;
     color          = light.color;
     indirectColor  = light.indirectColor;
     orientation    = light.orientation;
     position       = light.position;
     range          = light.range;
     coneAngle      = 0.0f;
     innerConeAngle = 0.0f;
     shape0         = light.width;
     shape1         = light.height;
     type           = LightType.Rectangle;
     mode           = light.mode;
     shadow         = (byte)(light.shadow ? 1 : 0);
     falloff        = FalloffType.Undefined;
 }
예제 #6
0
 public void Init(ref RectangleLight light, ref Cookie cookie)
 {
     this.instanceID     = light.instanceID;
     this.cookieID       = cookie.instanceID;
     this.cookieScale    = cookie.scale;
     this.color          = light.color;
     this.indirectColor  = light.indirectColor;
     this.orientation    = light.orientation;
     this.position       = light.position;
     this.range          = light.range;
     this.coneAngle      = 0f;
     this.innerConeAngle = 0f;
     this.shape0         = light.width;
     this.shape1         = light.height;
     this.type           = LightType.Rectangle;
     this.mode           = light.mode;
     this.shadow         = (light.shadow ? 1 : 0);
     this.falloff        = light.falloff;
 }
예제 #7
0
 public void Init(ref RectangleLight light, ref Cookie cookie)
 {
     instanceID     = light.instanceID;
     cookieID       = cookie.instanceID;
     cookieScale    = cookie.scale;
     color          = light.color;
     indirectColor  = light.indirectColor;
     orientation    = light.orientation;
     position       = light.position;
     range          = light.range;
     coneAngle      = 0.0f;
     innerConeAngle = 0.0f;
     shape0         = light.width;
     shape1         = light.height;
     type           = LightType.Rectangle;
     mode           = light.mode;
     shadow         = (byte)(light.shadow ? 1 : 0);
     falloff        = light.falloff;
 }
예제 #8
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;
        }
예제 #9
0
        public void Init(ref RectangleLight light)
        {
            Cookie cookie = Cookie.Defaults();

            this.Init(ref light, ref cookie);
        }