Deviation Actions

vasilnatalie's avatar




Played around with the gem stuff I was working on a little more.  Got it working a little bit better.  Parallax is probably a dead end for what I'd like to do with them anyways.

I think the whole reason people think gems are cool is because the way the light works with them, they're a little otherworldly.  The whole point to them is the unreality of them.  But I think video games totally miss this-- you're all excited when you get a valuable gem in some RPG, say, but you look at it and it's a pebble.  There's no magic there.  The game designers rarely try to design shaders for them, because no popular style of shading is going to work to make them magical, and because, really, it's unimportant, but I think that they miss out on some eye candy.  The actual cost is almost entirely in the labor-- if you're not looking close, gems are never going to take up much fill-rate.

So here you have a relatively simple mesh, with some diffuse, specular, a cube map, and a fresnel factor.  But it also has two specular-masked planes contained within the mesh itself, which are used to sort of grab specular from the middle of the mesh.  I render these to a different render target, and then add them on to the gem.  The goal here is to make it appear like the specular has some depth.  I may also try the trick that I did with the medieval halo to get the specular to seem to actually emanate from behind the rock, no matter the view angle.  Or, for that matter, in front of the rock.

To make a decent (not great) specular mask, I tend to take the inverse of the mask, reduce the brightness and contrast, and then add it back to the original, uninverted mask.  This gives a bit of complexity to the specular without requiring me to be a great artist.

If you were a good artist, like I'm not, you'd probably be normal mapping the fracture planes, for additional complexity in the specular.  You can tell that the internal planes are pretty much flat.  Of course, there's no reason they have to be.  Except they can't be concave, not with MMD.

Fave weapon in Dark Souls was the obsiidian sword-- after I earned that thing, you're damn right I used it.  Obsidian is like this too.  There's a surface layer, but there's also specular just barely peeking through, reflected from internal fracture planes when the angle is steep enough.

Edit: I'm liking these gifs.  I should've been using them a long time ago.  I care a lot more about stuff that moves right.

Edit2: Just want to add, I wouldn't recommend any games implementing things in the exact way that I did.  I don't build for performance, but mostly, to get around the gaps in my own ability.  You don't want to make a bunch of render targets and do a bunch of add passes.  But if you create UV2 coords for your mesh, you can do transformations on those in the vertex shader and do all your "deep" specular at the surface, in a single pass.
Image details
Image size
1024x768px 2.77 MB
Join the community to add your comment. Already a deviant? Log In
animaniac72's avatar
Have you tried the HKgem effect?