What sort of shader network is involved with making this work? I've got a vague idea of what's happening, but it's /really/ vague. I have neither Max nor Maya, and I'd like to take a crack at getting a Blender version up, assuming that's possible.
Great stuff rollin, I didn't know about this one.. and you're not capturing the thread at all Charles and I were thinking it'd make more sense to add this litSphere stuff to an existing shader rather than starting to build a flexible shader around it, so this is very cool indeed.
Mudbox's shader must be doing something more complex than what we have going here, because simply making this shader dependent on the light vector will give a very strange and generally undesirable result.
define 'define'.
litSphere shading samples a texture based on the view vector, changing the sample vector to a arbitrary 'light vector' will give a different, although generally undesirable effect.
the problem with expanding this Shading Through Texture concept is that these litSphere images combine various different surface, reflection and light properties in a static form.
you can do something basic - define 1 light source, with a litSphere (hemisphere) image for the lit side and extrapolate the unlit side - but paint in any rim-light effects and that is essentially adding another light source. painting in any sort of reflections or ambient light also wont work because they will not retain proper orientation independent of the 'light vector'.
you can get some cool, realistic effects by adding more and more litSpheres into a shader to combine them - but it becomes cumbersome and ruins (in my opinion) the beauty and simplicity of the litSphere concept.
concept: a single image - painted, sampled, constructed, can define an entire shader. with code that is so simple its almost magical.
I've made it view dependent.. And in general I use it more in form of a sfx or ambient overlay.. its even possible to only influence the rim light colour with it
but I haven't had much time lately to mess around with it a bit more
this shader projects the coordinates of the texels to cameraspace and simply using the light als source for the vecotr instead of the camera does the half job (backfaces)
It's amazing how much cool stuff people came up with with just a simple shader like this . After all the reactions on this shader I decided I should sign up here and offer some follow up... (some of them have been partially answered before though)
1) The current max shader peppi posted transforms the normals into view space (EEEK I only noticed now that my comment actually mentions world space...) the XY axes of the normal are then used to look up into the sphere texture.
2) The mudbox shader works differently, it transforms the normals into the "active" light's space. BUT! The default light in mudbox is attached to the camera basically causing a similar effect as (1). The only thing is that this way you can add an extra "offset" rotation to the sphere. However, if you make the light shine from an angle aproximately orthogonal to the camera you'll get to see mainly the rim and the effect just isn't too usefull that way.
3) It is possible to attach the litsphere to a light that is not attached to the camera but then you get the problem what to do when the camera looks in the direction of the light and sees the "back side" of the sphere... (besides the rim problem from (2) )probably using the front side as the back sides will give visually the best results... (check it out in mudbox by unchecking the attach to camera...)
4) About diffuse maps, specular maps, .... litspheres are so simple they are basically "all in 1" so it is light positions, light colors, diffuse color, specular color, ... all baked into one map. This makes for very few things to set up to get a certain effect although they limit the whole object to use the same material properties.
Through various artistic hacks you could make it work with other maps. My first try would be to have two litspheres a diffuse/ambient one and a specular one and then do:
Hey Its about time this thread got bumped again for anyone that missed it, and I made this matcap for somethign I was working on and thought Id share it.
Just saw this, and its great! Always liked the simplicity of matcap spheres, and because of Sculptris I've already exported most of the materials I use in zbrush as images can be used with this
Wow just saw this today, really awesome! Saves having to do a setup and everything if you just want to show off some WIPs and things. I love it, lots of fun too Thanks
Oooh, this is one fantastique technique to improve a lot the visual appearance of any object! :O
I used this trick to make some jello balls in Unity Engine, using the Toon Shader! It renders prettymuch the same.
is there a way to render the material in max somehow. like a hack or something. cuz i heard theres a way to do it in maya
Just use Ravenslayer's grabviewport script (it's on my shader page) to grab at 5000px wide. Then you can get AA and high resolutions, which i think is the only reason you'd wanna render ?
The Maya litspheres shader posted earlier seems to work in some scenes in Softimage. Applying it may result in an instant crash though (I think it might depend on whether or not the scene/mesh already has an image clip).
Works flawlessly for importing meshes into an existing scene where it works though.
the ones who would be interested using litspheres in Unity. there are two ways.
1 compiling the sphere textures to simplespheremap. and then use a basic toon shader and drop the simplespheremap in the cubemap slot.
2 or simple copy this shader.
found it on unity wiki i believe so props to the guy who wrote this
Hello all,
This amazing shader doesn't work well on Nitros ( max 2012 ) any ideas / fixes ?
Thank you for your time.
Best regards,
Amis
Hey! Amisima, i had the same problem, you can't use nitros and matballz, matballz runs on directX, it's a direct X shader, so if you want to use max 2012 and matballz you will have to change the viewport rendering from Nitros to DirectX (you can do this in customize--->viewport--->configure driver).
Replies
I hope I'm not capturing this thread with this advertisement.. so kill this post if you think so!
hmm, I'm trying to get it to work, maybe I'm missing something. Do I need to load it as a CGFX file? Or is there something else required?
Because loading it as a CGFX file seems to just cause errors.
"Unrecognised semantic LitSphere on parameter litSphereMap"
Looks cool though.
There IS a Santa Claus!
It looks like someone already has, plus a whole bunch more: http://blog.maginot.eu/index.php?seite=people&people=till&page=mhn1936983709
Me too, I'm wondering if it has to be Maya 2010?
load the plugin hlslShader.mll from you plugin/prefs
make a hlslShader node in the hypershade, load the *.fx file into the node - change viewport mode to TEXTURED, not high-quality.
you must use the .fx written up for maya, not the one from the original post, as max and maya have some subtle differences, such as Z vs. Y up
heres one litsphere i made.
litSphere shading samples a texture based on the view vector, changing the sample vector to a arbitrary 'light vector' will give a different, although generally undesirable effect.
the problem with expanding this Shading Through Texture concept is that these litSphere images combine various different surface, reflection and light properties in a static form.
you can do something basic - define 1 light source, with a litSphere (hemisphere) image for the lit side and extrapolate the unlit side - but paint in any rim-light effects and that is essentially adding another light source. painting in any sort of reflections or ambient light also wont work because they will not retain proper orientation independent of the 'light vector'.
you can get some cool, realistic effects by adding more and more litSpheres into a shader to combine them - but it becomes cumbersome and ruins (in my opinion) the beauty and simplicity of the litSphere concept.
concept: a single image - painted, sampled, constructed, can define an entire shader. with code that is so simple its almost magical.
but I haven't had much time lately to mess around with it a bit more
Here are the illustrator files.
It uses CS4.
1) The current max shader peppi posted transforms the normals into view space (EEEK I only noticed now that my comment actually mentions world space...) the XY axes of the normal are then used to look up into the sphere texture.
2) The mudbox shader works differently, it transforms the normals into the "active" light's space. BUT! The default light in mudbox is attached to the camera basically causing a similar effect as (1). The only thing is that this way you can add an extra "offset" rotation to the sphere. However, if you make the light shine from an angle aproximately orthogonal to the camera you'll get to see mainly the rim and the effect just isn't too usefull that way.
3) It is possible to attach the litsphere to a light that is not attached to the camera but then you get the problem what to do when the camera looks in the direction of the light and sees the "back side" of the sphere... (besides the rim problem from (2) )probably using the front side as the back sides will give visually the best results... (check it out in mudbox by unchecking the attach to camera...)
4) About diffuse maps, specular maps, .... litspheres are so simple they are basically "all in 1" so it is light positions, light colors, diffuse color, specular color, ... all baked into one map. This makes for very few things to set up to get a certain effect although they limit the whole object to use the same material properties.
Through various artistic hacks you could make it work with other maps. My first try would be to have two litspheres a diffuse/ambient one and a specular one and then do:
diffuse_map * diff_sphere + specular_map * spec_sphere
But there are literally 100's of ways to add litspheres to existing materials. (e.g. Check out rollins very cool NPR material... :poly121:)
dude...
Here's my quick and dirty sphere if anybody wants to try it out:
I made a blog post about this shader on my wordpress, linked this thread
I used the Auxpecker maps ! They are awesome ! You need to check them
http://zellersamuel.wordpress.com/2010/05/07/improve-your-3ds-max-viewport-qualit/
I wonder if you could extract images from the Zbrush matcaps ? (zmt files) that would be awesome
Here's two examples using the Auxpecker spheres
Cool glossy white, nice...
Good idea, im gonna try
I made a bunch of litsphere's some time ago.. When I found this thread I thought you peoples might be interested in them.
Most of these were made by making a material in 3d applying that to a sphere and rendering it.
Here's an example of a few litspheres.
Download the .rar here:
http://www.bb0x.com/mudbox/mudbox_litspheres_v2.rar
Cheers
I used this trick to make some jello balls in Unity Engine, using the Toon Shader! It renders prettymuch the same.
Just use Ravenslayer's grabviewport script (it's on my shader page) to grab at 5000px wide. Then you can get AA and high resolutions, which i think is the only reason you'd wanna render ?
Works flawlessly for importing meshes into an existing scene where it works though.
using mentalray there's a shader called mip_greyball.
1 compiling the sphere textures to simplespheremap. and then use a basic toon shader and drop the simplespheremap in the cubemap slot.
2 or simple copy this shader.
found it on unity wiki i believe so props to the guy who wrote this
This amazing shader doesn't work well on Nitros ( max 2012 ) any ideas / fixes ?
Thank you for your time.
Best regards,
Amis
Hey! Amisima, i had the same problem, you can't use nitros and matballz, matballz runs on directX, it's a direct X shader, so if you want to use max 2012 and matballz you will have to change the viewport rendering from Nitros to DirectX (you can do this in customize--->viewport--->configure driver).
I hope it helps!
Cheers!