2 pass compositor script

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
HH7
Gnoblar
Posts: 1
Joined: Mon Oct 27, 2014 9:23 pm

2 pass compositor script

Post by HH7 » Mon Oct 27, 2014 9:38 pm

Hi,

I have a problem with compositor script for Gazebo. I want to impement deep of field effect and that kind of effect require shader with 2 passes. First pass return depth map which is second pass input. Second pass should transform output from other compositor based on depth map. I tried to write this myself and I found some samples of DOF effect shader in glsl language but I don't know how to write compositor configuration script:( Below is my code but it doen't work. Can you help me?

Code: Select all

compositor CameraNoise/DOF
{
    technique
    {
        // Temporary textures
        texture rt0 target_width target_height PF_A8R8G8B8
	texture DT target_width target_height PF_A8R8G8B8


        
        
        target rt0
        {
            // Render output from previous compositor (or original scene)
            input previous
        }
	target rt1
        {
            // Start with clear output
            input none
            // Draw a fullscreen quad with noise
            pass render_quad
            {
                // Renders a fullscreen quad with a material
                material Gazebo/DOFDepthMapCamera
                input 0 rt1
            }
        }
        target_output
        {
            // Start with clear output
            input none
            // Draw a fullscreen quad with noise
            pass render_quad
            {
                // Renders a fullscreen quad with a material
                material Gazebo/DOFCamera
                input 0 rt0 rt1
            }
        }
    }
}
thank you in advance and sorry for my english
Oskar
0 x

Post Reply