Title: A question about scales Post by: lapinot on May 13, 2015, 04:28:17 PM Hi all.
I have 2 separate questions regarding 'scale' and what it means. 1) The scale factor : I have heard people talk about 'scale' as of 'a scale xyz power w mandelbulb' etc... I don't know what it is and how to implement it. For example, here is my mandelbulb glsl code : Code: float DE (vec3 pos) {This code works as it should. How would I 'insert' a scale variable into the formula ? 2) General size of a fractal : the code above gives me a bulb roughly contained in a radius 2 sphere (I guess). How would I have it contained in a radius 2'000'000 sphere (for example) ??? The idea is : glsl float precision is so bad that I can barely go under the 10-6 barrier. with a 106 scaled bulb, I would have twice as much precision to play with. Maybe a similar question has been asked already I dunno :embarrass: thx for any insight O0 Title: Re: A question about scales Post by: eiffie on May 13, 2015, 05:41:24 PM Divide pos and dr by scale before they are used elsewhere and you are done.
Title: Re: A question about scales Post by: lapinot on May 13, 2015, 05:44:48 PM Divide pos and dr by scale before they are used elsewhere and you are done. Okay thx ;D What about part #2 ? Is it possible to embed the fractal in a larger sphere ? Title: Re: A question about scales Post by: cKleinhuis on May 13, 2015, 06:18:22 PM 2) General size of a fractal : the code above gives me a bulb roughly contained in a radius 2 sphere (I guess). How would I have it contained in a radius 2'000'000 sphere (for example) ??? The idea is : glsl float precision is so bad that I can barely go under the 10-6 barrier. with a 106 scaled bulb, I would have twice as much precision to play with. Maybe a similar question has been asked already I dunno :embarrass: thx for any insight O0 just scale everything as you wish, but dont confuse number precision with scale, scaling up does not give any bit of precision extra, shifting the decimal point to the left for a fixed amount will not give you precision gain, precision problems occur when the needed diference of 2 numbers can not be expressed by the floating point, no matter if too big or too small ... Title: Re: A question about scales Post by: lapinot on May 13, 2015, 07:07:04 PM I know I wont technically get 'more precision'. What I meant is : by starting with a fractal with radius i.e. 2'000'000 instead of 2, I can 'zoom in' twice as much.
Because glsl float precision is rougly 106 - 10-6. So I would definitely get twice the available zooming by 'starting big'. By the way I posted a pic in the B&W art contest session of this year that illustrate just that. At max zooming level my scene looks like it's composed of voxels. So as you said the dimensions become too small for GLSL to see any difference in values, because of float limitations hence the voxelized look. Title: Re: A question about scales Post by: eiffie on May 14, 2015, 08:39:36 PM Christian is right but you probably have to try it before it sinks in what is going on.
Set the scale to 10^6 so the functions looks like... float DE(vec3 pos){ pos=pos/scale; dr=1.0/scale; ...continue with the normal function without any reference to scale. Make sure you back the camera up a bit :) like 2*10^6. Now zoom in by halving the distance to the surface each frame (it will become pixelated again in as few frames as before!) But we would love to be proved wrong, who doesn't want double the space. Title: Re: A question about scales Post by: mclarekin on May 15, 2015, 09:59:19 PM @ eiffie Quote ......, who doesn't want double the space. Me, I don't want double the space, i'm lost enough as it is! ;D. In this already infinite fractal universe |