Announcement

Collapse
No announcement yet.

Random Colour per Object in OSL

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

  • Random Colour per Object in OSL

    Is there a way to get a random colour per object either directly in OSL or when plugging a switch/random texture into the OSL map?

    I couldn't find a way to access any per-object attribute in OSL.

    Plugging in a BerconGradient into a simple pass-through OSL tex (or any for that matter) crashes max to desktop as soon as I enable random per object and the buckets hit the object. Same with MultiTexture.

    VrayMultiSubTex changes to the default colour instead of random per node handle as soon as you pipe it through any OSL tex.

    Edit: Same for a VRayUserScalar or Color node, plug it in an OSL and max disappears when the rendering starts.

    Pass-through OSL tex:
    Code:
    shader
    passthrough
    (
    	string InputMap = "input.jpg",
    	output color Col_Out = color(0,0,0),
    	output float alpha = 1.0
    )
    {
    	color colTex = texture(InputMap,u,v);
    	Col_Out = colTex;
    }
    Thanks!
    Last edited by Rens; 28-10-2015, 09:44 PM.
    Rens Heeren
    Generalist
    WEBSITE - IMDB - LINKEDIN - OSL SHADERS
Working...
X