Logo by Khaotik - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Follow us on Twitter
 
*
Welcome, Guest. Please login or register. January 14, 2026, 12:05:38 AM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Distance field blending  (Read 2014 times)
0 Members and 1 Guest are viewing this topic.
Kali
Fractal Supremo
*****
Posts: 1138


« on: November 15, 2012, 07:09:15 PM »

I want to achieve a blending effect between two distance-estimated objects.
I tried to do it my own way but no good results... Quilez describes a way to do it here: http://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm
But he uses "smoothcurve()" function? What is it? at first I thought it was a GLSL function but is not, and I couldn't find any clear references about what this function means and what it does... huh?

Any clues?

« Last Edit: November 15, 2012, 07:32:47 PM by Kali » Logged

eiffie
Guest
« Reply #1 on: November 15, 2012, 07:25:09 PM »

I remembered another thread on this...
http://www.fractalforums.com/programming/overlapping-spheres/

THIS ANSWER CAME FROM SUBBLUE SO IT CARRIES SOME WEIGHT smiley
I'm guessing smoothcurve is like the smoothstep function in OpenGL, which (from the spec):

Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 < x < edge1.  This is useful in cases where you would want a threshold function with a smooth transition.
This is equivalent to:
   t = clamp ((x – edge0) / (edge1 – edge0), 0, 1);
   return t * t * (3 – 2 * t);

...or it may be like the exponential step function he shows here:
http://iquilezles.org/www/articles/functions/functions.htm
« Last Edit: November 15, 2012, 07:35:28 PM by eiffie » Logged
Kali
Fractal Supremo
*****
Posts: 1138


« Reply #2 on: November 15, 2012, 08:17:56 PM »

Thanks eiffie! The weird thing is that before opening this thread, I did a search here at the forums for the word "smoothcurve" and no results, I did it again now and I found the post you pointed at huh?
Logged

Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Depth of Field Mandelbulb 3d mehrdadart 1 4325 Last post February 09, 2011, 11:22:45 PM
by Jesse
Field of balls Mandelbulb3D Gallery miguelnpg 0 1232 Last post May 15, 2011, 07:38:12 AM
by miguelnpg
Quanta field Mandelbulb3D Gallery bib 0 1342 Last post July 12, 2011, 10:38:00 PM
by bib
What is a distance field ? Programming Chanur 6 5513 Last post August 21, 2012, 10:54:12 AM
by Syntopia
Is there a way to maintain a real distance field when modifying this fragment? Programming tryptophan 9 2182 Last post April 04, 2013, 11:14:50 PM
by Syntopia

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.267 seconds with 26 queries. (Pretty URLs adds 0.008s, 2q)