Hi folks, first dive into ShaderFX with Maya 2015 and it's the balls!
Building a optic camo shader, similar to Ghost in the Shell or Deus Ex.
I'm pretty happy with progress so far, but a few things I still can't figure out and don't know where to start looking.
1. I'm using Fresnel node to do the camera vector falloff; is there a better way of doing it? The controls from Fresnel is pretty good, but I can't help but feel like it could do more with some controls like a gradient shader from maya.
2. I'm using Lerp node to swap between two diffuse textures, the transition is uniform throughout the mesh. Is it possible to get some effect that starts at the Hand, for example, and expand through out the body over time? I thought of using vertex color as the mix control, but no idea how to pull off the expanding effect.
3. How can I get partially transparent mesh to occlude mesh behind it? Most obvious area is the head, as helmet becomes transparent, the head becomes more and more visible. I'm looking for ways to have the partially transparent helmet still occlude the head.
4. partially transparent to distort the environment behind it? Maybe this has to be a screen shader instead of surface shader? No idea where to start on this one.
Thanks!
Replies
Fresnel sounds like you are on the right track.
But you can always go into advanced mode and see the inside of the fresnel node, copy what is there, paste it elsewhere and modify it to do something better (whatever that might be)
2.
You can do this in a variety of ways.
you could apply a custom UV set to your mesh that transitions from the hand to the rest of the body and use the UV set and the time node to drive the lerp.
So the hand would be 0,0 in the uv set and the toes could be 1,1
You could also use vertex colors where the left hand is 0 and you blend the color to 1 over the mesh
3. make the parts of the head you don't want visible also invisible?
I probably don't understand
4. refraction. Currently not available.
you can fake it a bit with normal maps and a pre-bake cubemap, but yea its not dynamic.
1. I doubt I could do any better. It is quite good already, I just had in mind the Falloff material from Max while trying to recreate the effect in ShaderFX.
2. I think I understand the steps you described. The custome UV set would have to be created in Maya yes?
3. Yeah it's a little hard to explain... if you look at the knee area in the picture above, you can see both knees when the mesh is partially transparent... so there's that overlap effect where one knee is infront or behind the other leg. By occluding mesh behind the object, I'm looking to avoid that overlapped look when mesh transitions from 1 to 0 opacity. Turning on Backface Culling in Maya viewport helps a bit, but not completely.
Anyway, I'm happy with what I am able to get after a few nights of experimenting and tutorial watching. I'm sure I'll be able to get results closer to what I'm after the more I learn about shaderFX.
You can use it to recreate a "mario-galaxy" effect, where only the borders are lightened -or aren't- kind of like Fresnel, but with much more control.
You need to connect the "facing ratio" attribute from a sampler info node.
But if you are looking for better transparency sorting, you can switch viewport 2 to "depth peeling" in the viewport 2 settings.
(transparency algorithm option).
ShaderFX should support this and it will sort complicated meshes much better with transparency.
(It is also very slow :poly124: )
You're on the right track with fresnel, but what you need to do is read the colour of the pixel which has already been drawn as the background, in the location of the pixel you want to draw. You want to then transform that pixel into a new location, using probably the fresnel, to define in what direction you want to move it.
I'd advise you to take a good look at the reference material you're trying to reproduce:
[ame]https://www.youtube.com/watch?v=3WAoLiKHtnM[/ame]
It literally looks like they've just taken a copy of the background, zoomed in a little bit, and added some heavy lens distortion, then masked it to only show over the character.
http://i.neoseeker.com/neo_image/191966/article/deus_ex_human_revolution/dxhr%202011-08-28%2019-00-44-21.jpg
Deus Ex:HR has a nice cloaking effect with geometric grid + Fresnel in the player character body (some refraction too). His right hand is overlapping the right thigh, you can see it occluding leg, and still distorting the concrete pillar behind the body.
I understand the process you are describing, but I have no idea how I might do it with ShaderFX or otherwise.
Edit: yes after looking at the video, this is mainly refraction
The closer the refraction index to 1, the more stealthy / invisible he is
Something like 1.05 may be enough even
It also somewhat makes more sense from a logical point as the camo would try to simulate the colors around you / bend light somehow, while fresnel is just something easy to do in CG that dosnt relate too much to real life, atleast not in that visual way
and for 2... Looks like Maya lets me Keyframe vertex colors... so I can use that as a mask for expanding texture change. At least I have something to try when I get some time.