Introducing Floppidy Dingo's Monkey Shades!

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 :smile:. 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.

5 Likes

Oh, and one more thing: Am I able to use more than one shader per material? Like using both Camera Static and Realistic Lighting on the same sphere?

Only if you render it twice.

…though “camera static” sounds like a screen feature and not a sphere feature to me.

Okay. Is there a function that let’s me specify how many times a model is rendered? I expect there’s going to be a great performance hit by doing that.

As for the camera static, it doesn’t have to be strictly a sphere. You could put it on a small illuminated quad in a TV model and make it TV static. Or like you suggested to me in a different thread, put it on a quad in front of the camera to make a screen effect.

And one more question: Does JME support EFB (External frame buffer) copies in the shader scripts? I doubt that’s the name for it in PC graphics, but it’s called that in the GameCube. Anyway, for some of these effects, such as the Heat Haze effect, I’ll need to be able to render the scene to a frame buffer instead of to the screen, and then apply the effects onto the buffer, and then copy the buffer to the screen. Can I do that?

If you want to render a mesh with different materials… create two geometries and give them the same mesh and different materials.

The point is… what effect are you going for? Usually people want like TV static… which would be a full screen quad because anything else would be absurdly crazy. Now, if for some reason you want to have your object itself look static-like in a scene full of regular stuff then you are in a different area.

Note: another option for you would be to use shader nodes because then you can combine multiple nodes into one result. That’s what it’s designed for: modular shaders that can be recombined in different ways.

That’s what I meant, a full screen quad with the shader attached. Or you could set the noise intensity to a higher level and apply it to the glass front of a TV model, so then it looks like those old TVs when they don’t have a signal. Or yes, you could use the shader to make something look absurdly crazy. I may actually do that just because.

And this is the first I’ve heard about shader nodes. But after a quick glance at the tutorial about it that I somehow overlooked, it looks like node may help with the bulk of my shader pack. Would these make my EFB copy (still don’t know the name for them) requirements easier to accomplish? That’s what it looks like.

Came up with another shader to add: Fog! Because when I first tried the fog filter JME provides, well… it looked more like a solid wall rather than fog. But that may have been me and my noobness since that was a looong time ago when I was just a young JME padawan. Anyway, I want to make it a shader.

And after some further testing, I have found that my Anime shader hates both the Shadow Filter and Shadow Processor. It makes the textures load in very slowly, and makes the shading function work the exact opposite of how it’s supposed to, and it makes the texture very dark. I’ll have to take a look at that later.

Also, it seems that adding more objects increases the framerate to a certain point. Maybe my GPU is possessed :smile:

FYI a fog shader node is already in the sdk

multi light dynamic shadow would be cool :smile:

-.- Well then… I guess I’ll just make it for practice then.

Yeah it would. But I’ll have to get studying if I want to make it a reality. I feel like once this shader pack matures enough then the JME community will benefit greatly. We would be able to achieve so many new cool effects.

Had a major facepalm today.

After looking through the tutorials for the millionth time, i found this:

g_LightColor (vec4) : the color of the light

Well then… I don’t know how I missed that, but okay…

Just did some more research and now I’m compelled even more to do it. Something like that looks awesome!

1 Like

If it is a own project and the shadow renderer are own moduls it should be easy to add contribution from different people. this maybe improve the speed to have a lot of cool effects. I suppose there are already some cool effects outsid jmonkeyengine. and you even can release often and make them available soon.
This is just an idea nothing more nothing less. I wanted to write own shaders and bought already some opengl books :stuck_out_tongue_winking_eye:

This is one. I was not able so far make it work for my project but looks as well awsome.

Here’s how I was thinking of doing this: For shaders that are supposed to give a specific effect (such as the Anime shader), they will be written the regular way. Effects that can be mixed (such as a monochrome puddle-mapped scene with a bit of static) will be modular. Effects that would make more sense for them to be a post processing effect (such as heat haze) will be made as a filter.

While I’m on the topic, I should probably say which filters will be which, along with an update to my list of effects. To make this easier to type, I’ll have a way of saying their types. Modular will be… well modular. Filter will be a post processing effect. There will be Hybrids which in their case two versions will be made, Modular and Filter. And then Singular will be made as an individual shader.

  • Anime: Singular, will become modular
  • Monochrome: Hybrid
  • Camera Static: Hybrid
  • Overcast (similar to the fog node, but adds a height definition): Filter
  • Heat Haze: Filter
  • Heat Mapper: Modular (will talk about this later)
  • Realistic Light: Modular
  • Puddle Map: Not sure what would work best
  • Multi-Light Dynamic Shadows (As suggested by @ia97lies): not sure
  • Wind: Modular

Now about the Heat Mapper. What this will do is generate a Haze Map for the Heat Haze filter to use, so that way it knows what spots to apply the effect to. You can apply the Heat Mapper to say an Oven, and then there will only be haze over that said oven.

I may actually port the Anime shader to be modular. Yeah, Ima do that.

What is that? I’ve never seen it before.

It’s one of those new Unicode-emoji (since Unicode 8.0.0).
In particular it’s the codepoint U+1F61C (FACE WITH STUCK-OUT TONGUE AND WINKING EYE).
And you find the full explanation here: UTS #51: Unicode Emoji
see: Emoji unicode characters for use on the web
or: Full Emoji List, v15.1

One more hint: Java 7 and Java 8 still use Unicode 6.x.x (so they are far behind now).
My software (BitmapFont2 / BitmapText2) will support the latest Unicode / Unihan / Emoji.

Oh, okay. I thought it was one of JMEs emoticons and that my PC was acting up.

Your project have similarities with ShaderBlow contributions.

Good Luck

Yes it does, but completely bu accident. They have an old film effect, but my version is more like the static in Slenderman. The grayscale… I had no idea they had that. Ima do it anyway, for knowledge!

I have completed the Anime shader, and am now ready to move on to Monochrome! Implementing Spotlight support was a lot easier than I thought, and somehow doing so also added support for Shadows. It’s nice when everything falls into place the way you need it to. Here is a screenshot of a Mushroom under the Spotlight, along with a Shadow Filter:

The framerate was crippled because of the shadow filter, but that’s to be expected from using 8 year old hardware. I have updated my Github repository for anyone who is interested.

I can’t wait to get to the Realistic Lighting and the other more cooler effects. But one step at a time, i guess. Maybe if I stop bumming around I’ll actually get to them sooner :smile: Anyway, ONWARD AND UPWARD!!!

2 Likes

After who knows how long, I added the second shader to my pack, but this one was made completely by accident.

There’s supposed to be a glare on the street light, but instead I broke the shader and the glare moved onto the borders of the frame…I mean i totally mean to do that. Anyway, i thought it looked cool, so I made it part of my shader pack. Github link: GitHub - FloppidyDingo/FloppidyDingo-s-Monkey-Shades: A shader pack made for the JMonkey Engine.

3 Likes