void Reset()
    {
        lastResetTime = System.DateTime.Now.ToString ();

        ambientEquatorColor = RenderSettings.ambientEquatorColor;
        ambientGroundColor = RenderSettings.ambientGroundColor;
        ambientIntensity = RenderSettings.ambientIntensity;
        ambientLight = RenderSettings.ambientLight;
        ambientMode = RenderSettings.ambientMode;
        ambientProbe = RenderSettings.ambientProbe;
        ambientSkyColor = RenderSettings.ambientSkyColor;
        customReflection = RenderSettings.customReflection;
        defaultReflectionMode = RenderSettings.defaultReflectionMode;
        defaultReflectionResolution = RenderSettings.defaultReflectionResolution;
        flareFadeSpeed = RenderSettings.flareFadeSpeed;
        flareStrength = RenderSettings.flareStrength;
        fog = RenderSettings.fog;
        fogColor = RenderSettings.fogColor;
        fogDensity = RenderSettings.fogDensity;
        fogEndDistance = RenderSettings.fogEndDistance;
        fogMode = RenderSettings.fogMode;
        fogStartDistance = RenderSettings.fogStartDistance;
        haloStrength = RenderSettings.haloStrength;
        reflectionBounces = RenderSettings.reflectionBounces;
        reflectionIntensity = RenderSettings.reflectionIntensity;
        skybox = RenderSettings.skybox;
    }
 static public int constructor(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.Rendering.SphericalHarmonicsL2 o;
         o = new UnityEngine.Rendering.SphericalHarmonicsL2();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
 static void LightProbes_bakedProbes(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.LightProbes _this = (UnityEngine.LightProbes)vc.csObj;
         var result = _this.bakedProbes;
         var arrRet = result;
         for (int i = 0; arrRet != null && i < arrRet.Length; i++)
         {
             JSMgr.datax.setObject((int)JSApi.SetType.SaveAndTempTrace, arrRet[i]);
             JSApi.moveSaveID2Arr(i);
         }
         JSApi.setArrayS((int)JSApi.SetType.Rval, (arrRet != null ? arrRet.Length : 0), true);
     }
     else
     {
         UnityEngine.Rendering.SphericalHarmonicsL2[] arg0 = JSDataExchangeMgr.GetJSArg <UnityEngine.Rendering.SphericalHarmonicsL2[]>(() =>
         {
             int jsObjID = JSApi.getObject((int)JSApi.GetType.Arg);
             int length  = JSApi.getArrayLength(jsObjID);
             var ret     = new UnityEngine.Rendering.SphericalHarmonicsL2[length];
             for (var i = 0; i < length; i++)
             {
                 JSApi.getElement(jsObjID, i);
                 ret[i] = (UnityEngine.Rendering.SphericalHarmonicsL2)JSMgr.datax.getObject((int)JSApi.GetType.SaveAndRemove);
             }
             return(ret);
         });
         UnityEngine.LightProbes _this = (UnityEngine.LightProbes)vc.csObj;
         _this.bakedProbes = arg0;
     }
 }
Exemplo n.º 4
0
 void SHAddPointLight(Vector3 probePosition, Vector3 position, float range, Color color, float intensity, ref SphericalHarmonicsL2 sh)
 {
     // From the point of view of an SH probe, point light looks no different than a directional light,
     // just attenuated and coming from the right direction.
     Vector3 probeToLight = position - probePosition;
     float attenuation = 1.0F / (1.0F + 25.0F * probeToLight.sqrMagnitude / (range * range));
     sh.AddDirectionalLight(probeToLight.normalized, color, intensity * attenuation);
 }
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.Rendering.SphericalHarmonicsL2 o;
			o=new UnityEngine.Rendering.SphericalHarmonicsL2();
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
 //read data from probeDataXML and assign them to the baked probe
 public SphericalHarmonicsL2[] assignData2bakedProbe(List<List<float>> tempProbeData,float GIweight,SphericalHarmonicsL2[] bakedProbes,int probeCount)
 {
     for (int i=0; i<probeCount; i++) {
         for (int j=0; j<3; j++) {
             for (int k=0; k<9; k++) {
                 bakedProbes[i][j,k]+=tempProbeData[i][9*j+k]*GIweight;
             }
         }
     }
     return bakedProbes;
     //LightmapSettings.lightProbes.bakedProbes = bakedProbes;
 }
Exemplo n.º 7
0
            internal void ToSphericalHarmonicsShaderConstants(ProbeReferenceVolume.Cell cell, int probeIdx)
            {
                var sh = new SphericalHarmonicsL2();

                ToSphericalHarmonicsL2(ref sh);

                WriteToShaderCoeffsL0L1(sh, cell.bakingScenario.shL0L1RxData, cell.bakingScenario.shL1GL1RyData, cell.bakingScenario.shL1BL1RzData, probeIdx * 4);

                if (cell.shBands == ProbeVolumeSHBands.SphericalHarmonicsL2)
                {
                    WriteToShaderCoeffsL2(sh, cell.bakingScenario.shL2Data_0, cell.bakingScenario.shL2Data_1, cell.bakingScenario.shL2Data_2, cell.bakingScenario.shL2Data_3, probeIdx * 4);
                }
            }
Exemplo n.º 8
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.Rendering.SphericalHarmonicsL2 o;
         o = new UnityEngine.Rendering.SphericalHarmonicsL2();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
 public static int constructor(IntPtr l)
 {
     try {
         UnityEngine.Rendering.SphericalHarmonicsL2 o;
         o=new UnityEngine.Rendering.SphericalHarmonicsL2();
         pushValue(l,o);
         return 1;
     }
     catch(Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return 0;
     }
 }
 static void RenderSettings_ambientProbe(JSVCall vc)
 {
     if (vc.bGet)
     {
         var result = UnityEngine.RenderSettings.ambientProbe;
         JSMgr.datax.setObject((int)JSApi.SetType.Rval, result);
     }
     else
     {
         UnityEngine.Rendering.SphericalHarmonicsL2 arg0 = (UnityEngine.Rendering.SphericalHarmonicsL2)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
         UnityEngine.RenderSettings.ambientProbe = arg0;
     }
 }
Exemplo n.º 11
0
 static int set_ambientProbe(IntPtr L)
 {
     try
     {
         UnityEngine.Rendering.SphericalHarmonicsL2 arg0 = (UnityEngine.Rendering.SphericalHarmonicsL2)ToLua.CheckObject(L, 2, typeof(UnityEngine.Rendering.SphericalHarmonicsL2));
         UnityEngine.RenderSettings.ambientProbe = arg0;
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.Rendering.SphericalHarmonicsL2 o;
         o = new UnityEngine.Rendering.SphericalHarmonicsL2();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
    static int QPYX_set_ambientProbe_YXQP(IntPtr L_YXQP)
    {
        try
        {
            UnityEngine.Rendering.SphericalHarmonicsL2 QPYX_arg0_YXQP = StackTraits <UnityEngine.Rendering.SphericalHarmonicsL2> .Check(L_YXQP, 2);

            UnityEngine.RenderSettings.ambientProbe = QPYX_arg0_YXQP;
            return(0);
        }
        catch (Exception e_YXQP)                {
            return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
        }
    }
Exemplo n.º 14
0
    void CreateDefaultVolume()
    {
        for (int i = 0; i < _colorChannel; i++)
        {
            _volumeLightProbe[i] = new Texture3D(2, 2, 2, TextureFormat.RGBA32, false);
        }


        UnityEngine.Rendering.SphericalHarmonicsL2 sh;
        sh = new UnityEngine.Rendering.SphericalHarmonicsL2();
        sh.AddAmbientLight(_defaultLightProbeColor);

        Color[] colorsR = new Color[8];
        Color[] colorsG = new Color[8];
        Color[] colorsB = new Color[8];

        int counter = 0;

        for (int k = 0; k < 2; k++)
        {
            for (int j = 0; j < 2; j++)
            {
                for (int i = 0; i < 2; i++)
                {
                    colorsR[counter] = new Color(sh[0, 3] * 0.5f + 0.5f, sh[0, 1] * 0.5f + 0.5f, sh[0, 2] * 0.5f + 0.5f, sh[0, 0] * 0.5f + 0.5f);
                    colorsG[counter] = new Color(sh[1, 3] * 0.5f + 0.5f, sh[1, 1] * 0.5f + 0.5f, sh[1, 2] * 0.5f + 0.5f, sh[1, 0] * 0.5f + 0.5f);
                    colorsB[counter] = new Color(sh[2, 3] * 0.5f + 0.5f, sh[2, 1] * 0.5f + 0.5f, sh[2, 2] * 0.5f + 0.5f, sh[2, 0] * 0.5f + 0.5f);
                    counter++;
                }
            }
        }



        _volumeLightProbe[0].SetPixels(colorsR);
        _volumeLightProbe[1].SetPixels(colorsG);
        _volumeLightProbe[2].SetPixels(colorsB);
        for (int channel = 0; channel < _colorChannel; channel++)
        {
            _volumeLightProbe[channel].wrapMode = TextureWrapMode.Clamp;
            _volumeLightProbe[channel].Apply();
        }
        Shader.SetGlobalTexture("_LightVolumeR", _volumeLightProbe[0]);
        Shader.SetGlobalTexture("_LightVolumeG", _volumeLightProbe[1]);
        Shader.SetGlobalTexture("_LightVolumeB", _volumeLightProbe[2]);

        _minVec        = new Vector3(0, 0, 0);
        _volumeTexSize = new Vector3(2, 2, 2);
        Shader.SetGlobalVector("_LightVolumeMin", _minVec);
        Shader.SetGlobalVector("_LightVolumeSize", _volumeTexSize);
    }
Exemplo n.º 15
0
        /// <summary>
        /// Returns the L1 coefficients organized in such a way that are swizzled per channel rather than per coefficient.
        /// </summary>
        /// <param name ="sh"> The SphericalHarmonicsL2 data structure to use to query the information.</param>
        /// <param name ="L1_R">The red channel of all coefficient for the L1 band.</param>
        /// <param name ="L1_G">The green channel of all coefficient for the L1 band.</param>
        /// <param name ="L1_B">The blue channel of all coefficient for the L1 band.</param>
        public static void GetL1(SphericalHarmonicsL2 sh, out Vector3 L1_R, out Vector3 L1_G, out Vector3 L1_B)
        {
            L1_R = new Vector3(sh[0, 1],
                               sh[0, 2],
                               sh[0, 3]);

            L1_G = new Vector3(sh[1, 1],
                               sh[1, 2],
                               sh[1, 3]);

            L1_B = new Vector3(sh[2, 1],
                               sh[2, 2],
                               sh[2, 3]);
        }
    static int set_ambientProbeter(IntPtr L)
    {
        try
        {
            UnityEngine.Rendering.SphericalHarmonicsL2 arg0 = StackTraits <UnityEngine.Rendering.SphericalHarmonicsL2> .Check(L, 1);

            UnityEngine.RenderSettings.ambientProbe = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
        public override bool Equals(object other)
        {
            bool result;

            if (!(other is SphericalHarmonicsL2))
            {
                result = false;
            }
            else
            {
                SphericalHarmonicsL2 rhs = (SphericalHarmonicsL2)other;
                result = (this == rhs);
            }
            return(result);
        }
Exemplo n.º 18
0
        private static void DilateInvalidProbes(Vector3[] probePositions,
                                                List <Brick> bricks, SphericalHarmonicsL2[] sh, float[] validity, ProbeDilationSettings dilationSettings)
        {
            // For each brick
            List <DilationProbe> culledProbes = new List <DilationProbe>();
            List <DilationProbe> nearProbes   = new List <DilationProbe>(dilationSettings.maxDilationSamples);

            for (int brickIdx = 0; brickIdx < bricks.Count; brickIdx++)
            {
                // Find probes that are in bricks nearby
                CullDilationProbes(brickIdx, bricks, validity, dilationSettings, culledProbes);

                // Iterate probes in current brick
                for (int probeOffset = 0; probeOffset < 64; probeOffset++)
                {
                    int probeIdx = brickIdx * 64 + probeOffset;

                    // Skip valid probes
                    if (validity[probeIdx] <= dilationSettings.dilationValidityThreshold)
                    {
                        continue;
                    }

                    // Find distance weighted probes nearest to current probe
                    FindNearProbes(probeIdx, probePositions, dilationSettings, culledProbes, nearProbes, out float invDistSum);

                    // Set invalid probe to weighted average of found neighboring probes
                    var shAverage = new SphericalHarmonicsL2();
                    for (int nearProbeIdx = 0; nearProbeIdx < nearProbes.Count; nearProbeIdx++)
                    {
                        var   nearProbe = nearProbes[nearProbeIdx];
                        float weight    = nearProbe.dist / invDistSum;
                        var   target    = sh[nearProbe.idx];

                        for (int c = 0; c < 9; ++c)
                        {
                            shAverage[0, c] += target[0, c] * weight;
                            shAverage[1, c] += target[1, c] * weight;
                            shAverage[2, c] += target[2, c] * weight;
                        }
                    }

                    sh[probeIdx]       = shAverage;
                    validity[probeIdx] = validity[probeIdx];
                }
            }
        }
    static int set_ambientProbe(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("UnityEngine.RenderSettings.ambientProbe");
#endif
        try
        {
            UnityEngine.Rendering.SphericalHarmonicsL2 arg0 = StackTraits <UnityEngine.Rendering.SphericalHarmonicsL2> .Check(L, 2);

            UnityEngine.RenderSettings.ambientProbe = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Exemplo n.º 20
0
        /// <summary>
        /// Returns all the L2 coefficients.
        /// </summary>
        /// <param name ="sh"> The SphericalHarmonicsL2 data structure to use to query the information.</param>
        /// <param name ="L2_0">The first coefficient for the L2 band.</param>
        /// <param name ="L2_1">The second coefficient for the L2 band.</param>
        /// <param name ="L2_2">The third coefficient for the L2 band.</param>
        /// <param name ="L2_3">The fourth coefficient for the L2 band.</param>
        /// <param name ="L2_4">The fifth coefficient for the L2 band.</param>
        public static void GetL2(SphericalHarmonicsL2 sh, out Vector3 L2_0, out Vector3 L2_1, out Vector3 L2_2, out Vector3 L2_3, out Vector3 L2_4)
        {
            L2_0 = new Vector3(sh[0, 4],
                               sh[1, 4],
                               sh[2, 4]);

            L2_1 = new Vector3(sh[0, 5],
                               sh[1, 5],
                               sh[2, 5]);

            L2_2 = new Vector3(sh[0, 6],
                               sh[1, 6],
                               sh[2, 6]);

            L2_3 = new Vector3(sh[0, 7],
                               sh[1, 7],
                               sh[2, 7]);

            L2_4 = new Vector3(sh[0, 8],
                               sh[1, 8],
                               sh[2, 8]);
        }
 private static extern void INTERNAL_CALL_AddDirectionalLightInternal(ref Vector3 direction, ref Color color, ref SphericalHarmonicsL2 sh);
 private static void ClearInternal(ref SphericalHarmonicsL2 sh)
 {
   SphericalHarmonicsL2.INTERNAL_CALL_ClearInternal(ref sh);
 }
 static int _CreateUnityEngine_Rendering_SphericalHarmonicsL2(IntPtr L)
 {
     LuaScriptMgr.CheckArgsCount(L, 0);
     UnityEngine.Rendering.SphericalHarmonicsL2 obj = new UnityEngine.Rendering.SphericalHarmonicsL2();
     LuaScriptMgr.PushValue(L, obj);
     return 1;
 }
Exemplo n.º 24
0
 /// <summary>
 /// Get a spherical harmonics coefficient.
 /// </summary>
 /// <param name ="sh">The SphericalHarmonicsL2 data structure to get information from.</param>
 /// <param name ="index">The index of the coefficient that is requested (must be less than 9).</param>
 /// <returns>The value of the requested coefficient.</returns>
 public static Vector3 GetCoefficient(SphericalHarmonicsL2 sh, int index)
 {
     Debug.Assert(index < 9);
     return(new Vector3(sh[0, index], sh[1, index], sh[2, index]));
 }
 private static extern void INTERNAL_CALL_ClearInternal(ref SphericalHarmonicsL2 sh);
 private static void ClearInternal(ref SphericalHarmonicsL2 sh)
 {
     SphericalHarmonicsL2.INTERNAL_CALL_ClearInternal(ref sh);
 }
 private static void AddDirectionalLightInternal(Vector3 direction, Color color, ref SphericalHarmonicsL2 sh)
 {
   SphericalHarmonicsL2.INTERNAL_CALL_AddDirectionalLightInternal(ref direction, ref color, ref sh);
 }
 private static void AddDirectionalLightInternal(Vector3 direction, Color color, ref SphericalHarmonicsL2 sh)
 {
     SphericalHarmonicsL2.INTERNAL_CALL_AddDirectionalLightInternal(ref direction, ref color, ref sh);
 }
 private static void AddAmbientLightInternal(Color color, ref SphericalHarmonicsL2 sh)
 {
   SphericalHarmonicsL2.INTERNAL_CALL_AddAmbientLightInternal(ref color, ref sh);
 }
 public void AddAmbientLight(Color color)
 {
     SphericalHarmonicsL2.AddAmbientLightInternal(color, ref this);
 }
 private static extern void INTERNAL_CALL_AddAmbientLightInternal(ref Color color, ref SphericalHarmonicsL2 sh);
Exemplo n.º 32
0
 private static extern void INTERNAL_CALL_GetInterpolatedProbe(ref Vector3 position, Renderer renderer, out SphericalHarmonicsL2 probe);
Exemplo n.º 33
0
	void CalcAmbientLight(Cubemap TempCube){
			//AMBIENT LIGHT CALCULATION
			string path = AssetDatabase.GetAssetPath(TempCube);
			TextureImporter ti =  TextureImporter.GetAtPath(path) as TextureImporter;
			bool OldIsReadable = false;
			int OldMaxSize = 1;
			if (ti!=null){
					OldIsReadable = ti.isReadable;
					ti.isReadable = true;
					OldMaxSize = ti.maxTextureSize;
					ti.maxTextureSize = 32;
					AssetDatabase.ImportAsset(path);
			}
			//CubeResize = new Texture2D(70,70,TextureFormat.ARGB32,false);
			//Color[] colors = new Color[(int)(CubeResize.width*CubeResize.height)];
			Cubemap UseCube = TempCube;
			int MipmapLevel = 0;
			try {
				TempCube.GetPixel(CubemapFace.PositiveX,0,0);
			}
			catch {
				UseCube = defaultBackCube;
			}
			int i = 1;
			if (UseCube.height>4){
				for (i=1;i<9;i++){
					bool Continue = false;
					try {
						Continue = false;
						Color[] colors2 = UseCube.GetPixels(CubemapFace.PositiveX,i);
						if (colors2!=null&&colors2.Length>1)
						Continue = true;
					}
					catch{
						Continue = false;
					}
	//				Debug.Log(Continue);
					if (!Continue)
					break;
				}
			}
			MipmapLevel = i-1;
//			Debug.Log(MipmapLevel);
			
			
			Color PosXo = UseCube.GetPixel(CubemapFace.PositiveX,0,0);
			Color NegXo = UseCube.GetPixel(CubemapFace.NegativeX,0,0);
			Color PosYo = UseCube.GetPixel(CubemapFace.PositiveY,0,0);
			Color NegYo = UseCube.GetPixel(CubemapFace.NegativeY,0,0);
			Color PosZo = UseCube.GetPixel(CubemapFace.PositiveZ,0,0);
			Color NegZo = UseCube.GetPixel(CubemapFace.NegativeZ,0,0);
			
			if (MipmapLevel!=0){
				PosXo = UseCube.GetPixels(CubemapFace.PositiveX,MipmapLevel)[0];
				NegXo = UseCube.GetPixels(CubemapFace.NegativeX,MipmapLevel)[0];
				PosYo = UseCube.GetPixels(CubemapFace.PositiveY,MipmapLevel)[0];
				NegYo = UseCube.GetPixels(CubemapFace.NegativeY,MipmapLevel)[0];
				PosZo = UseCube.GetPixels(CubemapFace.PositiveZ,MipmapLevel)[0];
				NegZo = UseCube.GetPixels(CubemapFace.NegativeZ,MipmapLevel)[0];
			}
			
			Color PosX = Color.Lerp(PosXo,NegYo,0.5f);
			Color NegX = Color.Lerp(NegXo,NegYo,0.5f);
			Color PosY = Color.Lerp(PosYo,PosXo,0.2f);
			Color NegY = Color.Lerp(NegYo,NegXo,0.2f);
			Color PosZ = Color.Lerp(PosZo,NegYo,0.5f);
			Color NegZ = Color.Lerp(NegZo,NegYo,0.5f);
			
			#if UNITY_5
			SphericalHarmonicsL2 L = new SphericalHarmonicsL2();
			L.AddDirectionalLight(new Vector3(1,0,0),PosX,ToGreyscale(PosX));
			L.AddDirectionalLight(new Vector3(0,1,0),PosY,ToGreyscale(PosY));
			L.AddDirectionalLight(new Vector3(0,0,1),PosZ,ToGreyscale(PosZ));
			
			L.AddDirectionalLight(new Vector3(-1,0,0),NegX,ToGreyscale(NegX));
			L.AddDirectionalLight(new Vector3(0,-1,0),NegY,ToGreyscale(NegY));
			L.AddDirectionalLight(new Vector3(0,0,-1),NegZ,ToGreyscale(NegZ));
			

			(previewCam.GetComponent("PreviewCameraSet") as PreviewCameraSet).NewAmbient = L;
			#endif
			Color C = (PosX/6f)+(NegX/6f)+(PosY/6f)+(NegY/6f)+(PosZ/6f)+(NegZ/6f);
			//Debug.Log(C);
			(previewCam.GetComponent("PreviewCameraSet") as PreviewCameraSet).NewAmbientColor = C;
			//L.AddDirectionalLight(new Vector3(0,0,1),new Color(0.5f,0,0),1f);
			//Debug.Log(ToGreyscale(new Color(0.5f,0,0)));
			//CubeResize.SetPixels(colors);
			//CubeResize.Apply(false,false);
			if (ti!=null){
				ti.isReadable = OldIsReadable;
				ti.maxTextureSize = OldMaxSize;
				AssetDatabase.ImportAsset(path);
			}
	}
 private static extern void INTERNAL_CALL_AddAmbientLightInternal(ref Color color, ref SphericalHarmonicsL2 sh);
Exemplo n.º 35
0
 private static extern void INTERNAL_set_ambientProbe(ref SphericalHarmonicsL2 value);
Exemplo n.º 36
0
 /// <summary>
 /// Set the blue channel for each of the L1 coefficients.
 /// </summary>
 /// <param name ="sh">The SphericalHarmonicsL2 data structure to store information on.</param>
 /// <param name ="L1_B">The blue channels for each L1 coefficient.</param>
 public static void SetL1B(ref SphericalHarmonicsL2 sh, Vector3 L1_B)
 {
     sh[2, 1] = L1_B.x;
     sh[2, 2] = L1_B.y;
     sh[2, 3] = L1_B.z;
 }
 public void Clear()
 {
     SphericalHarmonicsL2.ClearInternal(ref this);
 }
Exemplo n.º 38
0
 /// <summary>
 /// Set all L1 coefficients per channel.
 /// </summary>
 /// <param name ="sh">The SphericalHarmonicsL2 data structure to store information on.</param>
 /// <param name ="L1_R">The red channels for each L1 coefficient.</param>
 /// <param name ="L1_G">The green channels for each L1 coefficient.</param>
 /// <param name ="L1_B">The blue channels for each L1 coefficient.</param>
 public static void SetL1(ref SphericalHarmonicsL2 sh, Vector3 L1_R, Vector3 L1_G, Vector3 L1_B)
 {
     SetL1R(ref sh, L1_R);
     SetL1G(ref sh, L1_G);
     SetL1B(ref sh, L1_B);
 }
 private static extern void INTERNAL_CALL_ClearInternal(ref SphericalHarmonicsL2 sh);
 private static extern void INTERNAL_CALL_AddDirectionalLightInternal(ref Vector3 direction, ref Color color, ref SphericalHarmonicsL2 sh);
 private static void AddAmbientLightInternal(Color color, ref SphericalHarmonicsL2 sh)
 {
     SphericalHarmonicsL2.INTERNAL_CALL_AddAmbientLightInternal(ref color, ref sh);
 }
Exemplo n.º 42
0
 /// <summary>
 /// Set L0 coefficient.
 /// </summary>
 /// <param name ="sh">The SphericalHarmonicsL2 data structure to store information on.</param>
 /// <param name ="L0">The L0 coefficient to set.</param>
 public static void SetL0(ref SphericalHarmonicsL2 sh, Vector3 L0)
 {
     sh[0, 0] = L0.x;
     sh[1, 0] = L0.y;
     sh[2, 0] = L0.z;
 }
        public void AddDirectionalLight(Vector3 direction, Color color, float intensity)
        {
            Color color2 = color * (2f * intensity);

            SphericalHarmonicsL2.AddDirectionalLightInternal(direction, color2, ref this);
        }
Exemplo n.º 44
0
 /// <summary>
 /// Set the red channel for each of the L1 coefficients.
 /// </summary>
 /// <param name ="sh">The SphericalHarmonicsL2 data structure to store information on.</param>
 /// <param name ="L1_R">The red channels for each L1 coefficient.</param>
 public static void SetL1R(ref SphericalHarmonicsL2 sh, Vector3 L1_R)
 {
     sh[0, 1] = L1_R.x;
     sh[0, 2] = L1_R.y;
     sh[0, 3] = L1_R.z;
 }
Exemplo n.º 45
0
 public static void GetInterpolatedProbe(Vector3 position, Renderer renderer, out SphericalHarmonicsL2 probe)
 {
   LightProbes.INTERNAL_CALL_GetInterpolatedProbe(ref position, renderer, out probe);
 }
Exemplo n.º 46
0
 /// <summary>
 /// Set the green channel for each of the L1 coefficients.
 /// </summary>
 /// <param name ="sh">The SphericalHarmonicsL2 data structure to store information on.</param>
 /// <param name ="L1_G">The green channels for each L1 coefficient.</param>
 public static void SetL1G(ref SphericalHarmonicsL2 sh, Vector3 L1_G)
 {
     sh[1, 1] = L1_G.x;
     sh[1, 2] = L1_G.y;
     sh[1, 3] = L1_G.z;
 }