I was just messing around different examples and found TestPostFilters.java and Yey, here I found RadialBlurFilter,FadeFilter & ColorOverlayFilter.
Here RadialBlur and Fade will come in very handy, but why they are not in the Effect documentation? Feels like, they are hidden features
Is it possible to take it as an request, to use a alpha map to produce patters using ColorOverlay? like red(colorOverlay) scratch(alpha Map) appearing when player is attacked by a an animal?
Thatâs not hidden features, itâs just that i did not find the time to document them
But now that youâve unlock them you can use them plenty
iamcreasy said:
Is it possible to take it as an request, to use a alpha map to produce patters using ColorOverlay? like red(colorOverlay) scratch(alpha Map) appearing when player is attacked by a an animal?
This is a good idea, but i don't know if it's relevant to put it in the core engine.
I designed the filter system so that people can easily make their own filters, and eventually contribute them back to the community
(for example in a similar way than the asset pack, you would have a filter pack, or maybe just code snippets).
I suggest that you go ahead and make this filter. It's fairly easy, and you can use the ColorOverlay as a basis.
Of course, I will guide you. Don't be afraid of the shader part of the process, at first shaders can look scary, but honestly, it's not that difficult
And of course it's just a suggestion, you don't have to accept :p
Yes of course, I am very curious about the shader/filter part
When I am done with my first level, i am gonna put the development aside, and start working on some âgooood-stuffâ
By this time, I wanna study shader related doc. So, where should I start? Should I start googling about GLSL?
you can yes itâs always a good start :pâŚ
You can also read the documentation in the wiki about that here : https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:jme3_shaders
Your own filter has to extend the Filter abstract class (just copy the coloroverlay filter for a starter)
The idea behind filters is that we render the scene to a texture, and we apply the texture on a full screen quad. In the process, we combine the texture with our effect.
You donât have to take care of that, the FilterPostProcessor does it for you. so the rendered scene will be passed to your shader as a material attribute named Texture ( m_Texture in the shader).
So basically the filter is a quad on your screen on which you apply a material with the rendered scene as a textureâŚ
For example the color overlay filter just multiply the given color with the pixel color fetched from the texture.
In your case, you would have to fetch the alpha map pixel, and mix the alpha value with the resulting color.