void PopulateKernels() { DanbiKernelHelper.AddKernalIndexWithKey(EDanbiKernelKey.Dome_Reflector_Cube_Panorama, danbiShader.FindKernel("Dome_Reflector_Cube_Panorama")); // DanbiKernelHelper.AddKernalIndexWithKey(EDanbiKernelKey.Dome_Reflector_Cylinder_Panorama, // rayTracingShader.FindKernel("Dome_Reflector_Cylinder_Panorama")); }
public void RebuildMeshShape() { var control = DanbiManager.instance.shaderControl; m_panoramaMeshData.Clear(); m_reflectorMeshData.Clear(); m_meshData.Clear(); // fill out with the meshData for mesh data and the shape data for Shader. switch (m_texType) { case EDanbiTextureType.Regular: m_panoramaRegular.RebuildMeshShapeForComputeShader(ref m_panoramaMeshData); break; case EDanbiTextureType.Faces4: m_panorama4faces.RebuildMeshShapeForComputeShader(ref m_panoramaMeshData); break; case EDanbiTextureType.Panorama: m_panorama360.RebuildMeshShapeForComputeShader(ref m_panoramaMeshData); break; } m_reflector.RebuildMeshShapeForComputeShader(ref m_reflectorMeshData); m_meshData.JoinData(m_panoramaMeshData, m_reflectorMeshData); // 3. Find Kernel and set it as a current kernel. DanbiKernelHelper.CurrentKernelIndex = DanbiKernelHelper.CalcCurrentKernelIndex(m_meshType, m_panoramaType); // 4. Populate the compuate buffer dictionary. var vtxComputeBuffer = DanbiComputeShaderHelper.CreateComputeBuffer_Ret(m_meshData.Vertices, 12); control.bufferDict.AddBuffer_NoDuplicate("_Vertices", vtxComputeBuffer); var idxComputeBuffer = DanbiComputeShaderHelper.CreateComputeBuffer_Ret(m_meshData.Indices, 4); control.bufferDict.AddBuffer_NoDuplicate("_Indices", idxComputeBuffer); var texcoordsComputeBuffer = DanbiComputeShaderHelper.CreateComputeBuffer_Ret(m_meshData.Texcoords, 8); control.bufferDict.AddBuffer_NoDuplicate("_Texcoords", texcoordsComputeBuffer); }