Inheritance: BaseTargetResourceTexture
コード例 #1
0
ファイル: ShadowsDirectional.cs プロジェクト: gro-ove/actools
 public Split(float size) {
     Size = size;
     Buffer = TargetResourceDepthTexture.Create();
     Camera = new CameraOrthoShadow {
         NearZ = 0.1f,
         FarZ = ClipDistance * 2f,
         Width = size,
         Height = size
     };
     Camera.SetLens(1f);
 }
コード例 #2
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);
        }
コード例 #3
0
        protected void FinalStep(TargetResourceTexture source, TargetResourceDepthTexture depth, float sizeMultipler = 0.25f) {
            DeviceContext.OutputMerger.SetTargets(_outputBuffer.TargetView);
            DeviceContext.ClearRenderTargetView(_outputBuffer.TargetView, ColorTransparent);
            DeviceContextHolder.QuadBuffers.Prepare(DeviceContext, _ppBasic.LayoutPT);

            _ppBasic.FxScreenSize.Set(new Vector4(Width, Height, 1f / Width, 1f / Height));
            _ppBasic.FxSizeMultipler.Set(sizeMultipler);
            _ppBasic.FxInputMap.SetResource(source.View);
            _ppBasic.FxDepthMap.SetResource(depth.View);
            _ppBasic.TechDepth.DrawAllPasses(DeviceContext, 6);
        }
コード例 #4
0
        private void PrepareOutlineBuffer() {
            if (_outlineBuffer != null) return;
            _outlineBuffer = TargetResourceTexture.Create(Format.R8G8B8A8_UNorm, SampleDescription);
            _outlineDepthBuffer = TargetResourceDepthTexture.Create();

            if (!InitiallyResized) return;
            _outlineBuffer.Resize(DeviceContextHolder, Width, Height);
            _outlineDepthBuffer.Resize(DeviceContextHolder, Width, Height);
        }