protected override void OnCreate()
        {
            if (!UnityEngine.SystemInfo.supportsComputeShaders)
            {
                Enabled = false;
                return;
            }

            m_Query = GetEntityQuery(
                ComponentType.ReadOnly <SharedMeshData>(),
                ComponentType.ReadOnly <BlendShapeTag>(),
                ComponentType.ReadOnly <BlendWeightBufferIndex>()
                );

            m_ComputeShader = Resources.Load <ComputeShader>("BlendShapeComputeShader");
            Debug.Assert(m_ComputeShader != null, $"Compute shader for { typeof(BlendShapeDeformationSystemBase) } was not found!");

            m_PushMeshDataSystem = World.GetOrCreateSystem <PushMeshDataSystemBase>();
            Debug.Assert(m_PushMeshDataSystem != null, "PushMeshDataSystemBase was not found!");

            m_Kernel = m_ComputeShader.FindKernel("BlendShapeComputeKernel");

            m_VertexCount                = Shader.PropertyToID("g_VertexCount");
            m_SharedMeshStartIndex       = Shader.PropertyToID("g_SharedMeshStartIndex");
            m_DeformedMeshStartIndex     = Shader.PropertyToID("g_DeformedMeshStartIndex");
            m_InstanceCount              = Shader.PropertyToID("g_InstanceCount");
            m_BlendShapeCount            = Shader.PropertyToID("g_BlendShapeCount");
            m_BlendShapeVertexStartIndex = Shader.PropertyToID("g_BlendShapeVertexStartIndex");
            m_BlendShapeWeightStartIndex = Shader.PropertyToID("g_BlendShapeWeightstartIndex");
        }
        protected override void OnCreate()
        {
#if ENABLE_COMPUTE_DEFORMATIONS
            if (!UnityEngine.SystemInfo.supportsComputeShaders)
            {
                Enabled = false;
                return;
            }
#endif

            m_Query = GetEntityQuery(
                ComponentType.ReadOnly <SharedMeshData>(),
                ComponentType.ReadOnly <SkinningTag>(),
                ComponentType.ReadOnly <SkinMatrixBufferIndex>()
                );

            m_ComputeShader = Resources.Load <ComputeShader>("SkinningComputeShader");
            Debug.Assert(m_ComputeShader != null, $"Compute shader for { typeof(SkinningDeformationSystemBase) } was not found!");

            m_PushMeshDataSystem = World.GetOrCreateSystem <PushMeshDataSystemBase>();
            Debug.Assert(m_PushMeshDataSystem != null, "PushMeshDataSystemBase was not found!");

            m_Kernel = m_ComputeShader.FindKernel("SkinningComputeKernel");

            m_VertexCount            = Shader.PropertyToID("g_VertexCount");
            m_SharedMeshStartIndex   = Shader.PropertyToID("g_SharedMeshStartIndex");
            m_DeformedMeshStartIndex = Shader.PropertyToID("g_DeformedMeshStartIndex");
            m_InstancesCount         = Shader.PropertyToID("g_InstanceCount");
            m_SharedMeshBoneCount    = Shader.PropertyToID("g_SharedMeshBoneCount");
            m_SkinMatricesStartIndex = Shader.PropertyToID("g_SkinMatricesStartIndex");
        }
        protected override void OnCreate()
        {
            if (!UnityEngine.SystemInfo.supportsComputeShaders)
            {
                Enabled = false;
                return;
            }

            m_Query = GetEntityQuery(
                ComponentType.ReadOnly <BlendShapeWeight>()
                );

            m_BlendShapeTagQuery = GetEntityQuery(
                ComponentType.ReadOnly <BlendShapeTag>()
                );

            m_PushMeshDataSystem = World.GetOrCreateSystem <PushMeshDataSystemBase>();
            Debug.Assert(m_PushMeshDataSystem != null, "PushMeshDataSystemBase system was not found in the world!");
        }
Ejemplo n.º 4
0
        protected override void OnCreate()
        {
#if ENABLE_COMPUTE_DEFORMATIONS
            if (!UnityEngine.SystemInfo.supportsComputeShaders)
            {
                Enabled = false;
                return;
            }
#endif

            m_Query = GetEntityQuery(
                ComponentType.ReadOnly <SkinMatrix>()
                );

            m_SkinningTagQuery = GetEntityQuery(
                ComponentType.ReadOnly <SkinningTag>()
                );

            m_PushMeshDataSystem = World.GetOrCreateSystem <PushMeshDataSystemBase>();
            Debug.Assert(m_PushMeshDataSystem != null, "PushMeshDataSystemBase system was not found in the world!");
        }