public void Regenerate3DTexture()
    {
        var is3DSource =
            _NoiseSource.HasFlag(NoiseSource.SimplexNoiseCompute) ||
            _NoiseSource.HasFlag(NoiseSource.Texture3DCompute) ||
            _NoiseSource.HasFlag(NoiseSource.Texture3D)
        ;

        if (!is3DSource)
        {
            return;
        }


        switch (_NoiseSource)
        {
        case NoiseSource.Texture3D:
            _fogTexture3D = TextureUtilities.CreateFogLUT3DFrom2DSlices(_FogTexture2D, _3DNoiseTextureDimensions);
            break;

        case NoiseSource.Texture3DCompute:
            _fogTexture3DCompute = TextureUtilities.CreateFogLUT3DFrom2DSlicesCompute(_FogTexture2D, _3DNoiseTextureDimensions, _Create3DLUTShader);
            break;

        case NoiseSource.SimplexNoiseCompute:
            _fogTexture3DSimplex = TextureUtilities.CreateFogLUT3DFromSimplexNoise(_3DNoiseTextureDimensions, _Create3DLUTShader);
            break;
        }
    }
Beispiel #2
0
    public void Regenerate3DTexture()
    {
        var is3DSource =
            fogOptions.noiseSource.HasFlag(NoiseSource.SimplexNoiseCompute) ||
            fogOptions.noiseSource.HasFlag(NoiseSource.Texture3DCompute) ||
            fogOptions.noiseSource.HasFlag(NoiseSource.Texture3D);

        if (!is3DSource)
        {
            return;
        }

        switch (fogOptions.noiseSource)
        {
        case NoiseSource.Texture3D:
            _fogTexture3D = TextureUtilities.CreateFogLUT3DFrom2DSlices(fogTexture2D, fogOptions.noiseTexture3DDimensions);
            break;

        case NoiseSource.Texture3DCompute:
            _fogTexture3DCompute =
                TextureUtilities.CreateFogLUT3DFrom2DSlicesCompute(fogTexture2D, fogOptions.noiseTexture3DDimensions,
                                                                   create3DLutShader);
            break;

        case NoiseSource.SimplexNoiseCompute:
            _fogTexture3DSimplex =
                TextureUtilities.CreateFogLUT3DFromSimplexNoise(fogOptions.noiseTexture3DDimensions, create3DLutShader);
            break;
        }
    }