Hi everyone,
How can I ensure my shader has access to the depthBuffer, and is this what I want if I want to access scene depth information as a sampler2D? I’m also trying to access vert to fragment depth information using the varying vDepth = GetDepth(gl_Position) in the vertex shader. I’m implementing (someone else’s) depth of field shader, but suspect I’m not getting the right depth information because the shader behaves as if plane of focus is always 0 from the camera. Also, I am having a hard time understanding from the documentation how the various xml files work together to ensure the shader is invoked with the required information made available (such as depth). If someone could at least point me to a good explanation of how the xml works or explain it, that would be much appreicated. Thanks! Below is my confused xml.
Docs I’m using in addition to the examples:
code.google.com/p/urho3d/wiki/Shaders
code.google.com/p/urho3d/wiki/RenderPaths
Shaders/DOF.xml
<shaders>
<shader/>
</shaders>
PostProcess/DOF.xml
<renderpath>
<rendertarget name="dof" tag="DOF" format="rgba" filter="true"/>
<command type="quad" tag="DOF" vs="DOF" ps="DOF" output="viewport">
<texture unit="diffuse" name="viewport" />
<texture unit="depth" name="viewport" />
</command>
</renderpath>