Пример #1
0
void PostProcessor::Render(ID3D11DeviceContext* deviceContext, ID3D11ShaderResourceView* input,
                           ID3D11ShaderResourceView* depthBuffer, const Camera& camera,
                           ID3D11RenderTargetView* output, float deltaSeconds)
{
    PostProcessorBase::Render(deviceContext, input, output);

    TempRenderTarget* bloom = Bloom(input);

    // Apply tone mapping
    ToneMap(input, bloom->SRView, output);

    bloom->InUse = false;

    // Check for leaked temp render targets
    for(uint64 i = 0; i < tempRenderTargets.size(); ++i)
        Assert_(tempRenderTargets[i]->InUse == false);
}
//Draw our post process effects using ping pong
void Renderer::DrawPostProcess(){
	glDisable(GL_DEPTH_TEST);
	SetupPPMatrices();
	glBindFramebuffer(GL_FRAMEBUFFER, processFBO);

	if (sobel) Sobel();
	if (sobelDepth) SobelDepth();
	if (quantizeCol) QuantizeCol();
	if (fog) Fog();
	if (bloom) Bloom();
	if (dubVis) DoubleVision();
	if (blur) Blur();

	glBindFramebuffer(GL_FRAMEBUFFER, 0);
	glUseProgram(0);

	glEnable(GL_DEPTH_TEST);
}
Пример #3
0
void PostProcessor::Render(ID3D11DeviceContext* deviceContext, ID3D11ShaderResourceView* input,
                            ID3D11RenderTargetView* output)
{
    PostProcessorBase::Render(deviceContext, input, output);

    constantBuffer.ApplyChanges(deviceContext);
    constantBuffer.SetPS(deviceContext, 1);

    // Calculate the average luminance first
    CalcAvgLuminance(input);

    // Now do the bloom
    TempRenderTarget* bloom = NULL;
    Bloom(input, bloom);

    // Apply tone mapping
    ToneMap(input, bloom->SRView, output);

    bloom->InUse = false;

    currLumTarget = !currLumTarget;
}