Converting to grayscale

General discussion regarding exporter development in general.

Moderators: Ratow, coordinators

Converting to grayscale

Postby pciccone » Thu Jun 21, 2012 11:59 am

Hello.

What would be the best way to convert a color texture to grayscale? I don't mean to convert it to a float texture but to a "color" grayscale version? Should I use a Band texture with black and white inputs and drive it via the float version of the texture? Any more straightforward solution?

Thanks in advance.
User avatar
pciccone
Developer
 
Posts: 684
Joined: Wed Jan 13, 2010 11:02 am
Location: California

Re: Converting to grayscale

Postby jensverwiebe » Fri Jun 22, 2012 3:31 am

I use a mixtexture for such:

mixtex.jpg


Result:

imagetex.jpg


Jens
User avatar
jensverwiebe
Developer
 
Posts: 2124
Joined: Wed Apr 02, 2008 4:34 pm

Re: Converting to grayscale

Postby pciccone » Fri Jun 22, 2012 9:26 am

Thank you Jens.
User avatar
pciccone
Developer
 
Posts: 684
Joined: Wed Jan 13, 2010 11:02 am
Location: California

Re: Converting to grayscale

Postby Lord Crc » Fri Jun 22, 2012 10:58 am

I was thinking about adding implicit float -> color conversion, so you could use a float texture for a color field. The original motivation was to make it easier to use the native blender textures. Guess we have another reason now :)
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4447
Joined: Sat Nov 17, 2007 2:10 pm

Re: Converting to grayscale

Postby pciccone » Fri Jun 22, 2012 11:19 am

That would be great! Thanks.
User avatar
pciccone
Developer
 
Posts: 684
Joined: Wed Jan 13, 2010 11:02 am
Location: California

Re: Converting to grayscale

Postby jeanphi » Sat Jun 23, 2012 12:59 pm

Hi,

Just in case, I really think we should keep the core as simple as possible and handle corner cases outside of it: either in the exporters or at parsing time generating additional stuff on the fly. In the long term it will help a lot performance and maintenance wise.

Jeanphi
jeanphi
Developer
 
Posts: 6569
Joined: Mon Jan 14, 2008 7:21 am

Re: Converting to grayscale

Postby Lord Crc » Sat Jun 23, 2012 1:21 pm

jeanphi wrote:I really think we should keep the core as simple as possible and handle corner cases outside of it: either in the exporters or at parsing time generating additional stuff on the fly.


I was thinking about adding some code to ParamSet::GetSWCSpectrumTexture to create a mix or scale texture if it fails to find a color texture but does find a float, or something along those lines.
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4447
Joined: Sat Nov 17, 2007 2:10 pm


Return to General

Who is online

Users browsing this forum: No registered users and 0 guests