shaderblow.adoc 27 KB

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