Stylized shadows with textures (polka dots)

Hello Hub!

I would like to make stylized shadows where during render instead of making the shadowy part of the scene darker, I would like to apply some custom textures. I have zero clue how to go at it. Please look at “shaderverse, polka dots, hope, the second shaderverse” monkey heads on the following image:

Is there a built in way I can achieve this effect with shaders?

1 Like

You can do anything you like with shaders if you have the skills. I’m just little bit confused is this about changing just light maps on the fly or really playing with shaders. Probably the latter… Me, being a total n00b in shaders, I use https://www.shadertoy.com/ as my base. Copy + paste and painfully trying to modify the existing code. There are some shader tutorials on YouTube as well. Involves a lot of math, good luck.

1 Like

It’s not easy to edit shaders
If the shaders break up into smaller sub shaders (shaders Nodes) we can manipulate the in between results

Yep, that’s my problem exactly. :smiley: I don’t have the skills. I didn’t even know how to start this. Gonna check this site out. Thanks for the tip!

That’s where the idea came from. In blender we have nodes and we can manipulate anything. They usually use Eevee with ShaderToRGB node to maniuplate color ramps. I was curious if we can do similar in here. I know about color ramp with the 1x32 texture. But as far as I know we can’t add pattern to it because it only effect light intensity.

Heh yeah, I feel you. This bad boii (https://github.com/tonihele/OpenKeeper/blob/master/assets/Shaders/UnitFlower.frag) took me 3 days to make. It really doesn’t do much :smiley:

Blender also has multiple passes, a variety of inputs at your disposal, compositing, etc…

For example, in Blender it is reasonably trivial to extract just the shadows or just the highlights into their own layer and then process them special in the compositor.

JME is a game engine that is trying to produce 60+ frames per second and as such doesn’t provide much in the way of splitting all of this out. Even in regular openGL rendering, “what is shadow” is a bit of a value judgment.

So your best bet is probably to look at post-processing shaders like used in the FilterPostProcessor. The CartoonFilter may be a good entry point but either way you will be doing a deep-dive into shader programming.

If you’ve never done shaders before, are highly motivated, and have reasonable programming experience (especially if you’ve done C before), then this is probably a 3-6 month journey to achieve effects with the fidelity of your sample image. A few weeks just to realize the scope of what you are trying to do, maybe.

Along the way you will have lots of “it’s looks almost like I want except when I turn this way or use these colors/lighting” edge cases.

Up to you if it’s worth it. It will be a fun journey, regardless… and very rewarding in the end.

Edit: to add links:

2 Likes