Hello,

to get my blur shader working I've modified my code in the last few
hours, based on an old OSG thread of Marcus Fritzen and Shuxing Xiao,
where they have tried to implement a multipass based shader. To follow
theirs instructions I've added another camera to render the 2nd RTT. So
i got these steps, where each step implements a camera:

1. Render Scene to RTT1  (texture)
2. Render Scene to RTT2 (texture2) and bind Shader to the camera
StateSet where the RTT1 is the input for the shader and RTT2 the output
3. Create Render-Quad bind RTT2 as texture and render it.

If i disable step 2 nothing is rendered, because the RTT2 is invalid,
what is correct. If i enable Step 2 i got the scene result on the quad.
But the shader is not executed. Is it impossible to execute a shader
using the camera states?

If i bind the shader to the quad StateSet the shader is executed
(colored shader output) but the blurring is missed. The blur code is
quite simple and should work:

vec4 currentValue = texture2D (Next, vTexCoord).rgba;
 vec4 lastValue = texture2D (Prev, vTexCoord).rgba;
   
 // the resulting color value is the combination of blurred and
non-blurred map
gl_FragColor = mix(currentValue, lastValue, fBlur); //*vec4(1.0, 1.0,
0.0, 0.0);

I'm running out of ideas what could be conceptional wrong. Every help is
preferable.
Best regards,
Christian

P.S.: I've attached the new modified code fragment to this post.

Christian Heine wrote:
> Hello,
>
> actually i try to integrate a blur shader to my test scene. To realize
> this I've implemented a small scene with a dot3 textured quad (done by a
> shader). This scene is rendered to a texture oriented on the distortion
> example. This works fine, but when i bind the secondary blur shader on
> this render to texture pass i got no blur effect. The 2nd shader is
> definitively executed, if i set the glFragColor of this second shader to
> some test value (i.e. blue) the texture is rendered by this color value.
> I've attached the actual rtt-Pass with the 2nd shader binding. Have i
> overseen something?
>
> Best regards,
> Christian
>
>   

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to