Sign in to follow this  
Natom

(Hex)Shape-Pattern Shading?

Recommended Posts

Natom    110

The goal here is to create an overlay effect which is aware of, ideally with a shader, which is specific to a series of shapes.

The idea is to only render hexes when a masking overlay completely envelopes the hex, like so:

Hex_Overlay_Example.png

...where the green dots represent hexes that would be filled and red represent partial hexes that could either be filled or ignored (either way/whichever is easier).

I've considered using a mask pre-chunked into hexes and clamping the uv position to 'tile-sized' increments, but aside from that feeling kind of hacky / unclean / error-prone, it'd be really nice to be able to use this with masks based off of other effects (like an explosion effect or distortion wave).

I've tried Googling this but haven't had much luck, and honestly I'm not sure what to look for or even what to call this. Does anyone have any experience with a similar effect or can point me in the right direction?

-Tom

Share this post


Link to post
Share on other sites
Natom    110

You know, at first it looked like a noise mask (tiny hexes and very smooth), but I think this is actually it!

If you replace line 214 with:

vec3 col = vec3(1, 1, 1)-fbm(vec2(uv.x-time*28.0, uv.y)*0.008);

and change the hex size on line 47 to:
const float hexSize = 80.0;

You can see harsh color differences between the hexes. Of course, it needs a good bit of refactoring and I have to actually figure out what all it's doing but... still, having a reference point is huge. I'm floored, thanks so much! +1
 
-Edit
Looking through the site, I think this is actually a little closer to my target effect. I had no idea this site even existed. Shaders have always been black magic to me and I recently decided to take the leap, this is going to be a huge help.
Edited by Natom

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this