Hello everyone! Remember that one anime shader I tried to do a while back? No? Well too bad, I’m not digging for it. Anyway, I’ve made a lot of progress since, and I’ve decided to share it with everyone to use! And then I had an even better idea: Why don’t I just make a shader pack made for JME for me and others to use? And so Monkey Shades was born. So far, it only has my Anime shader, but will get more once I get to them. I’m going to take things one shader at a time, so sorry if growth is a bit slow. Here is what I plan on adding after I finish the Anime shader, each one more complex than the last:
- Monochrome! Basically a modified version of the Lighting shader, but gives the user the option to switch the color scheme between grey-scale and color through a float variable called MODE (or something like that).
- Camera static! I talked about this before, but I never actually got to it. Again, can be switched on and off.
- Heat Haze! Just because I want to.
- Realistic Light! This morning I decided to stand by my school’s fence in the rain to look for inspiration. I noticed how the streetlights gave off a glare, and thought how cool that would be to use in a game. The user will be able to choose the brightness and glare level, and the light generated will cast onto other objects as well.
- Puddle Mapping! After I had my light idea, I started to examine some puddles on the floor. Then I thought “It would be a nice detail to make puddles reflective in game like they do in real life.” What this shader does is add a puddle map parameter along with the usual Diffuse, Specular, and Normal maps. Black spots on the map mean no puddles, where as lighter shades define the puddle’s opacity, white being completely opaque. Then the shader will take in the surrounding environment within a given range, and reflect it’s surroundings, while blurring the image like a real puddle does. It will also reflect lights and support ripples.
- Wind! (Soft Body Physics) I know there is a native bullet implementation under development for this, but I want to do this anyway mostly because it will teach me shader scripting. What this will do is enable the things like swaying grass and tree branches, flowing hair, and… other stuff. Although I may need a better graphics card to test this one. I know for sure this is going to be heavy on math. The user inputs a wind direction vector and the mesh’s “weight,” and then the shader (mostly vertex) will manipulate the model to give the effect that the model is flowing in a gust of wind.
That’s all I can come up with for now. But I think it’s a lot more reasonable than my server idea . Now enough about the future, let’s talk about now. My anime shader is about 75% done, I just need to add support for Spot Lights, make it so it blends light color to the model’s color, and get it to self-shadow (I’ll explain what I mean in a bit). But here is the shader at work with a sphere:
That’s using a directional light. It also supports Ambient and Point Lights, here is a point light implementation:
The black cut-off was on purpose. If a point is out of range of the Point light, then the light has no effect on that point. Otherwise the point is fully lit. This preserves Anime’s single shading property. At least that’s how it is in the anime’s I’ve seen. This could be very good to use in horror games. And 970 FPS with 1400 triangles is pretty good for my old GPU. I still have yet to test this shader with a complex model, such as a person.
Now about that self-shadowing I mentioned earlier. Basically, if there is a piece of the model overlapping another piece of the same model, than the covered part gets shaded according to the light direction. But before I waste my time doing that, will the Shadow filter take care of that effect for me?
And that is my contribution to JME. I’ve had a tough time finding shader packs dedicated to this engine, so that’s another reason I made this. But that is all for now, and if there is a shader you would like to see in this pack, let me know and I’ll add it to my list. I’ll also post an update on the Spot Light implementation. But there I have a teeny little question: What input represents the light color? Is it inColor? And also, you guys are cool with me modifying your shader, right?
For those who are interested, the github page is here: GitHub - FloppidyDingo/FloppidyDingo-s-Monkey-Shades: A shader pack made for the JMonkey Engine. I’ll get tutorial docs up eventually. Sorry about that.