I'm trying to get the complex_ior to run ...
when i plug the shader nothing changes and i wonder where the interface is?
Announcement
Collapse
No announcement yet.
OSL goodness in Vray
Collapse
X
-
Originally posted by mayanic View Postsorry for that dumb question, but how to wire up the nodes in order to get the osl shader to work?
[ATTACH=CONFIG]25163[/ATTACH]
Leave a comment:
-
-
Originally posted by vlado View PostIt is in the changelog for the 3.20 releases:
(*) VRayOSLMtl/VRayOSLTex: Support for drop-down controls;
The nightly builds release notes are pulled automatically from Mantis, but this is not very reliable.
Best regards,
Vlado
Leave a comment:
-
Originally posted by sharktacos View PostI looked in the release notes in the nightlies and I do not see this mentioned there. Where could I get a list of the changes to OSL that have been implemented?
(*) VRayOSLMtl/VRayOSLTex: Support for drop-down controls;
The nightly builds release notes are pulled automatically from Mantis, but this is not very reliable.
Best regards,
Vlado
Leave a comment:
-
Originally posted by vlado View PostDrop-down menus actually do work in the latest builds - you used that in the fabric shader...
Best regards,
Vlado
LOL, I put the code in, but it was not working in my version. I'm glad it is now.
I looked in the release notes in the nightlies and I do not see this mentioned there. Where could I get a list of the changes to OSL that have been implemented?
Leave a comment:
-
Originally posted by sharktacos View PostOne thing to note is a lot of the metadata widgets are not yet implemented yet which impact the user interface (sliders, dropdown menus, etc).
Best regards,
Vlado
Leave a comment:
-
Joconnell asked elsewhereActually that's a thing too - your cloth shader looks great, do you have any links for intro to osl stuff or did you just jump in and start messing with other peoples examples?
Here are some links to stuff that helped me get my head around OSL:
Manuals First is the Chaos OSL help.
One thing to note is a lot of the metadata widgets are not yet implemented yet which impact the user interface (sliders, dropdown menus, etc). Also the print functions do not currently work which would help a lot with debugging. Now it either works or doesn't with no way to know what is broken.
Next is the official manual: SPI OSL manual (pdf)
Examples the next thing, as you said, is to learn from examples of what other folks are doing.
First up, of course, are the examples from Chaos: Chaos OSL respository
Then there are lots of Maya nodes here OpenMaya example OSL (remember that as the Chaos help says "The VRayOSLMtl takes into account only closure color output parameters." So all of these need to have the output changed to color so they will work)
and some fun textures here Sambler example OSL dfggd
and some examples from Sony too SPI example OSL
Since OSL is C-based, it's pretty easy to take a shader from a paper that was written in C++ and re-write it in OSL which means all those Siggraph papers with new cool functionality can be used in Vray with OSL.
Leave a comment:
-
Here's another OSL shader I thought was cool. It was originally posted in the Max forums here: http://forums.chaosgroup.com/showthr...light=gold+osl.
It uses the complex fresnel equation for metals, but to make it more artist friendly it remaps the refractive index (n) and extinction coefficient (k) to the more intuitive reflectivity (r) and edge tint (g) which are input as RGB colors. You use it just like the complex_IOR.osl (i.e. in a VrayOSLTex mapped to the reflection with Fresnel off).
I tweaked it so it would work in Maya, and hard-coded in the gamma correction:
Code://--Artist Friendly Metallic Fresnel-- // BY Ole Gulbrandsen - Framestore //olegul@hotmail.com //http://jcgt.org/published/0003/04/03/ //OSL version by JayCMiller //jcmiller.web@gmail.com float n_min( float r ) { return (1-r )/(1+ r ); } float n_max( float r ) { return (1+ sqrt ( r ))/(1- sqrt ( r )); } float get_n ( float r , float g) { return n_min( r )*g + (1-g)*n_max( r ); } float get_k2 ( float r , float n) { float nr = (n+1)*(n+1)*r-(n-1)*(n-1); return nr/(1-r ); } float get_r ( float n, float k) { return ((n-1)*(n-1)+k*k )/(( n+1)*(n+1)+k*k); } float get_g ( float n, float k) { float r = get_r (n,k); return (n_max( r)-n )/( n_max( r)-n_min( r )); } float AFMF ( float r , float g, float theta ) { //clamp parameters float _r = clamp(r ,0 ,0.99); //compute n and k float n = get_n (_r ,g); float k2 = get_k2 (_r ,n); float c = cos ( theta ); float rs_num = n*n + k2 - 2*n*c + c*c; float rs_den = n*n + k2 + 2*n*c + c*c; float rs = rs_num/ rs_den ; float rp_num = (n*n + k2)*c*c - 2*n*c + 1; float rp_den = (n*n + k2)*c*c + 2*n*c + 1; float rp = rp_num/ rp_den ; return 0.5*( rs+rp ); } shader AFMFresnelTex ( color Reflectivity = color(0.9451,0.7294,0.3725), color Edgetint = color(0.9961,0.9725,0.7333), //float Color_Gamma = 0.4545, output color result = color(0.5) ) { float thetaB = acos(dot(-I,N)); float RCH = AFMF(Reflectivity[0],Edgetint[0],thetaB); float GCH = AFMF(Reflectivity[1],Edgetint[1],thetaB); float BCH = AFMF(Reflectivity[2],Edgetint[2],thetaB); //result = pow(color(RCH,GCH,BCH), 1/Color_Gamma); result = pow(color(RCH,GCH,BCH), 2.2); }
Leave a comment:
-
Let me also mention that the bump map behavior is not the same as a VrayMtl. It looks to me like it is off by a factor of around 100, so to get the same bump as a vrayMtl with a bump value of 1.0 the OSL needs a bump value of 100. A quick and dirty workaround is just to add a multiplication like this:Code:float Bump_amount = Bump_amount * 100;
Leave a comment:
-
Originally posted by vlado View PostHere I've added tooltips to some parameters and renamed others to be perhaps a bit clearer:
https://confluence.chaosgroup.com/di...Fabric+shader#
@Derek: do you want me to add some additional information to the page (like a link to your website)?
Best regards,
Vlado
The pic would look better if it were lit by a directional light (it looks like it has HDRI lighting on it now), and was on a model of draped cloth like this: http://i.ytimg.com/vi/hmPHq0WTt-k/maxresdefault.jpg
I'll see if I can render something, and email it to you along with the Maya scene.
Leave a comment:
-
There is a bug in the OSL library that manifests itself on Windows 8.1; we've fixed this and submitted a patch, but for the moment you will need a nightly build to get it working. You can email support@chaosgroup.com to get that.
Best regards,
Vlado
Leave a comment:
-
Hello,
I tried to use the Frabic file from OSLShaders in the V-Ray for Maya 2015 SP6, Win 8.1 (version 3.05.04, revision 25954 from Jun 29 2015) But once I load the file I get fatal error. Is there any other step that I did not understand?
Thanks for OSL and attention!
Leave a comment:
-
Here I've added tooltips to some parameters and renamed others to be perhaps a bit clearer:
https://confluence.chaosgroup.com/di...Fabric+shader#
@Derek: do you want me to add some additional information to the page (like a link to your website)?
Best regards,
Vlado
Leave a comment:
Leave a comment: