Bloom effect activate for all objects Except

Hello guys, i’ve heard about the BloomMode.Objects, but this is not usable because i’d like to use texture bloom on terrain tiles, and since I Have 3 textures applied and its generated I cannot define a bloomMap for the terrain…

is there a way to just disable bloom for 1 object? instead of adding the glow technique to all my materials and defining glow colors or maps?

I just want 1 object to not be glowed, and its the text billboard, the text unreadable with all the bloom applied on it…

thx!!!

In simple terms, you need to render everything, apply the glow filter, then render your text after.

Adding your text to the translucent bucket would be the easiest solution, but it will appear on top of everything. If thats acceptable, then you are done, otherwise i’m not sure if there is an easy way to have proper depth checking for the text. You would need to somehow read from the scene depth texture, and do discarding in a shader for the text yourself, I think. There may be a better way though.

@wezrule said: Adding your text to the translucent bucket would be the easiest solution, but it will appear on top of everything. If thats acceptable, then you are done, otherwise i'm not sure if there is an easy way to have proper depth checking for the text. You would need to somehow read from the scene depth texture, and do discarding in a shader for the text yourself, I think. There may be a better way though.
Actually, Depth test is working with the translucent bucket too. It's just that it's rendered after everything else.

@navycougar An other solution would be to set the glow color to black on the objects you want to exclude from the effect

Another one would be to remove the Glow technique from the material of non glowing objects (also it woud be the best performance solution because non glowing objects wouldn’t be rendered in the glow pass)

1 Like

I tested it with the glow filter, and it always appears on top though (rendering to the translucent bucket with depth testing set to true)

@wezrule said: I tested it with the glow filter, and it always appears on top though (rendering to the translucent bucket with depth testing set to true)
mhh that's strange, it shoudln't. I'm gonna look into it
1 Like

ok, heres a test case to make it easier:

[java]package mygame;

import com.jme3.app.SimpleApplication;
import com.jme3.app.StatsAppState;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.post.FilterPostProcessor;
import com.jme3.post.filters.BloomFilter;
import com.jme3.renderer.queue.RenderQueue;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box;

public class TestGlow extends SimpleApplication {

public static void main(String[] args) {
    TestGlow app = new TestGlow();
    app.start();
}

@Override
public void simpleInitApp() {

    stateManager.detach(stateManager.getState(StatsAppState.class));

    flyCam.setMoveSpeed(10);
    FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
    BloomFilter bloom = new BloomFilter(BloomFilter.GlowMode.Scene);
    bloom.setBloomIntensity(2);
    bloom.setDownSamplingFactor(1f);
    fpp.addFilter(bloom);
    viewPort.addProcessor(fpp);

    Box b = new Box(1, 1, 1);
    Geometry geom = new Geometry("box", b);
    Material m2 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    m2.setColor("Color", ColorRGBA.Blue);
    geom.setMaterial(m2);
    rootNode.attachChild(geom);

    Box b1 = new Box(1, 1, 1);
    Geometry geom1 = new Geometry("box1", b1);
    geom1.move(3, 0, 0);
    Material m3 = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    m3.setColor("Color", ColorRGBA.Green);
    geom1.setQueueBucket(RenderQueue.Bucket.Translucent);
    m3.getAdditionalRenderState().setDepthTest(true);
    geom1.setMaterial(m3);
    rootNode.attachChild(geom1);
}

}[/java]

Edit: @nehon Although I noticed in https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:jme3_renderbuckets you said

The filter post processor hijacks the rendering process and renders a full screen quad with the texture of the scene applied on it.

Once it’s done the depth buffer is 0, so it’s impossible to render a queue over it with proper depth test

And I think its the same with all filters, I get the same with my Night Vision filter

1 Like
@wezrule said:

Edit: @nehon Although I noticed in https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:jme3_renderbuckets you said

And I think its the same with all filters, I get the same with my Night Vision filter


Yes but in the case of the translucent bucket I copy the depth buffer over so it should work.
Thanks for the test case

ah ok. No worries, good luck :slight_smile:

heh ok…I just forgot the most important thing.
you need to add a TranslucentBucketFilter at the end of the filter stack so that it handles the translucent bucket render instead of the rendermanager.

1 Like

:-o, woop, and actually your document already said that, ups ^^

ok @navycougar, you got a few solutions to choose from now