Exemple #1
0
 void OnDestroy()
 {
     _particleBuffer.Release();
     _deltaDensBuffer.Release();
     _cellStartEndBuffer.Release();
     _particleIdBuffer.Release();
 }
Exemple #2
0
    private void OnDestroy()
    {
        _divergenceTexture.Release();

        _velocityBuffer.Release();
        _pressureBuffer.Release();
        _previewBuffer.Release();
    }
Exemple #3
0
    // DEINIT.
    private void DeInitSystem()
    {
        sTotalParticleCount -= mMaxParticleCount;

        mPositionBuffer.Release();
        mVelocityBuffer.Release();
        mLifetimeBuffer.Release();

        mColorBuffer.Release();
        mHaloBuffer.Release();
        mScaleBuffer.Release();
        mTransperancyBuffer.Release();

        mColorLifetimePointsBuffer.Release();
        mHaloLifetimePointsBuffer.Release();
        mScaleLifetimePointsBuffer.Release();
        mTransparencyLifetimePointsBuffer.Release();

        mSphereColliderResultBuffer.Release();
    }
Exemple #4
0
    // SHUTDOWN.
    static void Shutdown()
    {
        sMergedParticleCount = 0;
        sTotalParticleCount  = 0;

        sGPUParticleSystemDictionary.Clear();
        sGPUParticleSystemDictionary = null;

        sComputeShader       = null;
        sKernelUpdate        = -1;
        sKernelEmitt         = -1;
        sKernelResult        = -1;
        sKernelMergeInitSort = -1;
        sKernelSort          = -1;
        foreach (KeyValuePair <Mesh, EmittMeshInfo> it in sEmittMeshInfoDictionary)
        {   // Release compute buffers.
            it.Value.mVertexBuffer.Release();
            it.Value.mIndexBuffer.Release();
        }
        sEmittMeshInfoDictionary.Clear();
        sGPUParticleAttractorBuffer.Release();
        sGPUParticleVectorFieldBuffer.Release();
        sGPUParticleSphereColliderBuffer.Release();
        sGPUColliderResultSwapBuffer.Release();

        sMergedPositionBuffer.Release();
        sMergedVelocityBuffer.Release();
        sMergedLifetimeBuffer.Release();

        sMergedColorBuffer.Release();
        sMergedHaloBuffer.Release();
        sMergedScaleBuffer.Release();
        sMergedTransperancyBuffer.Release();

        sSortElementSwapBuffer.Release();

        sRandomIndexBuffer.Release();

        sRenderMaterial = null;
    }
Exemple #5
0
 /// <summary>
 /// Release memory block.
 /// </summary>
 public void Release()
 {
     mSwapBuffer.Release();
 }