Dear forum,
For previous brief on the blur issue (now solved) see http://www.jmonkeyengine.com/jmeforum/index.php?topic=10344.0.
My (hopefully last, concerning blur) problem is that the BlurRenderPass blurs the objects that are placed under the node passed to the Pass. However, the amount of blur is the same for the objects.
Is there any chance that I can set a blur value per object, that can be retrieved on the .frag file, so that the blur can be distinct for each object?
here is the .frag file i am using. I adapted it from the .frag from the DepthOfFieldRenderPass. It may also look simple or not optimized, but I have very little knowledge on .frag or .vert
uniform float blurValue;
uniform sampler2D mainTexture;
void main()
{
vec4 texCol = texture2D(mainTexture,gl_TexCoord[0].st);
// blurValue must be written into [0, 1]
vec4 sum = vec4(blurValue);
if (texCol.a < 0.1)
{
texCol.a = 0.0;
}
sum.a = texCol.a;
gl_FragColor = sum;
}
BlurValue is the amount I set from the BlurRenderPass with the following line:
depthShader.setUniform("blurValue", 0.9f);
before I render the texture.
Thanks in advance,