Any one used this? it doesnt work for me

any one used this? it doesnt work for me

I want somthing like this:

I don’t know what “doesn’t work” means exactly or what you tried… but note that you can get a similar effect without any special material or anything.

For example, create a geometry with the same mesh and a regular unshaded material called wireMaterial. Then give it the following settings: (or something like it)

    wireMaterial.getAdditionalRenderState().setWireframe(true);
    wireMaterial.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
    wireMaterial.getAdditionalRenderState().setLineWidth(2);
    wireMaterial.getAdditionalRenderState().setPolyOffset(-3f,-3f);
    wireMaterial.getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.Front);

That will look very much like the examples in the linked code. If you want the glow effect then you would need bloom in object mode or something with the glow color set on the material.

4 Likes

Also don’t be afraid to tag @polinc

1 Like

It’s too early guys :sleeping:. Also the lib uses Paul’s technique. There is no magic there. Does the Test work?

2 Likes

6 am was indeed “too early” :smiley:

1 Like

no, it’s not like the Image I post.

no, test doesnt work.

But what is “doesn’t work”. You need to be a lot more specific.

1 Like

indeed, you need provide stack trace of error or something that would help fix.

there is not an error.
when I used OUTLINER_TYPE_FILTER nothing changed at all.
when I used OUTLINER_TYPE_MATERIAL a mesh added to the scene but in vector3f.zero position and not changing by the model animation, and have not correct scale.

I need something straightforward like this:

can I use shaderblowlib to do that?

Scaling works. I checked it with cube.scale(2.0f) in the Test. As for animation I havent tested it so I cannot say anything. OUTLINER_TYPE_FILTER should work. Please provide a screen from your scene

1 Like

It works for me… see demo video from second: 00:50

1 Like

1-is it geometry? or a node(parent) of other geometries?
2-I checked the test and it works with cube but not with an animated human model. is it working when playing an animation?

It’s a Node (parent) and it’s working fine when playing an animation (see below video):

In this video I’m adding 2 simple models, one of them is the green Ninja which you can find in many JME sample codes, The other one , the Dragon can be downloaded from Sketchfab.com , Then I’m playing some animation on both models and showing the scene in debug view and regular view.

1 Like

can you please show me how to use the outlier code?

I’m using it according to the sample code. Not doing anything special…

public void showHideOutline(Spatial sp, boolean show) {
        if(outliner==null) {
            initOutliner();
        }

        if(show) {
            outliner.select(sp);
        } else {
            outliner.deselect(sp);
        }

    }
private void initOutliner() {
        FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
        viewPort.addProcessor(fpp);
        outliner=new SelectObjectOutliner();
        outliner.initOutliner(SelectObjectOutliner.OUTLINER_TYPE_FILTER, 2, ColorRGBA.Yellow,rootNode,fpp, renderManager, assetManager, cam);

    }
2 Likes

which version of the JME? I used 3.2st but not working at all.

I was curious when I saw this thread, so I added the Outliner in my projcet, and I just tested it on JME 3.2 and it works.

I did find that using SelectObjectOutliner.OUTLINER_TYPE_FILTER works but using SelectObjectOutliner.OUTLINER_TYPE_MATERIAL did not work.

I was able to fix the Material mode by attaching the new wireframe geometry to the target spatial, rather than attaching it to the rootNode as it was previously coded.

Also thanks you @polinc for the very useful library! :slightly_smiling_face: I like using filter mode for outlining friendly players, since the Filter mode continues to show the outline even when the the outline object is behind other spatials and out of line-of-sight.

Whereas the material mode is useful for objects that need the outline to abide by the usual scene depth.

If you’re using FilterMode on 3.2 then it should be working. If not, then my best guess would be that youur filterPostProcessor is not setup correctly, or you’re passing in bad/null references to assetManager and renderManager.

1 Like

This type of thing will be nice for red vs blue in pk games. I was going to use a halo but this is much better.

1 Like

I was able to fix the Material mode by attaching the new wireframe geometry to the target spatial, rather than attaching it to the rootNode as it was previously coded.

Thanks for pointing this out. Actually the lib doesn’t force you to use rootNode . My mistake was to use ‘rootNode’ name for a variable. I pushed changes and commented the methods.

2 Likes