public unsafe static bool GetAdditionalBakedProbes(int id, NativeArray <SphericalHarmonicsL2> outBakedProbeSH, NativeArray <float> outBakedProbeValidity, NativeArray <float> outBakedProbeOctahedralDepth) { if (outBakedProbeSH == null || !outBakedProbeSH.IsCreated || outBakedProbeValidity == null || !outBakedProbeValidity.IsCreated || outBakedProbeOctahedralDepth == null || !outBakedProbeOctahedralDepth.IsCreated) { Debug.LogError("Output arrays need to be properly initialized."); return(false); } const int octahedralDepthMapTexelCount = 64; // 8*8 int numEntries = outBakedProbeSH.Length; if (outBakedProbeOctahedralDepth.Length != numEntries * octahedralDepthMapTexelCount) { Debug.LogError("Octahedral array must provide " + numEntries * octahedralDepthMapTexelCount + " floats."); return(false); } if (outBakedProbeValidity.Length != numEntries) { Debug.LogError("All output arrays must have equal size."); return(false); } void *shPtr = NativeArrayUnsafeUtility.GetUnsafePtr(outBakedProbeSH); void *validityPtr = NativeArrayUnsafeUtility.GetUnsafePtr(outBakedProbeValidity); void *octahedralDepthPtr = NativeArrayUnsafeUtility.GetUnsafePtr(outBakedProbeOctahedralDepth); return(GetAdditionalBakedProbes(id, shPtr, validityPtr, octahedralDepthPtr, outBakedProbeSH.Length)); }
public unsafe static bool GetAdditionalBakedProbes(int id, NativeArray <SphericalHarmonicsL2> outBakedProbeSH, NativeArray <float> outBakedProbeValidity) { if (outBakedProbeSH == null || !outBakedProbeSH.IsCreated || outBakedProbeValidity == null || !outBakedProbeValidity.IsCreated) { Debug.LogError("Output arrays need to be properly initialized."); return(false); } if (outBakedProbeSH.Length != outBakedProbeValidity.Length) { Debug.LogError("Both output arrays must have equal size."); return(false); } void *shPtr = NativeArrayUnsafeUtility.GetUnsafePtr(outBakedProbeSH); void *validityPtr = NativeArrayUnsafeUtility.GetUnsafePtr(outBakedProbeValidity); return(GetAdditionalBakedProbes(id, shPtr, validityPtr, outBakedProbeSH.Length)); }
internal unsafe static void RequestLights(Light[] lights, System.IntPtr outLightsPtr, int outLightsCount) { var outLights = NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray <LightDataGI>((void *)outLightsPtr, outLightsCount, Allocator.None); s_RequestLightsDelegate(lights, outLights); }