Logo by teamfresh - 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. August 08, 2020, 02:49:48 PM


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 [2] 3 4 ... 8   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: Rendering 3D fractals without distance estimators  (Read 14673 times)
0 Members and 1 Guest are viewing this topic.
hobold
Fractal Bachius
*
Posts: 573


« Reply #15 on: October 01, 2012, 12:11:51 PM »

There is fairly little noise even on the smooth parts of Kali's posted image. I think that last bit could be cured with the usual bisection method.

That is, during the random iterations, we already keep track of the closest point on the ray that is beyond the surface; additionally one would keep track of the farthest point that is just in front of the surface. After the limit of random samples has been reached, we end up with a small interval where we "know" the surface must be.

That interval's length can recursively be halved by evaluating its midpoint, and then adaptively moving the near or the far border.
Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #16 on: October 01, 2012, 08:33:11 PM »

wrt random number generators:

The problem is not to find something that generates a nice sequence - you could use linear congruential generators or something similar for that.

The problem is that you cannot easily store the state (the previous output) between frames (which is needed for progressive rendering) - there is not room for that in the four components per pixel that are passed between frames. It might be possible to render to multiple targets, or to an FBO attachment, but it would complicate the rendering code.

So I need something which returns an unique number as of function of position and framecount. This is why I call my random function with something like: rand(viewCoord*float(backbufferCounter*i)). As you can guess this creates a lot of visual correlation. It would be possible to create a precalculated texture with high quality random numbers, but I still need a nice way of looking them up, based on position and frame count.

wrt bisection

Yes, It could be used as a post-processing pass to improve quality, but then you have to put a limit on the number of random samples. There is also a practical problem, since there is not room for storing the farthest outside point (as of now I use xyz for color, and w for closest inside point). This could be circumvented, though.

But I would rather pursue the idea of looking at adjacent pixel, since this means you might reuse some of calculations, and accelerate the rendering.


 

Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #17 on: October 01, 2012, 10:06:55 PM »

I tried sampling the neighbors at the start of each frame - this did speed up the rendering and removed at lot of noise:


(Low iteration Mandelbulb for smooth surface)

The image is rendered using 6 frames with 20 samples each: the lower has SampleNeighbors enabled the upper hasn't.
The updated code is in the repository.
Logged
Kali
Fractal Supremo
*****
Posts: 1138


« Reply #18 on: October 02, 2012, 12:27:57 AM »

Excelent, works even faster now.

Btw, I tried to implement some coloring using the orbitTrap variable and it worked, but there is a flickering noise when in realtime, and then the render is also more noisy compared with the monochrome version:



Logged

hobold
Fractal Bachius
*
Posts: 573


« Reply #19 on: October 02, 2012, 02:39:42 PM »

I found an interesting paper on an unusual type of pseudo random number generator that might be interesting in this context:

http://www.thesalmons.org/john/random123/papers/random123sc11.pdf

The generators are stateless, conforming to an interface like

result = PRNG(seed, N)

yielding sequences of pseudo random numbers as N is incremented. Statistical qualities and speed are said to be competitive with ordinary stateful generators.

Then again, this is probably overkill ... smiley
Logged
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #20 on: October 03, 2012, 03:33:07 AM »

Personally I still like the Mersenne Twister wink
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #21 on: October 03, 2012, 04:09:16 PM »

Testing this rendering method would be more stressful if done using Mandlboxes or similar rather than Mandelbulbs or similar as its worst-case performance will be dust-like fractals rather than connected ones.
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #22 on: October 03, 2012, 08:36:09 PM »

Btw, I tried to implement some coloring using the orbitTrap variable and it worked, but there is a flickering noise when in realtime, and then the render is also more noisy compared with the monochrome version:

Yes, I didn't implement the orbitTrap thing - I'll reimplement it, but consider using the 'providesColor' approach:
Code:
#define  providesColor
#include "Brute-Raytracer.frag"

vec3 color(vec3 point, vec3 normal) {
  ....
}
This will be faster anyway, since you don't need to evaluate color at each sample.

I found an interesting paper on an unusual type of pseudo random number generator that might be interesting in this context:
http://www.thesalmons.org/john/random123/papers/random123sc11.pdf

It is something like this I was looking for - I looked at their code: http://www.deshawresearch.com/resources_random123.html, but it looks very difficult to port to GLSL.

Btw, I noticed it is a D. E. Shaw paper - I have been following his works for some time. He is an interesting person - he became a multi-billionaire by running a Wall Street investment company, then returned to science, assembled a team of very skilled scientists, and is now building his own supercomputer and software for running molecular dynamics simulations.

Personally I still like the Mersenne Twister wink
But it really needs a lot of state data :-)

Testing this rendering method would be more stressful if done using Mandlboxes or similar rather than Mandelbulbs or similar as its worst-case performance will be dust-like fractals rather than connected ones.

The Mandelbox renders just fine, but I also thought about this - you are sampling volume, so something like a sphere shell (which it is trivial for a DE) wouldn't render at all. 
Logged
Kali
Fractal Supremo
*****
Posts: 1138


« Reply #23 on: October 03, 2012, 09:12:58 PM »

Yes, I didn't implement the orbitTrap thing - I'll reimplement it, but consider using the 'providesColor' approach:
Code:
#define  providesColor
#include "Brute-Raytracer.frag"

vec3 color(vec3 point, vec3 normal) {
  ....
}


Tried, but I got this error:

Code:
Could not create fragment shader: Fragment shader failed to compile with the following errors:
ERROR: 1:315: error(#143) Undeclared identifier hit
ERROR: 1:315: error(#143) Undeclared identifier hitNormal
ERROR: 1:315: error(#202) No matching overloaded function found color
ERROR: 1:315: error(#202) No matching overloaded function found mix
WARNING: 1:315: warning(#402) Implicit truncation of vector from size 1 to size 3.
ERROR: error(#273) 4 compilation errors.  No code generated

The problem seems to be that you call the color function with the hit & hitNormal variables but they are not defined.


EDIT: I fixed it by calling the color function with the result of the "point" variable used in the calculations.
« Last Edit: October 03, 2012, 09:58:07 PM by Kali » Logged

cbuchner1
Fractal Phenom
******
Posts: 443


« Reply #24 on: October 03, 2012, 10:21:26 PM »

Btw, I tried to implement some coloring using the orbitTrap variable and it worked, but there is a flickering noise when in realtime, and then the render is also more noisy compared with the monochrome version:

Oh, this is cool. I shall try to grab your code and put my "plancton" formula in there. Essentially a modification of the triplex multiplication that somehow tilts the rotation axis. Unfortunately the links to the software on the CUDA forums are down (they had a security breach). If I remember correctly, my CUDA accelerated implementation used quaternions.

Here's a link to the fractalforums thread where I show some of the plancton-like bulbs...
http://www.fractalforums.com/mandelbulb-renderings/a-new-class-of-bulb/
« Last Edit: October 03, 2012, 10:49:02 PM by cbuchner1 » Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #25 on: October 03, 2012, 11:03:01 PM »

EDIT: I fixed it by calling the color function with the result of the "point" variable used in the calculations.

Exactly - the normal is not even calculated in that shader anymore. Perhaps I should try running my own code sometimes, instead of assuming it works :-)

I checked in a bug fix.
Logged
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #26 on: October 04, 2012, 11:43:34 PM »


The Mandelbox renders just fine, but I also thought about this - you are sampling volume, so something like a sphere shell (which it is trivial for a DE) wouldn't render at all. 

Correct - of course a swiss-cheese in this case gives the same issues as a dust wink

To be honest I think the method outlined in this thread but also partially directed using say iteration count (and possibly iteration density) is likely to be most optimum - plus it could overcome the missed thins problem.
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
tomaya
Alien
***
Posts: 22



« Reply #27 on: October 21, 2012, 10:33:08 AM »

Ok, I just tested the raytracer with my "rotjulia" formula, and I'm very excited with the result:

<Quoted Image Removed>







   Hi Kali
I'm completely new here and in the fractal world , This picture is really amazing , i wonder if it could be possible
to get the same result with mandelbulb 3d ...and if you would share this formula (or not  grin)...

20 years of 3d vfx but it's the first time i try the fractal tools . You can call me "junior"  cheesy

Tom

Logged

Thomas Marqué .  Vfx Lead .Digital District , Paris.
cbuchner1
Fractal Phenom
******
Posts: 443


« Reply #28 on: October 22, 2012, 06:23:12 PM »

Got the latest Fragmentarium source code via GIT, compiled the Qt libraries in 64bit, created a Visual Studio 2010 solution that also builds Fragmentarium in 64bit and behold - it runs!

When I select Examples/Tutorials/26 - 3D Fractal without DE.frag I get the following yellow log messages (warnings?)

Could not find: AlternateVersion
Could not find: AntiAliasScale
Could not find: ColorIterations
Could not find: GaussianWeight

Is this something to worry about?
« Last Edit: October 22, 2012, 06:24:50 PM by cbuchner1 » Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #29 on: October 22, 2012, 09:05:36 PM »

Got the latest Fragmentarium source code via GIT, compiled the Qt libraries in 64bit, created a Visual Studio 2010 solution that also builds Fragmentarium in 64bit and behold - it runs!

When I select Examples/Tutorials/26 - 3D Fractal without DE.frag I get the following yellow log messages (warnings?)

Could not find: AlternateVersion
Could not find: AntiAliasScale
Could not find: ColorIterations
Could not find: GaussianWeight

Is this something to worry about?


No - these warnings occur when the a preset value tries to change a uniform which is no longer available - for instance if some raytracer params have been renamed, or if you change the raytracer to another with different params. There are loads of these warnigns, and I guess at some point I should try to clean them up :-)
Logged
Pages: 1 [2] 3 4 ... 8   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Distance Estimators Comparison 3D Fractal Generation David Makin 0 1783 Last post October 24, 2009, 10:02:58 PM
by David Makin
Dual numbers for creating distance estimators (new) Theories & Research Syntopia 2 1151 Last post December 14, 2011, 08:19:02 PM
by eiffie
Mandelbrot Set Distance Estimator Rendering Problem UltraFractal aleph0 5 1617 Last post April 30, 2014, 01:08:45 AM
by aleph0
Wooscripter noisy distance estimators 3D Fractal Generation dom767 5 1475 Last post February 14, 2015, 03:47:34 PM
by dom767
Error estimation of distance estimators (Mandelbulb improvement found!) (new) Theories & Research mermelada 6 545 Last post July 28, 2017, 09:52:19 AM
by mclarekin

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.172 seconds with 27 queries. (Pretty URLs adds 0.015s, 2q)