shader mm_RGBSplit(
color in = 0,
float red = 0 [[float min=0, float max=1]],
float green = 0 [[float min=0, float max=1]],
float blue = 0 [[float min=0, float max=1]],
output color c = 0)
{
c = in[0]*red+in[1]*green+in[2]*blue;
}
milanm wrote:Did this in 5 min, it should do the trick. Watch out for gamma!
Gotta go now... deadlines... stress... dead GPUs... 18-hour days... I am so pale I got more nits than a BVM-X300 !
OSL code:
- Code: Select all
shader mm_RGBSplit(
color in = 0,
float red = 0 [[float min=0, float max=1]],
float green = 0 [[float min=0, float max=1]],
float blue = 0 [[float min=0, float max=1]],
output color c = 0)
{
c = in[0]*red+in[1]*green+in[2]*blue;
}
Regards
Milan
frankmci wrote:This is super-handy and really should be a standard node for Octane, in my opinion.
calus wrote:frankmci wrote:This is super-handy and really should be a standard node for Octane, in my opinion.
OSL can be more handy but you can achieve the exact same result as Milanm's OSL shader with Octane math nodes:
- use "multiply" nodes by pure red, green, blue color to get the 3 color channels from greyscal textures,
- then use the "add" node to get the final RGB color.
sbstnc wrote:I had a quick look at the docs but can't work this out, can someone school me on how to apply this?
Drag in an OSL node, paste the code into it, how do you get the image input pin though? There's no pin to connect an image on the left.
Hitting compile does nothing either. What am I missing here?
Users browsing this forum: No registered users and 9 guests