Google-apps
Hoofdmenu

Post a Comment On: C0DE517E

"Smoothen your functions"

8 Comments -

1 – 8 of 8
Anonymous Nathan Reed said...

Interesting idea about the smooth min/max! I note that your formula can be simplified a bit, to:

-log(exp(x*s) + exp(y*s)) / s

I had occasion once to try to make a smooth min filter for images - in other words, a min filter that weighs farther-away pixels less somehow, so that the resulting image remains smooth. I came up with this:

min(pixelValue + smoothstep(0, filterRadius, pixelRadius))

where the min is over all the pixels within filterRadius. If the image values are between 0 and 1, this leads to the min ignoring anything farther than filterRadius, "almost ignoring" things near filterRadius, and so on. Handy thing to remember.

April 26, 2014 at 5:32 PM

Blogger DEADC0DE said...

Cool, thanks for noticing that, it's also nice to know that someone actually reads the formulas and everything :)

It's written in that way because I actually made first the "always positive" version, and you can notice that's the same just "dropping" the log/exp.

Cool also to know about the weighted min, I used something similar to bias a buffer towards "dark", I was actually planning to blog about that trick (it's actually in the fight night champion slides if you look for it)
I had some use for the weighted median as a denoising filter in the past as well (http://en.wikipedia.org/wiki/Weighted_median)

April 26, 2014 at 5:39 PM

Blogger Unknown said...

Inigo Quilez has a page of "useful little functions" here: http://iquilezles.org/www/articles/functions/functions.htm

April 29, 2014 at 3:46 AM

Blogger CeeJay.dk said...

I have a collection of 10 different contrast S-curves in the source code of SweetFX (look in the curves.h file) , as well as a few not-quite-working ones.

I use curve #2 the most - it's my current favorite.

You can find SweetFX at http://forums.guru3d.com/showthread.php?t=381912

May 19, 2014 at 6:53 AM

Blogger CeeJay.dk said...

There is also Dino Dinis Normalized Tunable Sigmoid Function : http://dinodini.wordpress.com/2010/04/05/normalized-tunable-sigmoid-functions/

And the followup 2.0 formula : https://www.youtube.com/watch?v=R5IZyQpYvZA

May 21, 2014 at 3:25 PM

Blogger DEADC0DE said...

Dini's formuals are the same as Shlick's Gain

May 29, 2014 at 6:16 PM

Anonymous Anonymous said...

Schlick's versions were published in Graphics Gems 4, not 2.

August 15, 2015 at 4:14 PM

Blogger DEADC0DE said...

Thanks for spotting the mistake

August 16, 2015 at 12:27 PM

You can use some HTML tags, such as <b>, <i>, <a>

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.
Please prove you're not a robot