Announcement

Collapse
No announcement yet.

OSL backfacing faces render black

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

  • OSL backfacing faces render black

    I've never noticed this before so I hope it's not some setting I've overlooked, but when rendering an object with an OSL material the flipped/backfacing faces will render black in the diffuse, even if you assign a colour to them specifically with backfacing() or when overriding the normal with (0.5, 0.5, 1) in the shader.
    It won't render the default colour, it will always just render black. In both 3.2 & 3.3.
    A VRay mat renders fine, it's not a backface culling then.

    Have a look at the following shader. If you assign it to two planes, one rotated 180 degrees, one will show up green and the other black. Ideally the other one would render red.

    Code:
    surface
    normTest
    (
    )
    {
    	color c_diff = color(0.5);
    	if (backfacing())
    	{
    		c_diff = color(1,0,0);
    	}
    	else
    	{
    		c_diff = color(0,1,0);
    	}
    	Ci = diffuse(N) * c_diff;
    }
    Is there a fix/workaround for this? Thanks!
    Last edited by Rens; 10-02-2016, 03:08 AM.
    Rens Heeren
    Generalist
    WEBSITE - IMDB - LINKEDIN - OSL SHADERS

  • #2
    To clarify, this happens with all diffuse outputs from an OSL material. Like the plastic example in the docs, which shows up black on the back facing side as well:
    http://docs.chaosgroup.com/display/VRAY3MAX/OSL+Support
    Rens Heeren
    Generalist
    WEBSITE - IMDB - LINKEDIN - OSL SHADERS

    Comment


    • #3
      As a workaround I tried a VRay2Sided mat with the OSL in the front and a VRayMat in the back, though this seems to mess up UDIM lookup and every bucket will have a different colour.
      Thanks! : )
      Rens Heeren
      Generalist
      WEBSITE - IMDB - LINKEDIN - OSL SHADERS

      Comment


      • #4
        Hi, did someone have a chance to confirm this is an issue? Thanks!
        Rens Heeren
        Generalist
        WEBSITE - IMDB - LINKEDIN - OSL SHADERS

        Comment

        Working...
        X