PDA

View Full Version : Desaturating Textures



JulianW
06-24-2005, 02:33 PM
Hi,

I was wondering if anyone knows a way to control the saturation of a texture. I've got a complex texture made up of a mixture of image maps, gradients, and procedurals which is coming out over saturated.

What I'd like to be able to do is either limit it from the surface editor, or the logical way would seem to be to apply a texture layer with a blend mode of saturation set to say 0% value with a layer opacity of 60%. I can't seem to find an obvious way of doing this and the scene is too complicated (and animated) to want to fix it in post. It's a shame there's no saturation blend mode isn't it.

cheers,


JW.

SplineGod
06-24-2005, 06:51 PM
You might be able to use the surfmix shader to do that. :)

MonroePoteet
06-24-2005, 07:10 PM
How about the Saturation slider in the Editing Tab of the Image Editor? Press F6, select the Editing Tab.

mTp

JulianW
06-24-2005, 07:30 PM
Thanks for the suggestions, unfortunately neither will do the deed. Surfmix will let me blend between two textures using the standard blend mode, and the image editor will only let me edit individual images not complete texture stacks.

any other ideas?

I'm not sure I've got enough time on my hands to write my own desaturate shader atm.

cheers,


JW.

Integrity
06-24-2005, 08:22 PM
You can try rendering out an alpha matte with just that specific surface as white, then use it as a mask in a compositing program to desaturate it there. Should render quickly (depending on how you set it up, which shouldn't take long since your just turning checkmarks off here and there).

MooseDog
06-25-2005, 07:14 AM
chk out under the image filter options something called wavefilter image. it's a post-process filter btw.

it has a saturation option, among many others which can be pretty useful.

it says under one of its tabs that you can filter the process to only affect certain objects, surfaces, etc. if you figure out how (i can't :) ), let me know thx.

might help. good luck.

MonroePoteet
06-25-2005, 10:34 AM
Here's a quicky Desaturation shader LScript. The input value ranges from 0.0 (no desaturation) to 1.0 (full desaturation...i.e. grayscale).

To add it, select LScript under the Surface's Shader tab, then double-click to navigate to the Desaturate.ls file. Once it's applied, double-clicking it allows you to change the desaturation amount.

It should be the last Shader in the list so it's applied after any other Shaders. Hope it works for you!

mTp

Update: Revised LScript to Load/Save value when saving the Object

JulianW
06-25-2005, 04:43 PM
Hi,

thanks folks for the ongoing suggestions, in turn:

Integrity: Good idea, however I was hoping to avoid multiple render passes as there are a number of scenes where the issue occurs. On a technical note with AA on then you could also be affected by a small amount of fringing hopefully nothing significant though. More importantly any coloured light shining on to the surface would also be desaturated.

MooseDog: Looks like an interesting little filter tool.. its a real shame that I can't seem to limit it to a single surface either.. its also likely to suffer from the same issues as Integrity's suggestion.

MonroePoteet: I took a look at your script, a nice clean piece of coding. It does the job well and seems to preserve the lighting colour. It does slow down the renders very slightly but not unacceptably. Its been a while since I fiddled with lscript shaders, and all my experiment had a real impact on render time so I'd discounted lscript as an option.

Looks like I'll probably use the lscript solution for now, but if anyone works out any other interesting techniques for doing this then I'm always keen to learn new tricks.

cheers folks,


JW.

SplineGod
06-25-2005, 05:23 PM
Surfmix lets you blend between two complete surfaces.
Each surface can have multilayers of textures so its not something that just blends between textures. :)

Capt Lightwave
06-25-2005, 05:32 PM
Sounds like a job for Worleys G2 to me....I may be stupid tho' ;)

JulianW
06-26-2005, 05:21 AM
Hi,

I guess I could use surfmix, but I'd have to create an identical texture that was completely desaturated, and then blend with that. As its a fairly complex texture that I still want to edit and tweak I'd rather avoid having to keep the two textures in sync.

I'm not sure if Worley's G2 would do the trick or not, there is a plugin in the Poolk collection called HSVBoost that sounds like it would do the trick, but I'm trying to keep my spending down at the moment,

cheers,


JW.

MonroePoteet
06-26-2005, 12:09 PM
I did a quick conversion of the LScript to an actual plugin. Same functionality, a little fancier interface (slider), hopefully faster performance. Good luck!

mTp

JulianW
07-12-2005, 01:01 PM
Hi,

sorry not to get back to you sooner, I just wanted to say thanks for writing the plugin, it works like a charm and doesn't hurt the render times unreasonably.

many thanks,


JW.

MonroePoteet
07-12-2005, 01:30 PM
You bet, glad it worked out.

mTp