Matcap shader for Softimage
Plugins linking to this thread: (hide)
Matcap shader for Softimage
[..] 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"
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"
Re: Matcap shader for Softimage
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!
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!
- Daniel Brassard
- Posts: 878
- Joined: 18 Mar 2010, 23:38
- Location: St. Thomas, Ontario
- Contact:
Re: Matcap shader for Softimage
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
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
set "Softimage" "true"
$endif
Re: Matcap shader for Softimage
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 nVidiaMatic 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!
Re: Matcap shader for Softimage
Thanks Hirazi that worked.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
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.
Re: Matcap shader for Softimage
@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.
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.
Re: Matcap shader for Softimage
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.
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.
Re: Matcap shader for Softimage
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.
// 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.
- Daniel Brassard
- Posts: 878
- Joined: 18 Mar 2010, 23:38
- Location: St. Thomas, Ontario
- Contact:
Re: Matcap shader for Softimage
The errors ring a bell ....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
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
set "Softimage" "true"
$endif
Re: Matcap shader for Softimage
The crashes are annoying, one thing I noticed MetaSL shaders don't respond to light reaction.
- Daniel Brassard
- Posts: 878
- Joined: 18 Mar 2010, 23:38
- Location: St. Thomas, Ontario
- Contact:
Re: Matcap shader for Softimage
@ ActionArt and Matic,
I modified the program a bit, try this one and let me know how it work. Modification made:
@ 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.
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.
@ 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
set "Softimage" "true"
$endif
Re: Matcap shader for Softimage
If only it didn't crash Softimage with HQV it would be nice to model with it. It would be better if it could respond to light, for example in Mudbox which I use extensively, I can move the lights around on a clay material, then again Mudbox is relying on the GPU while Softimage is suppose to be relying on the GPU with HQV.Daniel Brassard wrote:@ ActionArt and Matic,
I modified the program a bit, try this one and let me know how it work. Modification made:
Matic, hope you didn't mind me muddling with your code.
- 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.
@ 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.
- Daniel Brassard
- Posts: 878
- Joined: 18 Mar 2010, 23:38
- Location: St. Thomas, Ontario
- Contact:
Re: Matcap shader for Softimage
So version 1.1 crash Softimage?If only it didn't crash Softimage with HQV it would be nice to model with it.
$ifndef "Softimage"
set "Softimage" "true"
$endif
set "Softimage" "true"
$endif
Re: Matcap shader for Softimage
I never tried your modified one, let me get back to youDaniel Brassard wrote:So version 1.1 crash Softimage?If only it didn't crash Softimage with HQV it would be nice to model with it.
Re: Matcap shader for Softimage
Thanks!! Will give it a try this weekend.Daniel Brassard wrote:@ ActionArt and Matic,
I modified the program a bit, try this one and let me know how it works.
Re: Matcap shader for Softimage
Just gave it a quick try. So far, works great! No mapping differences, no errors, no crashes (yet).
Awesome! Thanks!!!
Awesome! Thanks!!!
Re: Matcap shader for Softimage
You are limited with the type of SSS nodes you can use with 3D Delight It isn't too bad though considering the NPR you achieve from 3Delight Where is there Renderman shaders, where ?Mathaeus wrote:Just for info, there is a custom Mental Ray "MatCap" shader for a long time, by Stefan Minning. However there's question, how to incorporate it into standard lighting system - as it actually ignores any kind of light, direct or indirect.
At least, that's reason I never tried to cook something in ICE, along this line, especially with 3delight - as it already have it's own subsurface scattering.
Who is online
Users browsing this forum: No registered users and 24 guests