Color To Float and Float To Color Utility.

Forums: Color To Float and Float To Color Utility.
Sub forum for feature requests etc

Moderator: juanjgon

Re: Color To Float and Float To Color Utility.

Postby fantome » Tue Oct 16, 2018 6:20 am

fantome Tue Oct 16, 2018 6:20 am
Thanks a lot for the extra info roeland !
User avatar
fantome
Licensed Customer
Licensed Customer
 
Posts: 266
Joined: Wed Dec 16, 2015 3:38 pm

Re: Color To Float and Float To Color Utility.

Postby Terryvfx » Sun Aug 28, 2022 2:01 pm

Terryvfx Sun Aug 28, 2022 2:01 pm
Necro-posting here... I would also love to have an utility to output float from color.
User avatar
Terryvfx
Licensed Customer
Licensed Customer
 
Posts: 358
Joined: Tue Dec 30, 2014 12:43 am

Re: Color To Float and Float To Color Utility.

Postby fantome » Mon Aug 29, 2022 3:22 pm

fantome Mon Aug 29, 2022 3:22 pm
Hi terry i don't know if it helps, but standalone has some OSL utility nodes that i have never test , but could answer your request.

utilities.JPG


this is jobigoud code from channel merger
Code: Select all
shader ChannelMuxer(
   color redChannel = color(0.7, 0.7, 0.7) [[ string label = "Red channel"]],
   color greenChannel = color(0.7, 0.7, 0.7) [[ string label = "Green channel"]],
   color blueChannel = color(0.7, 0.7, 0.7) [[ string label = "Blue channel"]],
   output color out = 0,
)
{
   // Typically the input colors will be grayscale but just in case we take the corresponding channel from the source.
   // This enables a richer mixing strategy without loosing flexibility.
   out = color(redChannel[0], greenChannel[1], blueChannel[2]);
}



this is the one from channel spliter :
Code: Select all
// RGB Channel Split as Grayscale
// Author: Thomas Cheng - Ambocc Studios
// www.ambocc.com - [email protected]
//
// Description: Connect a RGB texture and select the color channel to output as a grayscale image.

#define CHANNEL_R 1
#define CHANNEL_G 2
#define CHANNEL_B 3

shader ChannelExtractor(
      color rgbTexture = 0 [[ string label = "texture"]],
      int channel = 1 [[string widget = "mapper", string label = "Channel", string options = "R:1|G:2|B:3"]],
   output color out = 0,
)
{
   if (channel == CHANNEL_R)
      out = rgbTexture[0];
   else if (channel == CHANNEL_G)
      out = rgbTexture[1];
   else if (channel == CHANNEL_B)
      out = rgbTexture[2];
   else
      out = 0;
}


i would start standalone and investigate this and try to copy paste those OSL codes in houdini to check if they could do the job.

cheers
E
User avatar
fantome
Licensed Customer
Licensed Customer
 
Posts: 266
Joined: Wed Dec 16, 2015 3:38 pm
Previous

Return to User Requests


Who is online

Users browsing this forum: No registered users and 3 guests

Thu Mar 28, 2024 12:30 pm [ UTC ]