shaderblow.adoc 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836
  1. = ShaderBlow
  2. :revnumber: 2.1
  3. :revdate: 2020/07/10
  4. image:plugin/shaderblow_intro_01.jpg[shaderblow_intro_01.jpg,width="",height=""]
  5. Collections of effects for jMonkeyEngine 3. To install the ShaderBlow plugin into the jMonkeyEngine SDK, go to Tools→Plugins→Available Plugins.
  6. You can always get the source of ShaderBlow project here:
  7. link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib[ShaderBlow project Github]
  8. The source has many examples and tests to explain the capacity of shaders much better.
  9. * Filters:
  10. ** Basic SSAO
  11. ** ColorScale (added by @H)
  12. ** GrayScale (added by @H)
  13. ** Simple Refraction (added by @mifth)
  14. ** Old Film Effect (added by @H)
  15. ** Night Vision (added by @wezrule)
  16. ** Predator Thermal Vision (added by @wezrule)
  17. ** Frosted Glass effect (added by @wezrule)
  18. * Shaders
  19. ** Dissolver (added by @thetoucher)
  20. ** FakeParticleBlow (added by @mifth)
  21. ** Forceshield (added by @ficik)
  22. ** MatCap (added by @mifth)
  23. ** Glass (added by @mifth)
  24. ** Texture Bombing (added by @wezrule)
  25. [NOTE]
  26. ====
  27. Official Forum: link:https://hub.jmonkeyengine.org/t/shaderblow-project/26655[https://hub.jmonkeyengine.org/forum/t/shaderblow-project/26655]
  28. Or you can use the forum threads of shaders.
  29. ====
  30. '''
  31. == ColorScale Filter
  32. The ColorScale filter applies a color to the render image. You can use this filter to tint the render according to one particular color without change any material (underwater scene, night scene, fire scene) or to achieve fade-in/fade-out effect.
  33. Features:
  34. * Allow to set the color to apply. Default is red.
  35. * Allow to set intensity of the color. Default is 0.7f. Frag shader clamps color intensity between 0 and 1.
  36. [cols="2"]
  37. |===
  38. a|image:plugin/colorfilter2.png[ColorScale Filter OFF,width="400",height=""]
  39. a|image:plugin/colorfilter1.png[ColorScale filter ON,width="400",height=""]
  40. a|image:plugin/colorfilter3.png[ColorScale Filter ON,width="400",height=""]
  41. a|image:plugin/colorfilter4.png[ColorScale Filter,width="400",height=""]
  42. |===
  43. === Usage
  44. Add a link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/src/com/shaderblow/filter/colorscale/ColorScaleFilter.java[ColorScaleFilter] instance to a FilterPostProccesor instance. Set color and color intensity. Then add the FilterPostProccesor instance to Application's viewPort attribute.
  45. [source,java]
  46. ----
  47. this.fpp = new FilterPostProcessor(this.assetManager);
  48. this.fpp.setNumSamples(4);
  49. this.colorScale = new ColorScaleFilter();
  50. this.fpp.addFilter(this.colorScale);
  51. // colorScale.setFilterColor(ColorRGBA.Red.clone()); // Set Filter color
  52. // colorScale.setColorDensity(0.5f); // Set Color intensity (between 0 and 1);
  53. this.viewPort.addProcessor(this.fpp);
  54. ----
  55. link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/test-src/com/shaderblow/test/filter/color/TestColorScale.java[TestCase]
  56. link:https://hub.jmonkeyengine.org/t/colorscale-filter-added-to-shaderblow/23995[Forum thread]
  57. '''
  58. == GrayScale Filter
  59. The GrayScale filter converts the render image to grayscale.
  60. [cols="2", options="header"]
  61. |===
  62. a| *GrayScale Filter OFF*
  63. a| *GrayScale Filter ON*
  64. a|image:plugin/grayscalefilter-off.jpg[GrayScale Filter OFF,width="400",height=""]
  65. a|image:plugin/grayscalefilter-on.png[GrayScale Filter ON,width="400",height=""]
  66. |===
  67. === Usage
  68. Add a link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/src/com/shaderblow/filter/grayscale/GrayScaleFilter.java[GrayScaleFilter] instance to a FilterPostProccesor instance. Then add the FilterPostProccesor instance to Application's viewPort attribute.
  69. [source,java]
  70. ----
  71. this.fpp = new FilterPostProcessor(this.assetManager); // Create FilterPostProcessor instance
  72. this.grayScale = new GrayScaleFilter(); // Create GrayScaleFilter instance
  73. this.fpp.addFilter(this.grayScale); // Add GrayScaleFilter instance to FilterPostProcessor instance
  74. this.viewPort.addProcessor(this.fpp); // Add FilterPostProcessor instance to ViewPort
  75. ----
  76. link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/test-src/com/shaderblow/test/filter/grayscale/TestGrayScale.java[TestCase]
  77. link:https://hub.jmonkeyengine.org/t/solved-grayscale-filter/23656[Forum thread]
  78. '''
  79. == Old Film Effect Filter
  80. Old Film filter simulate the effect of a classic looking film effect.
  81. Features:
  82. * Allow to set the *filter's color*. Default is sepia (ColorRGBA(112f / 255f, 66f / 255f, 20f / 255f, 1.0f)).
  83. * Allow to set the *color's density*. Default is 0.7. Shader clamps this value between 0 to 1. The color image gets grayscale when color's density is set to 0.
  84. * Allow to set the *noise's density*. Default is 0.4. Shader clamps this value between 0 to 1.
  85. * Allow to set the *scratches' density*. Default is 0.3. Shader clamps this value between 0 to 1.
  86. * Allow to set the *vignetting's diameter*. Default is 0.9. Shader clamps this value between 0 to 1.4. Vignetting effect is made using two circles. The inner circle represents the region untouched by vignetting. The region between the inner and outer circle represent the area where vignetting starts to take place, which is a gradual fade to black from the inner to outer ring. Any part of the frame outside of the outer ring would be completely black.
  87. [NOTE]
  88. ====
  89. I chose to clamp this value inside the frag shader code instead of using java code because I thought this way is faster (better from performace point of view). You can clamp this value using Java code if you want.
  90. ====
  91. [cols="2",caption=]
  92. .YouTube
  93. |===
  94. a|.Old Film Effect
  95. image:plugin/CgFzhkq-MKk.jpg[youtu.be/CgFzhkq-MKk,width="",height="",link="https://youtu.be/CgFzhkq-MKk"]
  96. a|
  97. |===
  98. === Usage
  99. Add a link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/src/com/shaderblow/filter/oldfilm/OldFilmFilter.java[OldFilmFilter] instance to a FilterPostProccesor instance. Then add the FilterPostProccesor instance to Application's viewPort attribute.
  100. [source,java]
  101. ----
  102. this.fpp = new FilterPostProcessor(this.assetManager); // Create FilterPostProcessor instance
  103. this.oldFilmFilter= new OldFilmFilter(); // Create OldFilmFilter instance
  104. this.fpp.addFilter(this.oldFilmFilter); // Add OldFilmFilter instance to FilterPostProcessor instance
  105. this.viewPort.addProcessor(this.fpp); // Add FilterPostProcessor instance to ViewPort
  106. ----
  107. link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/test-src/com/shaderblow/test/filter/oldfilm/TestOldFilm.java[TestCase]
  108. link:https://hub.jmonkeyengine.org/t/old-film-effect-filter/25464[Forum thread]
  109. '''
  110. == LightBlow Shader
  111. The Lightblow shader is an improved Lighting shader for JME.
  112. Features:
  113. * Improved lighting calculations.
  114. * Improved reflection calculations.
  115. * Reflection map implementation with alpha normal map.
  116. * Improved Minnaert calculations.
  117. * Hemispherical lighting.
  118. * Image Based Lighting with Albedo.
  119. * Emissive map implementation with diffuse alpha.
  120. * normalization of normals by default.
  121. * Specular map implementation with normal map alpha.
  122. * Specular intensity implementation.
  123. * Switching -x/-y/-z normals for different normal maps. (3dmax, blender, xnormal have different approaches).
  124. * Specular Color now works with specular maps
  125. * Glowblow fragment shader is added with m_GlowIntensity? uniform. It's possible to change glow intensity for objects. Please, use DiffuseMap? as GlowMap? instead of new additional Glow rgb texture.
  126. * Lightmaps are added.
  127. * Rim Lighting is added. Thanks to Thetoucher from JME Blog!
  128. * Fog is added. Fog is used without post-processing!
  129. * Texture Blending: 4 diffuse, 4 normal textures can be blended (Like Terrain System).
  130. Software for NormalMaps? making: link:https://shadermap.com/home/[https://shadermap.com/home/] +
  131. Software for CubeMaps? editing: link:https://code.google.com/archive/p/cubemapgen/downloads[https://code.google.com/archive/p/cubemapgen/downloads] +
  132. Watch following videos:
  133. [cols="2",caption=]
  134. .YouTube
  135. |===
  136. a|.LightBlow Shader
  137. image:plugin/knROh_3o2uo.jpg[youtube_https://youtu.be/knROh_3o2uo,width="",height="",link="https://youtu.be/knROh_3o2uo"]
  138. a|
  139. |===
  140. link:https://hub.jmonkeyengine.org/t/lightblow-shader/16182[Forum thread]
  141. '''
  142. == Dissolver Shader
  143. The Dissolve Shader uses a simple grey scale image as an animated mask to hide a material.
  144. The shader incrementally clamps off the colour value, dark to light, and uses that for a masking texture to discard pixels.
  145. It is currently capped for convenience at 255 frames of animation and is only using one colour channel.
  146. In simple terms, in starts by only discarding the darkest parts of the texture map, then the slightly lighter parts, then the slightly lighter again and again until it eventually can't get any lighter (white), at which point the process is complete.
  147. [cols="2"]
  148. |===
  149. a|image:plugin/dissolver-screen.png[Dissolver screenshot,width="400",height=""]
  150. a|image:plugin/dissolver-maps.png[Mask maps,width="400",height=""]
  151. |===
  152. Starting at the top left we have: simple linear dissolve, organic dissolve and pixel dissolve.
  153. And bottom row: organic growth, texture masking, organic burn.
  154. Mask texture maps on the second image.
  155. The test is oscillating the dissolve amount between 0 and 1. It demonstrates 6 different uses for the shader, all running at the same speed. The top row are straight forward dissolves. The bottom row shows 3 potential applications:
  156. . Organic Growth (bottom left) over a mesh, this could work both animating rapidly for a fast grow effect, or set to a fixed value e.g. set to 0.5f is "`50% covered in growth`";
  157. . Texture Masking (bottom middle) , I see this is probably where the most practical applications will come from. The demonstration shows a poorly photoshopped clean street, pieces of garbage are then scattered around dependant on the dissolve amount, this would work best with a fixed value eg set to .75 is "`75% dirty`". Texture Masking could be also be used for:
  158. .. paint damage on a car;
  159. .. lacerations on a character;
  160. .. the blood shot eye effect that creeps in from the sides of the screen when you’ve taken too much damage in a modern FPS.
  161. . Organic Burn (bottom right) is comprised of 2 cubes, one blue, one orange, both with the same organic dissolve, however the orange one is slightly offset ahead of the blue so it shows first (ie the dissolve amount is always slight advanced).
  162. Watch following videos:
  163. [cols="2"caption=]
  164. .YouTube
  165. |===
  166. a|.GLSL Dissolve Shader
  167. image:plugin/ry0r_qwFQLQ.jpg[youtube_ry0r_qwFQLQ,width="",height="",link="https://youtu.be/ry0r_qwFQLQ"]
  168. a|.mTheoryGame
  169. image:plugin/wUfMcN1Uv48.jpg[youtube_wUfMcN1Uv48,width="",height="",link="https://youtu.be/wUfMcN1Uv48"]
  170. |===
  171. === Usage
  172. The shader requires 2 parameters:
  173. * a Texture2D texture map to use as the dissolve map; and
  174. * a Vector2 of internal params params:
  175. ** the first is a float value being the amount of dissolve, a value from 0-1 : 0 being no dissolve, being fully dissolved; and
  176. ** the second value is an int use as an inversion switch, 1 to invert the dissolve/discard, 0 to leave as is.
  177. [NOTE]
  178. ====
  179. Dissolver is based on Common/MatDefs/Lighting.j3md. So, all Common/MatDefs/Lighting.j3md features should be available on the dissolver too.
  180. ====
  181. [source,java]
  182. ----
  183. // Create a material instance using ShaderBlow's Lighting.j3md
  184. final Material mat = new Material(this.assetManager, "ShaderBlow/MatDefs/Dissolve/Lighting.j3md");
  185. mat.setColor("Ambient", ColorRGBA.Blue);
  186. mat.setColor("Diffuse", ColorRGBA.White);
  187. mat.setColor("Specular", ColorRGBA.Black);
  188. mat.setBoolean("UseMaterialColors", true);
  189. this.assetManager.loadTexture("TestTextures/Dissolve/burnMap.png", mat.setTexture("DissolveMap", map)); // Set mask texture map
  190. this.DSParams = new Vector2f(0, 0); // standard dissolver
  191. //this.DSParamsInv = new Vector2f(0, 1); // inverted dissolver
  192. mat.setVector2("DissolveParams", this.DSParams); // Set params
  193. final Box b = new Box(Vector3f.ZERO, 1, 1, 1);
  194. final Geometry geom = new Geometry("Box", b);
  195. geom.setMaterial(mat);
  196. ----
  197. link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/test-src/com/shaderblow/test/dissolve/TestDissolve.java[TestCase]
  198. link:https://hub.jmonkeyengine.org/t/dissolve-shader/18720[Forum thread]
  199. '''
  200. == FakeParticleBlow Shader
  201. Effect for fire or engine of a ship. Such an effect is used in the "`Eve Online`" game for ship engines.
  202. Features:
  203. . GPU animation (now you don’t need simpleUpdate(float tpf) for the shader). Animation is made displacing the texture according to X and/or Y axis.
  204. . X and/or Y animation direction. No animation is supported also.
  205. . Animation direction changer. By default the Y axis animation's direction is up-to-down and the X axis animation's direction is right-to-left.
  206. . Allow to set animation speed.
  207. . Allow to set mask texture in order to set particle shape.
  208. . Allow to set particle color.
  209. . Allow to set fog color. Fog color is applied to the material using for color's alpha value as fog distance factor.
  210. [cols="2"]
  211. |===
  212. a|image:plugin/fakeparticleblow.png[FakeParticleBlow,width="400",height=""]
  213. a|.Fog applied to blue fire
  214. image:plugin/fakeparticleblow3.png[FakeParticleBlow,width="400",height=""]
  215. |===
  216. [cols="2",caption=]
  217. .YouTube
  218. |===
  219. a|.FakeParticleBlow Shader
  220. image:plugin/hdQop4yZ-lA.jpg[youtube_hdQop4yZ-lA,width="",height="",link="https://youtu.be/hdQop4yZ-lA"]
  221. a|
  222. |===
  223. === Usage
  224. Create a material (by SDK or by code) using link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/assets/ShaderBlow/MatDefs/FakeParticleBlow/FakeParticleBlow.j3md[FakeParticleBlow.j3md].
  225. Set material's parameters and set the material to a spatial.
  226. Most of the cases the spatial will be 4 to 10 planes in the same location but rotated on Y axis using different angles for each plane. Something similar to this:
  227. image:plugin/fakeobject.png[fakeobject.png,width="100",height=""]
  228. [IMPORTANT]
  229. ====
  230. Remember to set the queue bucket to transparent for the spatial.
  231. ====
  232. [source,java]
  233. ----
  234. // Create the material
  235. final Material mat = new Material(this.assetManager, "ShaderBlow/MatDefs/FakeParticleBlow/FakeParticleBlow.j3md");
  236. // Create the mask texture to use
  237. final Texture maskTex = this.assetManager.loadTexture("TestTextures/FakeParticleBlow/mask.png");
  238. mat.setTexture("MaskMap", maskTex);
  239. // Create the texture to use for the spatial.
  240. final Texture aniTex = this.assetManager.loadTexture("TestTextures/FakeParticleBlow/particles.png");
  241. aniTex.setWrap(WrapMode.MirroredRepeat); // NOTE: Set WrapMode = MirroredRepeat in order to animate the texture
  242. mat.setTexture("AniTexMap", aniTex); // Set texture
  243. mat.setFloat("TimeSpeed", 2); // Set animation speed
  244. mat.setColor("BaseColor", ColorRGBA.Green.clone()); // Set base color to apply to the texture
  245. // mat.setBoolean("Animation_X", true); // Enable X axis animation
  246. mat.setBoolean("Animation_Y", true); // Enable Y axis animation
  247. mat.setBoolean("Change_Direction", true); // Change direction of the texture animation
  248. mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off); // Allow to see both sides of a face
  249. mat.getAdditionalRenderState().setBlendMode(BlendMode.Additive);
  250. final ColorRGBA fogColor = ColorRGBA.Black.clone();
  251. fogColor.a = 10; // fogColor's alpha value is used to calculate the intensity of the fog (distance to apply fog)
  252. mat.setColor("FogColor", fogColor); // Set fog color to apply to the spatial.
  253. final Quad quad = new Quad(3, 3); // Create an spatial. A plane in this case
  254. final Geometry geom = new Geometry("Particle", quad);
  255. geom.setMaterial(mat); // Assign the material to the spatial
  256. TangentBinormalGenerator.generate(geom);
  257. geom.setQueueBucket(Bucket.Transparent); // Remember to set the queue bucket to transparent for the spatial
  258. ----
  259. To get green/yellow/blue fog (not transparency):
  260. [source,java]
  261. ----
  262. mat.getAdditionalRenderState().setBlendMode(BlendMode.AlphaAdditive);
  263. final ColorRGBA fogColor = ColorRGBA.Blue.clone();
  264. ----
  265. Several planes geometries will be required as there will be AlphaAdditive material.
  266. link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/test-src/com/shaderblow/test/fakeparticleblow/TestFakeParticleBlow.java[TestCase 1] +
  267. link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/test-src/com/shaderblow/test/fakeparticleblow/TestFakeParticleBlow2.java[TestCase 2]
  268. link:https://hub.jmonkeyengine.org/t/fakeparticleblow-shader/16443[Forum thread]
  269. '''
  270. == Forceshield Shader
  271. Forcefield shader adds shield effect to a spatial.
  272. The spatial will be a sphere most of the cases, but box or oval should be possible to use. Only problem is that it has to be higher-poly because distance is calculated from vertex.
  273. Hits are registred as contact point position using this control and effect animation is based on distance from contact point and time.
  274. Max number of hits displayed is 4.
  275. Features:
  276. * Allow to set texture of the shield.
  277. * Allow to set color of the shield.
  278. * Allow to set minimal visibility (similar to alpha value). Default is 0, that means shield is no displayed, only hit animations.
  279. * Allow to set effect duration. Default is 0.5s.
  280. * Allow to set effect size. Default is 1.
  281. * Allow to enable/disable hit animations.
  282. [cols="2",caption=]
  283. .YouTube
  284. |===
  285. a|.Forceshield Shader
  286. image:plugin/uu2nbaBM9Pk.jpg[youtube_uu2nbaBM9Pk,width="",height="",link="https://youtu.be/uu2nbaBM9Pk"]
  287. a|.Forceshield Cube Shader
  288. image:plugin/urzMiUeHsCc.png[youtube_urzMiUeHsCc,width="",height="",link="https://youtu.be/urzMiUeHsCc"]
  289. |===
  290. === Usage
  291. Create a Spatial instance. Create a link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/src/com/shaderblow/forceshield/ForceShieldControl.java[ForceShieldControl] instance.
  292. Add the control instance to the spatial.
  293. [IMPORTANT]
  294. ====
  295. If you experience problems, try higher polygon object.
  296. ====
  297. [source,java]
  298. ----
  299. // Create spatial to be the shield
  300. final Sphere sphere = new Sphere(30, 30, 1.2f);
  301. final Geometry shield = new Geometry("forceshield", sphere);
  302. shield.setQueueBucket(Bucket.Transparent); // Remember to set the queue bucket to transparent for the spatial
  303. // Create ForceShieldControl
  304. this.forceShieldControl = new ForceShieldControl(this.assetManager, 0.5f);
  305. shield.addControl(this.forceShieldControl); // Add the control to the spatial
  306. this.forceShieldControl.setEffectSize(2f); // Set the effect size
  307. this.forceShieldControl.setColor(new ColorRGBA(1, 0, 0, 3)); // Set effect color
  308. this.forceShieldControl.setVisibility(0.1f); // Set shield visibility.
  309. // Set a texture to the shield
  310. this.forceShieldControl.setTexture(this.assetManager.loadTexture("TestTextures/ForceShield/fs_texture.png"));
  311. // this.forceShieldControl.setEnabled(false); // Enable, disable animation.
  312. ----
  313. Use _forceShieldControl.registerHit(final Vector3f position)_ method to register a hit.
  314. [source,java]
  315. ----
  316. final CollisionResults crs = new CollisionResults();
  317. this.rootNode.collideWith(new Ray(this.cam.getLocation(), this.cam.getDirection()), crs);
  318. if (crs.getClosestCollision() != null) {
  319. // Register a hit
  320. this.forceShieldControl.registerHit(crs.getClosestCollision().getContactPoint());
  321. }
  322. ----
  323. link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/test-src/com/shaderblow/test/forceshield/TestShield.java[TestCase]
  324. link:https://hub.jmonkeyengine.org/t/forceshield-my-very-first-shader/18673[Forum thread]
  325. '''
  326. == MatCap Shader
  327. MatCap shader will be very useful for scrollshooters to imitate different materials like glass, gold, metals.
  328. The shader does not use any lights, only one texture.
  329. Features:
  330. * Fog color and fog skybox.
  331. * Toon edge effect.
  332. * Multiply color: set a color to change texture's color.
  333. * Normal map.
  334. [cols="2"]
  335. |===
  336. a|image:plugin/shaderblow_matcap.jpg[MatCap shader,width="400",height=""]
  337. a|image:plugin/matcap3.png[Multiply color,width="400",height=""]
  338. a|image:plugin/matcap1.png[Toon edge effect,width="400",height=""]
  339. a|image:plugin/matcap2.png[Fog effect,width="400",height=""]
  340. |===
  341. === Usage
  342. Create a material (by SDK or by code) using link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/assets/ShaderBlow/MatDefs/MatCap/MatCap.j3md[MatCap.j3md]. Set material's parameters and set the material to a spatial.
  343. [IMPORTANT]
  344. ====
  345. Remember to add a DirectionalLight if you want to use toon edge effect.
  346. ====
  347. [source]
  348. ----
  349. Material My Material : ShaderBlow/MatDefs/MatCap/MatCap.j3md {
  350. MaterialParameters {
  351. DiffuseMap : Flip TestTextures/matcaps/met2.png
  352. Nor_Inv_Y : true
  353. Nor_Inv_X : false
  354. Nor_Inv_Z : false
  355. NormalMap : TestModels/LightBlow/jme_lightblow_nor.png
  356. FogSkyBox : Flip TestTextures/Water256.dds
  357. Toon : true
  358. EdgesColor : 1.0 0.0 0.0 1.0
  359. EdgeSize : 0.01
  360. Fog_Edges : true
  361. }
  362. AdditionalRenderState {
  363. }
  364. }
  365. ----
  366. link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/test-src/com/shaderblow/test/matcap/TestMatCap.java[TestCase]
  367. link:https://hub.jmonkeyengine.org/t/glsl-matcap-shader-done/18920[Forum thread]
  368. '''
  369. == Glass Shader
  370. Features:
  371. * Fog color and fog skybox.
  372. * Toon edge effect.
  373. * Multiply color: set a color to change texture's color.
  374. * Normal map.
  375. [cols="2"]
  376. |===
  377. a|image:plugin/glass-shader.png[Glass shader,width="400",height=""]
  378. a|image:plugin/glass-shader2.png[Glass Shader and Fog Color effect,width="400",height=""]
  379. |===
  380. === Usage
  381. Create a material (by SDK or by code) using link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/assets/ShaderBlow/MatDefs/Glass/Glass.j3md[Glass.j3md]. Set material's parameters and set the material to a spatial.
  382. [IMPORTANT]
  383. ====
  384. Remember to add a DirectionalLight if you want to use toon edge effect.
  385. ====
  386. [source]
  387. ----
  388. Material My Material : ShaderBlow/MatDefs/Glass/Glass.j3md {
  389. MaterialParameters {
  390. RefMap : Flip TestTextures/Water256.dds
  391. Multiply_Color : 1.1 1.5 1.1 1.0
  392. colorIntensity : 0.79999995
  393. Nor_Inv_Y : true
  394. NormalMap : TestModels/LightBlow/jme_lightblow_nor.png
  395. ChromaticAbberation : true
  396. abberIndex : 0.04
  397. specularIntensity : 0.59999996
  398. Toon : true
  399. EdgesColor : 0.2 1.0 0.0 1.0
  400. EdgeSize : 0.01
  401. Fog_Edges : true
  402. }
  403. AdditionalRenderState {
  404. }
  405. }
  406. ----
  407. link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/test-src/com/shaderblow/test/glass/TestGlass.java[TestCase]
  408. link:https://hub.jmonkeyengine.org/t/glsl-glass-shader-done/19050[Forum thread]
  409. '''
  410. == SimpleRefraction PostProcessor/Filter
  411. Features:
  412. * Cool refraction effect
  413. [cols="2",caption=]
  414. .YouTube
  415. |===
  416. a|.SimpleRefraction PostProcessor
  417. image:plugin/EAUKCU5GRmc.jpg[youtube_EAUKCU5GRmc,width="",height="",link="https://youtu.be/EAUKCU5GRmc"]
  418. a|
  419. |===
  420. === Usage
  421. link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/test-src/com/shaderblow/test/simplerefraction/TestSimpleRefraction.java[TestCase for PostProcessor]
  422. link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/src/com/shaderblow/filter/simplerefractionfilter/SimpleRefractionFilter.java[TestCase for Filter]
  423. '''
  424. == BasicSSAO Filter
  425. Features:
  426. * Cool Shadows.
  427. [cols="2"]
  428. |===
  429. a|image:plugin/shaderblow_ssao.png[Glass shader,width="400",height=""]
  430. a|
  431. |===
  432. === Usage
  433. link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/test-src/com/shaderblow/test/filter/basicssao/TestBasicSSAO.java[TestCase]
  434. link:https://hub.jmonkeyengine.org/t/wip-basicssao-added-optional-smoothing/23490[Forum thread]
  435. '''
  436. == Electricity Shaders
  437. Features:
  438. * Cool Electricity effect
  439. [cols="2",caption=]
  440. .YouTube
  441. |===
  442. a|.Electricity Shaders
  443. image:plugin/JDTES95HnPE.jpg[youtube_JDTES95HnPE,width="",height="",link="https://youtu.be/JDTES95HnPE"]
  444. a|
  445. |===
  446. link:https://hub.jmonkeyengine.org/t/electricity-shaders/23436[Forum thread]
  447. '''
  448. == SimpleSprite Shader
  449. Features:
  450. * GPU animated texture.
  451. [cols="2"]
  452. |===
  453. a|image:plugin/shaderblow_simplesprite_shader.png[Glass shader,width="400",height=""]
  454. a|
  455. |===
  456. [cols="2",caption=]
  457. .YouTube
  458. |===
  459. a|.SimpleSprite Shader
  460. image:plugin/7XFxbt-dw3I.jpg[youtube_7XFxbt-dw3I,width="",height="",link="https://youtu.be/7XFxbt-dw3I"]
  461. a|
  462. |===
  463. link:https://hub.jmonkeyengine.org/t/texture-animation-shader-done/19579[Forum thread]
  464. '''
  465. == Bubble Shader
  466. Features:
  467. * Cool nice bubble.
  468. [cols="2",caption=]
  469. .YouTube
  470. |===
  471. a|.Bubble Shader
  472. image:plugin/rkFbLZ1EOhg.jpg[youtube_rkFbLZ1EOhg,width="",height="",link="https://youtu.be/rkFbLZ1EOhg"]
  473. a|
  474. |===
  475. link:https://hub.jmonkeyengine.org/t/bubble-shader/26169[Forum thread]
  476. '''
  477. == SimpleSpriteParticle Shader
  478. Features:
  479. static sprite speed: can render 1500000 sprites at 149 fps ( 0% cpu load, speed limited only by graphics card ). As long as you don’t change them (add, move, delete, change image).
  480. FULL LIBRARY PLUGIN: link:https://code.google.com/archive/p/petomancer/downloads[http://code.google.com/p/petomancer/downloads/detail?name=SpriteLibrary.zip&can=2&q=]
  481. image:plugin/shaderblow_simplespriteparticle_shader.png[shaderblow_simplespriteparticle_shader.png,width="400",height=""]
  482. link:https://hub.jmonkeyengine.org/t/spritelibrary-efficient-render-of-sprites/20901[Forum thread]
  483. '''
  484. == Texture Bombing
  485. Features:
  486. * Applying random images from a texture atlas to a model by dividing up the model's UV textures into cells.
  487. [cols="2",caption=]
  488. .YouTube
  489. |===
  490. a|.GLSL Texture Bomb
  491. image:plugin/3lBhu2c5V8o.jpg[youtube_3lBhu2c5V8o,width="",height="",link="https://youtu.be/3lBhu2c5V8o"]
  492. a|
  493. |===
  494. === Usage
  495. link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/test-src/com/shaderblow/test/texturebombing/TestTextureBombing.java[TestCase]
  496. link:https://hub.jmonkeyengine.org/t/texture-glyph-bombing-shader/26867[Forum thread]
  497. '''
  498. == Night Vision
  499. Features:
  500. * Apply a mask (Binoculars) and color to emulate night vision mode.
  501. [cols="2",caption=]
  502. .YouTube
  503. |===
  504. a|.Night Vision Post Processor
  505. image:plugin/mNsjAVUTDPs.jpg[youtube_mNsjAVUTDPs,width="",height="",link="https://youtu.be/mNsjAVUTDPs"]
  506. a|
  507. |===
  508. === Usage
  509. link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/test-src/com/shaderblow/test/filter/nightvision/TestNightVision.java[TestCase]
  510. link:https://hub.jmonkeyengine.org/t/night-vision-filter-available-in-shaderblow-plugin/26892[Forum thread]
  511. '''
  512. == Predator Thermal Vision
  513. Features:
  514. * Changes the color in the scene to emulate the predator thermal vision effect
  515. [cols="2",caption=]
  516. .YouTube
  517. |===
  518. a|.Predator Thermal Vision
  519. image:plugin/DqBwCWVwTFQ.jpg[youtube_DqBwCWVwTFQ,width="",height="",link="https://youtu.be/DqBwCWVwTFQ"]
  520. a|
  521. |===
  522. === Usage
  523. link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/test-src/com/shaderblow/test/filter/predatorvision/TestPredatorVision.java[TestCase]
  524. link:https://hub.jmonkeyengine.org/t/predator-thermal-vision-filter-available-in-the-shaderblow-plugin/27005[Forum thread]
  525. '''
  526. == Frosted glass effect
  527. Features:
  528. * Displays a frosted glass effect over the current scene
  529. [cols="2",caption=]
  530. .YouTube
  531. |===
  532. a|.Frosted Glass effect Filter
  533. image:plugin/Bb0jVjqvURw.jpg[youtube_Bb0jVjqvURw,width="",height="",link="https://youtu.be/Bb0jVjqvURw"]
  534. a|
  535. |===
  536. === Usage
  537. link:https://github.com/jMonkeyEngine-Contributions/shaderblowlib/blob/master/ShaderBlow/test-src/com/shaderblow/test/filter/frostedglass/TestFrostedGlass.java[TestCase]
  538. link:https://hub.jmonkeyengine.org/t/frosted-glass-filter-available-in-the-shaderblow-plugin/27023[Forum thread]
  539. '''