AcTools.Render.Base.Shadows.ShadowsDirectional.Initialize C# (CSharp) Method

Initialize() public method

public Initialize ( DeviceContextHolder holder ) : void
holder DeviceContextHolder
return void
        public void Initialize(DeviceContextHolder holder) {
            foreach (var split in Splits) {
                split.Buffer.Resize(holder, _mapSize, _mapSize);
            }

            _rasterizerState = RasterizerState.FromDescription(holder.Device, new RasterizerStateDescription {
                CullMode = CullMode.Front,
                FillMode = FillMode.Solid,
                IsAntialiasedLineEnabled = false,
                IsDepthClipEnabled = true,
                DepthBias = 1000,
                DepthBiasClamp = 0f,
                SlopeScaledDepthBias = 1f
            });

            _depthStencilState = DepthStencilState.FromDescription(holder.Device, new DepthStencilStateDescription {
                DepthWriteMask = DepthWriteMask.All,
                DepthComparison = Comparison.Greater,
                IsDepthEnabled = true,
                IsStencilEnabled = false
            });
        }

Usage Example

Ejemplo n.º 1
0
        protected override void InitializeInner() {
            _deferredLighting = DeviceContextHolder.GetEffect<EffectDeferredLight>();
            _deferredResult = DeviceContextHolder.GetEffect<EffectDeferredResult>();
            _ppBasic = DeviceContextHolder.GetEffect<EffectPpBasic>();

            _gDepthBuffer = TargetResourceDepthTexture.Create();
            _gBufferBase = TargetResourceTexture.Create(Format.R16G16B16A16_Float);
            _gBufferNormal = TargetResourceTexture.Create(Format.R32G32B32A32_Float);
            _gBufferMaps = TargetResourceTexture.Create(Format.R8G8B8A8_UNorm);

            _temporaryDepthBuffer = TargetResourceDepthTexture.Create();
            _temporaryBuffer0 = TargetResourceTexture.Create(Format.R16G16B16A16_Float);
            _temporaryBuffer1 = TargetResourceTexture.Create(Format.R16G16B16A16_Float);
            _temporaryBuffer2 = TargetResourceTexture.Create(Format.R16G16B16A16_Float);
            _temporaryBuffer3 = TargetResourceTexture.Create(Format.R16G16B16A16_Float);
            _outputBuffer = TargetResourceTexture.Create(Format.R8G8B8A8_UNorm);

            _reflectionCubemap = new ReflectionCubemap(1024);
            _reflectionCubemap.Initialize(DeviceContextHolder);

            _sunShadows = new ShadowsDirectional(2048);
            _sunShadows.Initialize(DeviceContextHolder);
        }