Shaderblow plugin usage example request (Glass shader)

Hi, i’m very new to jmonkeyengine ad i’m really loving it!

So, i’ve activated shaderblow plugin to use the Toon edge effect with the Glass shader. The problem is that i really don’t know how i can use that feature. The error message is always asset not found exception

Can someone publish a real step by step guide for a newbie like me?

(Terrible english, i know…) :slight_smile:

Please post your exception so I can help.

Really, i don’t know what kind of code i could ever post…i’ve made all kind of cut and paste with no success! For example, can i see the shaderblow’s assets somewhere in the default libraries? I’ve found anything…i’m walking in the fog!

@gnerpo said: The error message is always asset not found exception...
@Pixelapp said: Please post your exception so I can help.
@gnerpo said: Really, i don't know what kind of code i could ever post...i've made all kind of cut and paste with no success! For example, can i see the shaderblow's assets somewhere in the default libraries? I've found anything...i'm walking in the fog!

Which part of that was unclear? You get an exception… please post more than “I got an exception”. There should have been more information in the message (like the asset that wasn’t found) along with perhaps a stack trace. The part you’ve included is only maybe 10% of the useful information.

Thanks for the reply!

Ok, i’ve solved the previous problem. Now i have no exceptions and this is the code:

[java]
package mygame;

import com.jme3.app.SimpleApplication;
import com.jme3.light.DirectionalLight;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.renderer.RenderManager;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box;

/**

  • test

  • @author normenhansen
    */
    public class Main extends SimpleApplication {

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

    @Override
    public void simpleInitApp() {
    Box b = new Box(1, 1, 1);
    Geometry geom = new Geometry(“Box”, b);

     Material mat = new Material(assetManager, "ShaderBlow/Materials/Glass/newMaterial.j3m");
     //mat.setColor("Color", ColorRGBA.Blue);
     geom.setMaterial(mat);
     
     DirectionalLight sun = new DirectionalLight();
     sun.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f));
     rootNode.addLight(sun);
     
     rootNode.attachChild(geom);
    

    }
    }
    [/java]

And here is the j3m file:
[java]
Material My Material : ShaderBlow/MatDefs/Glass/Glass.j3md {
MaterialParameters {

    RefMap : Flip ShaderBlow/Textures/Water256.dds
    Multiply_Color : 1.1 1.5 1.1 1.0
    colorIntensity : 0.79999995
    Nor_Inv_Y : true
    NormalMap : ShaderBlow/Models/LightBlow/jme_lightblow_nor.png
    ChromaticAbberation : true
    abberIndex : 0.04
    specularIntensity : 0.59999996
    
    Toon : true
    EdgesColor : 0.2 1.0 0.0 1.0
    EdgeSize : 5.11
    Fog_Edges : true
 }
AdditionalRenderState {
}

}
[/java]

I can see the j3m material file and material preview as expected. But when I run the file Main.java i can only see a blue box…why?

Solved with loadMaterial:
[java]
geom.setMaterial(assetManager.loadMaterial(“ShaderBlow/Materials/Glass/newMaterial.j3m”));
[/java]

Now I would like to see the colored edges as expected, maybe is a j3m parameter problem?

All solved! I’ve used a too big number for parameter edgesize thinking to get a bigger outside line…! :slight_smile:

Now it’s all solved but there’s another question. I’ve imported the shaderblow folder in my asset folder and everything worked fine. But, i supposed i don’t need to do that (copy entire folder) because i’ve activated the shaderblow plugin…! There is a more correct way to have shaderblow using the plugin, without copying the shaderblow folder?

There is a more correct way to have shaderblow using the plugin, without copying the shaderblow folder?

Indeed! You already added the plugin, which contains the assets. If you are using the sdk it shows you on assetManager.loadMaterial(“”) the possible assets.
So you can just the delete the assets you copied in your assetsfolder from shaderblow and it should work aswell.

Ok, thanks. I’m using the SDK but i don’t know how i can show possible assets…

type

assetManager.loadMaterial("[Ctrl-Space]

to see a list

Thank you very much! :slight_smile: