ShaderBlow status?

Is there a fully updated ShaderBlow working with JME 3.1 somewhere?

I was reading many threads about ShaderBlow.
As it is (was?) a JME SDK plugin also.
I just downloaded JME SDK but the update server seems down, so I cant look for news there. But as I read, it seems many plugins are still for JME 3.0, so they are not updated…

I cloned ShaderBlow from GitHub - jMonkeyEngine-Contributions/shaderblowlib
But not only some .java files, even a file .frag (electricity effect 5) was broken (during runtime). I tried to fix its .frag file but the effect was inside the model, and I have almost no idea what is coded there…

But… the shader test with many models side by side, was working perfectly!

So I wonder if someone has all shaders fixed/fully working somewhere? if there is some fork somewhere? There are many cool shaders there, and the ones I am really interested, if they dont work I will try to fix as much I can of course (I will pop them on a fork) as all bugs til now was about type casting, quite trivial…

Shaderblow was made by @mifth a long time ago. Unfortunately he is not active anymore in the community. If I were you I’d fork the project and fix the issues, and maybe make a pull request.


practically everything is working!

I had a few issues tho that is not clear what to do to fix (as I know almost nothing about it):

 * @ERRORAT 705	              vec3 iblLight = texture2D(m_IblMap_Simple, vec2((((refVec) + mat * normal) * vec3(0.49)) + vec3(0.49))); 
 * @ERROR com.jme3.renderer.RendererException: compile error in: ShaderSource[name=ShaderBlow/Shaders/LightBlow/LightBlow.frag, defines, type=Fragment, language=GLSL100] 0(705) : error C7011: implicit cast from "vec4" to "vec3"
public class TestLightBlowSimpleIBL extends SimpleApplication {
public class TestLightBlowShadingSystem extends SimpleApplication {

 * @ERRORAT 46	    vNdotV = dot(inNormal, viewVec);
 * @ERROR SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main] com.jme3.renderer.RendererException: compile error in: ShaderSource[name=ShaderBlow/Shaders/Bubble/Bubble.vert, defines, type=Vertex, language=GLSL100] 0(46) : error C7011: implicit cast from "float" to "vec3" 
public class Bubble extends SimpleApplication {

Anyone know how to fix them?

Also, I use eclipse, so I ended using ./ShaderBlow/ as the base project path and added this line to all test classes:
assetManager.registerLocator("test-data", FileLocator.class);
probably useless in the JME SDK but I think nothing will break right? as the path exists…

I guess the original shader author must have had an nvidia card on JME 3.0 and never bothered to try things on different cards. Old JME never put a #version line in the shader when GLSL100 was in the jm3d file… so nvidia would drop into compatibility mode and allow this sort of free casting back and forth.

I think there are probably a few things wrong with that line… but in general if there was an automatic conversion done before then it’s just a matter of swizzling or promoting to get it back to normal.

So in this case, texture2D() is returning a vec4… to turn it into a vec3 again add .rgb to the end.

I haven’t parsed all of the parentheses in that line but there might be some vec3 to vec2 implicit casting there also, even though it’s wrapped. I don’t know if GLSL does the right thing with vec2(vec3) or not. But if so then you can replace the vec2() with ().xy or whatever.

1 Like

For the first one add .rgb after the last close parentheses. The next one vec3(dot(inNormal, viewVec))

P.S. Although I’m not sure why you’d store that last one in a vec3 rather than a float. You might be better off changing vNdotV to a float instead, but I don’t know the rest of the shader so maybe there’s a reason for it.

1 Like

worked! thx!

worked too! thx!


shaderblowlib/LightBlow.frag at master · AquariusPower/shaderblowlib · GitHub

shaderblowlib/Bubble.vert at master · AquariusPower/shaderblowlib · GitHub

everything working and commit/push there :smiley:

@nehon I added a pull request, thx!

@pspeed mine is also an old NVidia card, probably his one was a newer one, so basically many shaders may still be broken for other cards; but… forking, fixing, commiting, pull request is a so simple process that other ppl may do it too quite easily! I wonder about turning it into a JME SDK plugin again, but as I use eclipse I guess I would only grab the .jar (that for now I will try to create using the build.xml files). Also, a test-chooser like JME’s one would be a quite cool addon to it.

1 Like

JME 3.1 sets the #version properly so that nvidia doesn’t go into compatibility mode. If you get the shaders to work now then they should at least compile and run on most cards. “Broken” would be something different now.

1 Like

Still on this context,
I wonder about creating a “basic materials package”.

The main generated jar lib distribution has nothing from the tests, is just the raw .j3md files, what is excellent.

But as a quick start, a package containing all .j3m + textures (least models), would be very handy, we could quickly apply the shaders’ materials and just precisely tweak them later when we have the time.

A few more details here: basic materials package · Issue #2 · jMonkeyEngine-Contributions/shaderblowlib · GitHub

Appreciating further considerations on this subject.

1 Like