Matcap shader for Softimage

Plugins linking to this thread: (hide)

Matcap shader for SoftimageAuthor: Andy Moorer
[..] I've banged together a Matcap shader (aka litsphere) in metaSL which works in the Softimage High Quality viewport. You know how in Zbrush models look kind of like clay or other materials as you work on them? That's Matcap shading.

It's provided "as-is" but since its metaSL it should work for everyone regardless of graphics card as well as look the same in HQ/real time, and mental ray. That's the theory, anyway.


local backup: litsphere_packaged.xsiaddon"

Discussions regarding Materials, Material-Compounds or Shaders, etc.
User avatar
ActionArt
Posts: 853
Joined: 25 Nov 2010, 18:23
Location: Canada

Re: Matcap shader for Softimage

Post by ActionArt » 14 Feb 2013, 00:20

Thanks!

User avatar
Tekano
Posts: 488
Joined: 09 Jun 2009, 14:49
Location: London, UK

Re: Matcap shader for Softimage

Post by Tekano » 14 Feb 2013, 01:31

yeah I remember when decent matcaps first came out on zbrush, 28th May 2007 it was. :D tried them as images applied to the greyball type shader in SI from that very repository and was like 'meh' seems they have come back again! think it was just the MR shader version though so do not recall a realtime one, not had the pleasure of it in the viewport. I see it like the spongebob squarepants replacement skin for the viewcube. really cool to try a few of the different skins out but the novelty soon wears off. think last time I got as far as green Jelly or tomato. the clay one is the best and as Andy says there is a lot of potential for NPR type stuff. but I dont do any sculpting much in the viewport so I may be biased and viewcube is OFF.
Gossip is what no one claims to like, but everybody enjoys.

Falam

Re: Matcap shader for Softimage

Post by Falam » 14 Feb 2013, 05:40

Tekano wrote:yeah I remember when decent matcaps first came out on zbrush, 28th May 2007 it was. :D tried them as images applied to the greyball type shader in SI from that very repository and was like 'meh' seems they have come back again! think it was just the MR shader version though so do not recall a realtime one, not had the pleasure of it in the viewport. I see it like the spongebob squarepants replacement skin for the viewcube. really cool to try a few of the different skins out but the novelty soon wears off. think last time I got as far as green Jelly or tomato. the clay one is the best and as Andy says there is a lot of potential for NPR type stuff. but I dont do any sculpting much in the viewport so I may be biased and viewcube is OFF.
You have a point, a clay MetCap would be useful. I'll still use it occasionally :)

User avatar
Firebird
Posts: 81
Joined: 04 Jun 2009, 12:08
Location: Vienna
Contact:

Re: Matcap shader for Softimage

Post by Firebird » 14 Feb 2013, 13:45

Hi thanks for the shader.

Helge Mathee also did a MatCap shader 2009 I think. Which I used a bit. So I attached it if anyone wants to take a look.

I got a collection of textures. The zip got 13MB so I would need a filehoster if anyone is interested, its over the limit of the forum attachments.

PS: Is there a way to install the msl over a workgroup ?
Just putting it in Application\phenolib\msl on a workgroup didn´t work.

Image

Moderator edit: Filehoster? Ha! :D - HB
The aforementioned file in three pieces...
MatCap_materials.part1.rar
MatCap_materials.part2.rar
MatCap_materials.part3.rar
Attachments
Helge Mathee_MatCap_shader.7z
(1.74 KiB) Downloaded 371 times

User avatar
Hirazi Blue
Administrator
Posts: 5107
Joined: 04 Jun 2009, 12:15

Re: Matcap shader for Softimage

Post by Hirazi Blue » 14 Feb 2013, 22:56

Firebird wrote:PS: Is there a way to install the msl over a workgroup ?
Just putting it in Application\phenolib\msl on a workgroup didn´t work.
Perhaps - I haven't tested this however - equivalent/analogous to the workgroup location of (unsupported legacy) cgfx files in a new folder "[workgroup]\Application\msl\".
Spoiler alert: THIS IS HOWEVER PURELY GUESSWORK ;)
Stay safe, sane & healthy!

Falam

Re: Matcap shader for Softimage

Post by Falam » 16 Feb 2013, 02:11

Softimage crashes everytime I use this shader on High Quality Viewport :(
I did what the readme states, I connected this shader to the surface port on the material, wait a few seconds, Softimage crashes.

Here is the Matcap shader as seen on a sphere, which surprisingly enough didn't crash softimage, although I doubt it should look like a texture image is applied to the sphere, even if it is meant to be a reflection map, unless I'm missing something, there is no reflection port on the material node ?

Image

Matic
Posts: 70
Joined: 18 Jun 2009, 19:58

Re: Matcap shader for Softimage

Post by Matic » 20 Feb 2013, 03:32

Not sure why you are experiencing crashes, but I suspect it has to do with graphics card issues, I have a machine which has crashed with the shader a fair bit, using an AMD card, while others with nVidia cards seem solid.

The texture you see there is just a stand-in texture I pointed at since everyone should have it (I should make it the noicon img.... There are no matcap textures included and I didn't want to package this as an addon just to install one. You'll need to DL one and replace the texture, or use one from this forum. :)

It's perfectly ok to use the matcap in the diffuse slot of a material like a constant, if that is stable for you. It should still look right, and you can then do interesting stuff like make the surface reflective, which might look cool. Or you can use it with other combinations, the shader is just outputting color.

So the image you show may be working right, and only need a matcap image instead of that one. That's all a matcap really is, it's a texture of a particular type, mapped to the object according to the relationship between the surface normals and the camera. That's why it is such a good choice for tools like zBrush which have to shade millions of polygons in real time - they can make meshes look like they have cool lighting with almost no processing cost.

I hope that helps a little!

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: Matcap shader for Softimage

Post by Daniel Brassard » 20 Feb 2013, 21:29

Hi Andy, thanks for the shader.

You forgot to mention your previous blog on this subject which is very interesting too so to put them together:

http://andy.moonbase.net/archives/1037
http://andy.moonbase.net/archives/651

Always liked your blog. Keep it coming!

Cheers!

Dan
$ifndef "Softimage"
set "Softimage" "true"
$endif

Falam

Re: Matcap shader for Softimage

Post by Falam » 21 Feb 2013, 06:52

Matic wrote:Not sure why you are experiencing crashes, but I suspect it has to do with graphics card issues, I have a machine which has crashed with the shader a fair bit, using an AMD card, while others with nVidia cards seem solid.

The texture you see there is just a stand-in texture I pointed at since everyone should have it (I should make it the noicon img.... There are no matcap textures included and I didn't want to package this as an addon just to install one. You'll need to DL one and replace the texture, or use one from this forum. :)

It's perfectly ok to use the matcap in the diffuse slot of a material like a constant, if that is stable for you. It should still look right, and you can then do interesting stuff like make the surface reflective, which might look cool. Or you can use it with other combinations, the shader is just outputting color.

So the image you show may be working right, and only need a matcap image instead of that one. That's all a matcap really is, it's a texture of a particular type, mapped to the object according to the relationship between the surface normals and the camera. That's why it is such a good choice for tools like zBrush which have to shade millions of polygons in real time - they can make meshes look like they have cool lighting with almost no processing cost.

I hope that helps a little!
It worked beautifully on a sphere using one of the MetCap images that firebird had uploaded. It failed on every other object, rather Softimage crashed. I loaded a character mesh, made sure the Subdivide level was at zero, applied the shader, high quality viewport was on, Softimage crashes. All this on a nVidia card, makes no sense, ATi, yes, not nVidia :-l X( =((

User avatar
Firebird
Posts: 81
Joined: 04 Jun 2009, 12:08
Location: Vienna
Contact:

Re: Matcap shader for Softimage

Post by Firebird » 21 Feb 2013, 08:59

Hirazi Blue
Perhaps - I haven't tested this however - equivalent/analogous to the workgroup location of (unsupported legacy) cgfx files in a new folder "[workgroup]\Application\msl\".
Spoiler alert: THIS IS HOWEVER PURELY GUESSWORK
Thanks Hirazi that worked.

Sadly I also got some random crashes with the shader.
Didn't had much time to test when and why, the HQV worked most of the time (sometimes I got a crash when changing the texture image, but I think thats HQV relatet) but the mr render failed (renders black, or crash to Desktop).
Also on Nvidia here. 580GTX.

Matic
Posts: 70
Joined: 18 Jun 2009, 19:58

Re: Matcap shader for Softimage

Post by Matic » 22 Feb 2013, 06:31

@daniel thanks for the kind words!

Re: crashes

:(

I'll look into it. As far as I can tell I'm not doing anything I shouldn't in the shader, which is pretty tiny. But clearly there's an issue somewhere.

I planned on a better version eventually with a bit more to it - maybe I'll avoid metaSL entirely, I'm wondering if its crashing during the compilation phase. It would be nice if we could have matcaps in a normal shaded/texture view, too... I hate waiting for the HQ viewport when you first enter it.

User avatar
ActionArt
Posts: 853
Joined: 25 Nov 2010, 18:23
Location: Canada

Re: Matcap shader for Softimage

Post by ActionArt » 22 Feb 2013, 15:47

I also have regular crashes when I go to render in MR. Not every time but about half the time. It gives and error, I'll record it next time. Also noticed the texture mapping is not the same in MR as in the viewport. I'll get some samples.

This shader has really made the viewport far easier to work with in the modeling phase, It actually made the HQV useful :)

If possible it would be nice to have it in the other modes as well (because of the HQV delay) but overall I really like this shader.

User avatar
ActionArt
Posts: 853
Joined: 25 Nov 2010, 18:23
Location: Canada

Re: Matcap shader for Softimage

Post by ActionArt » 22 Feb 2013, 15:58

I don't know if this helps but I get this error with the render region:

// WARNING : SHDB 0.2 7 MB warn 732777: W216 C:\Program Files\Autodesk\Softimage 2013 SP1\Application\phenolib\msl\litsphere.msl(16): warning: useless explicit cast to "float"
// WARNING : SHDB 0.2 7 MB warn 732777: W216 C:\Program Files\Autodesk\Softimage 2013 SP1\Application\phenolib\msl\litsphere.msl(16): warning: useless explicit cast to "float"
// ERROR : API 0.2 7 MB error 301099: while defining texture "MI_default_texture_relief_map_1_height.dds": failed to open texture file relief_map_1_height.dds

Here's a couple renders as well, MR and viewport (bottom). The texture projection is definitely different somehow. Perhaps something isn't translating there.
Attachments
T1.jpg
T2.jpg

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: Matcap shader for Softimage

Post by Daniel Brassard » 22 Feb 2013, 17:00

I don't know if this helps but I get this error with the render region:

// WARNING : SHDB 0.2 7 MB warn 732777: W216 C:\Program Files\Autodesk\Softimage 2013 SP1\Application\phenolib\msl\litsphere.msl(16): warning: useless explicit cast to "float"
// WARNING : SHDB 0.2 7 MB warn 732777: W216 C:\Program Files\Autodesk\Softimage 2013 SP1\Application\phenolib\msl\litsphere.msl(16): warning: useless explicit cast to "float"
// ERROR : API 0.2 7 MB error 301099: while defining texture "MI_default_texture_relief_map_1_height.dds": failed to open texture file relief_map_1_height.dds
The errors ring a bell ....

MetaSL specification.

http://www.nvidia-arc.com/fileadmin/use ... ar2011.pdf

For those interested in coding MetaSL shaders, here is a resource site

http://www.metasl.org/

MetaSL Shaders Library

http://materials.mentalimages.com/

@Matic

I'll have a look at your code.
$ifndef "Softimage"
set "Softimage" "true"
$endif

Falam

Re: Matcap shader for Softimage

Post by Falam » 22 Feb 2013, 18:23

The crashes are annoying, one thing I noticed MetaSL shaders don't respond to light reaction. X(

User avatar
Daniel Brassard
Posts: 878
Joined: 18 Mar 2010, 23:38
Location: St. Thomas, Ontario
Contact:

Re: Matcap shader for Softimage

Post by Daniel Brassard » 22 Feb 2013, 20:34

@ ActionArt and Matic,

I modified the program a bit, try this one and let me know how it work. Modification made:
  • Removed the hardcoded texture "relief_map_1_height.dds".
    Modify the soft_range parameter by removing the float type inside the parenthesis
    some cleanup of the code.
Matic, hope you didn't mind me muddling with your code.

@ Falam

Correct, the light interaction will have little influence on the Matcap, this is intended and the correct behaviour. See it as a baked light texture.

The shader is intended for use in modeling/sculpting ala Mudbox/ZBrush.
Attachments
litsphere_v1_1.zip
(783 Bytes) Downloaded 160 times
Last edited by Daniel Brassard on 22 Feb 2013, 22:45, edited 1 time in total.
$ifndef "Softimage"
set "Softimage" "true"
$endif

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests