Announcement

Collapse
No announcement yet.

OSL goodness in Vray

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Paul Oblomov
    replied
    I wish I had

    Only this
    http://developer.download.nvidia.com...ples.html#rain

    http://developer.download.nvidia.com...WhitePaper.pdf
    with old .fx shaders inside.

    Leave a comment:


  • vlado
    replied
    Do you have the GLSL source that was used in the Blender example?

    Best regards,
    Vlado

    Leave a comment:


  • Paul Oblomov
    replied
    Just having some time on RnD, before next episode starts. The idea is to have rain shader on top of the materials, to represent wetting with falling rain. Smth, like in UE4 and unity engines.

    Any ideas ?


    Very good looking stuff here done in blender


    https://vk.com/video164595741_171582289



    and the papers behind this


    https://seblagarde.wordpress.com/201...-wet-surfaces/

    Leave a comment:


  • Lapaev
    replied
    yes, it works perfectly fine, my issue was some nodes had weird privelleges bug where enviroment varibale would disappear after install. So after setting it manually everything reads nicely!

    Leave a comment:


  • bhouston
    replied
    Hi guys,

    Was there any solution to the VRayOSLMtl issues where when you try to render with a *.osl file directly using VRay Standalone, you get the error "OSL include path not set"? I assume it is a path required for oslc.exe?

    I'm trying to setup an environment where I can easily code up some complex OSL shaders with V-Ray and was thinking VRay Standalone would be a great solution to this.

    Best regards,
    Ben Houston

    Leave a comment:


  • vlado
    replied
    The support guys will look into that, but in the meantime have you tried using .oso files instead of the original .osl?

    Best regards,
    Vlado

    Leave a comment:


  • Lapaev
    replied
    Originally posted by Zdravko.Keremidchiev View Post
    Alright, let me know if the issue still persist.
    Filed a ticket, i get this issue on 3 out of 4 identical nodes :/
    OSL include path not set error, and i get black bucket

    Click image for larger version

Name:	issue.jpg
Views:	1
Size:	535.1 KB
ID:	858413

    Leave a comment:


  • snivlem
    replied
    Awesome, that code seems to have fixed it. This is a very nice shader - thanks for sharing it.

    Leave a comment:


  • sharktacos
    replied
    Originally posted by snivlem View Post
    Okay it is definitely the specular, something is messed up - it is fixable by turning the spec colour to 100% black.

    [ATTACH=CONFIG]26068[/ATTACH]

    Okay I think I see the problem. The shader uses a Vray_Blinn closure combined with a reflection closure. The reflection closure has a parameter for the ETA (the fresnel reflection IOR), but does not have a parameter for reflection glossiness. The Blinn closure has glossiness, but does not have the ETA. A quick fix would be to do this:

    Code:
    closure color specular_component = Spec_amount * SpecColor *       
                vray_blinn (bumped_normal, Glossiness, Anisotropy, Aniso_rotation,       
                "subdivs", Subdivs, "trace_reflections", Trace_reflections);       
    
            Ci = diffuse_component + specular_component + sheen_component;
    This basically removes the reflection component. The Vray_Blinn is also doing reflections, so the reflection closure is redundant. The Vray_Blinn closure does not have a parameter for fresnel, but the shader has code that adds this to it.
    Last edited by sharktacos; 21-09-2015, 10:21 AM.

    Leave a comment:


  • sharktacos
    replied
    Can you post a test scene? I am not able to reproduce the error.

    Leave a comment:


  • snivlem
    replied
    Okay it is definitely the specular, something is messed up - it is fixable by turning the spec colour to 100% black.

    Click image for larger version

Name:	spec.JPG
Views:	1
Size:	31.6 KB
ID:	858373

    Leave a comment:


  • snivlem
    replied
    Vlado - I can't work out what it is but it may not be "trace reflections" that is causing the issue but rather glossiness of the specular is not respected. Well at least on my tests and scenes it seems this is the case.

    Leave a comment:


  • sharktacos
    replied
    I'm noticing that the code I have for a bump map in OSL does not match a VrayMtl bump exactly. Wondering if someone knows how to fix this? Here's a gif showing the difference:

    Click image for larger version

Name:	OSLb.png
Views:	1
Size:	57.2 KB
ID:	858334
    Click image for larger version

Name:	OSLa.png
Views:	1
Size:	56.5 KB
ID:	858335

    The images are close, but still off. It seems that the VrayMtl bump goes in a bit more and is shifted slightly (as if it is rotated in Y). Also the delta is set in the OSL to 0.004 while the delta in the VrayMtl defaults to 1.0.

    Note to get this I had to set the bump amount on the OSL to 10 rather than 1 (which the VrayMtl bump is set to). So initially the difference is even greater.

    Here's the OSL

    Code:
    normal getBumpedBump(color centerColor, color uColor, color vColor, float inverseBumpAmount)
    {
    
        vector worldTangent = normalize(dPdu);
        vector worldBitangent = normalize(dPdv);
        vector worldNormal = normalize(N);
        vector average = vector(0.3333333);
    
        float center = dot(average, vector(centerColor));
        float ddu = center - dot(average, vector(uColor));
        float ddv = center - dot(average, vector(vColor));
        
        return normalize(ddu * worldTangent + ddv * worldBitangent + inverseBumpAmount * worldNormal);
    
    }
    
    
    surface bump_mat
    (
        /* Diffuse section */   
        color Diffuse_color = 0.5,
        float Diffuse_weight = 0.8,
        float Roughness = 0.0,
        
        /* Bump section */
        string Bump_texture = "bump.png",
        float Bump_amount = 1.0,
        float delta = 0.004,
        output color result = 1 )
    
    {
    
        /* Define Bump */
        normal bumped_normal = N;
        if (Bump_amount > 0.0)
        {
            color center = texture(Bump_texture, u, v);
            color uColor = texture(Bump_texture, u + delta, v);
            color vColor = texture(Bump_texture, u, v + delta);
            bumped_normal = getBumpedBump(center, uColor, vColor, 1.0 / Bump_amount);
        }
     
            
            closure color diffuse_component =  Diffuse_color * Diffuse_weight * diffuse(bumped_normal, "roughness", Roughness);
            Ci = diffuse_component;
       
    }

    Leave a comment:


  • vlado
    replied
    Hm, ok will look into it.

    Best regards,
    Vlado

    Leave a comment:


  • snivlem
    replied
    No problem, thanks Vlado.

    With regards to the OP's cloth shader, it seems that "Trace reflections" is not respected.

    Click image for larger version

Name:	Capture.JPG
Views:	1
Size:	66.5 KB
ID:	858247

    Leave a comment:

Working...
X