void TilingPostProcess::InputPin(uint32_t index, TexturePtr const & tex) { RenderFactory& rf = Context::Instance().RenderFactoryInstance(); downsample_tex_ = rf.MakeTexture2D(tex->Width(0) / 2, tex->Height(0) / 2, 4, 1, tex->Format(), 1, 0, EAH_GPU_Read | EAH_GPU_Write | EAH_Generate_Mips); downsampler_->InputPin(index, tex); downsampler_->OutputPin(index, downsample_tex_); PostProcess::InputPin(index, downsample_tex_); }
void AsciiArtsPostProcess::InputPin(uint32_t index, TexturePtr const & tex) { RenderFactory& rf = Context::Instance().RenderFactoryInstance(); downsample_tex_ = rf.MakeTexture2D(tex->Width(0) / 2, tex->Height(0) / 2, 4, 1, tex->Format(), 1, 0, EAH_GPU_Read | EAH_GPU_Write | EAH_Generate_Mips); downsampler_->InputPin(index, tex); downsampler_->OutputPin(index, downsample_tex_); PostProcess::InputPin(index, downsample_tex_); *cell_per_row_line_ep_ = float2(static_cast<float>(CELL_WIDTH) / tex->Width(0), static_cast<float>(CELL_HEIGHT) / tex->Height(0)); }
void SSSBlurPP::InputPin(uint32_t index, TexturePtr const & tex) { PostProcess::InputPin(index, tex); if (0 == index) { RenderFactory& rf = Context::Instance().RenderFactoryInstance(); blur_x_tex_ = rf.MakeTexture2D(tex->Width(0), tex->Height(0), 1, 1, tex->Format(), 1, 0, EAH_GPU_Read | EAH_GPU_Write, NULL); blur_y_tex_ = rf.MakeTexture2D(tex->Width(0), tex->Height(0), 1, 1, tex->Format(), 1, 0, EAH_GPU_Read | EAH_GPU_Write, NULL); blur_x_fb_->Attach(FrameBuffer::ATT_Color0, rf.Make2DRenderView(*blur_x_tex_, 0, 1, 0)); blur_x_fb_->Attach(FrameBuffer::ATT_DepthStencil, frame_buffer_->Attached(FrameBuffer::ATT_DepthStencil)); blur_y_fb_->Attach(FrameBuffer::ATT_Color0, rf.Make2DRenderView(*blur_y_tex_, 0, 1, 0)); blur_y_fb_->Attach(FrameBuffer::ATT_DepthStencil, frame_buffer_->Attached(FrameBuffer::ATT_DepthStencil)); if (mrt_blend_support_) { frame_buffer_->Attach(FrameBuffer::ATT_Color1, rf.Make2DRenderView(*blur_y_tex_, 0, 1, 0)); } } }