Logo by mclarekin - 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: Check out the originating "3d Mandelbulb" thread here
 
*
Welcome, Guest. Please login or register. April 20, 2024, 03:26:54 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]   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: Ray marcher mandel box tutorial?  (Read 6090 times)
0 Members and 1 Guest are viewing this topic.
flexiverse
Safarist
******
Posts: 99



« on: March 11, 2015, 04:41:31 AM »

Does anyone have a tutorial for n00bs to ray march a mandelbox with source code?


My level is I can wrote a Mandelbrot in 2d in c.

I see a lot on shadertoy, but would love a tutorial......

 embarrass
« Last Edit: March 15, 2015, 12:59:23 AM by flexiverse » Logged
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #1 on: March 11, 2015, 07:41:49 AM »

See sticky threads here:
http://www.fractalforums.com/3d-fractal-generation/
Good luck
Logged

No sweat, guardian of wisdom!
flexiverse
Safarist
******
Posts: 99



« Reply #2 on: March 14, 2015, 05:53:46 AM »


The best thing I've found so far that actually explained it me that made some sense was :


https://translate.google.co.uk/translate?sl=auto&tl=en&u=https%3A//demosceneacademy.wordpress.com

It's not in english. It makes more sense as it's actually sphere tracing.
Logged
laser blaster
Iterator
*
Posts: 178


« Reply #3 on: March 14, 2015, 08:06:24 PM »

Syntopia, the maker of Fragmentarium, did a series of blog posts on raymarching 3D fractals using distance estimation. You may find it helpful. Here's the first one:
http://blog.hvidtfeldts.net/index.php/2011/06/distance-estimated-3d-fractals-part-i/
Each post contains a link to the next one at the bottom of the page.
You can also take a peek at the DE-Raytracer and Mandelbox scripts that come with Fragmentarium.

If you have any questions, we'll be happy to answer them. For example, if you want to know how to find the ray direction for a pixel, or how to derive the Distance Estimation formula for the Mandelbox.
Logged
flexiverse
Safarist
******
Posts: 99



« Reply #4 on: March 15, 2015, 12:58:48 AM »

Syntopia, the maker of Fragmentarium, did a series of blog posts on raymarching 3D fractals using distance estimation. You may find it helpful. Here's the first one:
http://blog.hvidtfeldts.net/index.php/2011/06/distance-estimated-3d-fractals-part-i/
Each post contains a link to the next one at the bottom of the page.
You can also take a peek at the DE-Raytracer and Mandelbox scripts that come with Fragmentarium.

If you have any questions, we'll be happy to answer them. For example, if you want to know how to find the ray direction for a pixel, or how to derive the Distance Estimation formula for the Mandelbox.


I've been reading that article for quite a while now. The problem is that syntopia  is kinda assuming people reading have the same level of mathematical knowledge and programming experience as him.
There is really for nothing complete beginner noobs.

I mean in contrast you can find many articles that step by step explain how a draw a Mandelbrot while all explaining all the mathematical principles along the way with highly commented code written to learn from and not optimised to hell.

People like syntopia are on a completely different level, they are more interested in extreme optimisation and really talking about problems they are solving for highly optimised super efficient code.

Seriously their explanations are virtually impossible to understand without doing tonnes of background research. I just gave up when I first read that, it didn't help me to understand how to draw a mandelbox.

Reading an expert ponder how they are optimising the mathematics or code for their program is fascinating
But totally and utterly useless for the beginner. Honestly the commercial optimised code in programs like fragmentarium is useless for the beginner to learn from, I've tried.
---

Luckily we have shadertoy now and can instantly run glsl code and get immediate results in a browser!

The problem here is the code is by super "demo coding" experts with deep knowledge and it's virtually impossible to reverse engineer the code in amazing demos in shader Toy.

But if someone actually programmed a mandel box shader step by step teaching all the maths along the way this is clearly the most perfect environment we've had - as we can get instant results from c like code in shader Toy.  ( I know its actually  read shader code that gets compiled into the graphic card)

Just need someone to actually comment and explain each function and the maths behind it.

I found a good starting point this is the only post below I can find on the *entire internet* that tries to explains a raymarcher with commented shadertoy glsl code.

I mean if you can help extend and explain this further this would be great.

Then you can explain a highly readable totally unoptimised distance estimator for a mandelbox, designed to learn from.  Not theory actual shader toy real code, line by line.

Which can then plugged into previously explained code the ray-marcher code as a distance estimator.

I don't think there are many people interested in education and teaching though.

This is the only thing I've found that almost makes me understand sphere tracing shader.

Here have a look:

http://www.reddit.com/r/twotriangles/comments/1hy5qy/tutorial_1_writing_a_simple_distance_field/

It would be great to get a working fully commented explained version of this on shader toy that explains more.


As it's important to get real working code to learn and play with.


Although unfortunately the link for this code is broken!

It is frustrating that no line by line code with explanations and teaching exists for noobs.
Now I fully understand why, Not many people enjoy teaching.
Plus this forum is clearly experts with tonnes and years and years if knowledge.

They aren't gonna waste time writing noob code for beginners.

It's almost like if you weren't into this from the beginning for many years you aren't gonna learn anything quick.

« Last Edit: March 15, 2015, 01:09:08 AM by flexiverse » Logged
laser blaster
Iterator
*
Posts: 178


« Reply #5 on: March 15, 2015, 04:01:39 AM »

You're right- there aren't a lot of good resources for a complete newbie looking to understand everything. After a long time researching and digging through other peoples' code, I finally have a good grasp on the whole process, and I've even made my own experimental ray-tracing program. I can make a tutorial for you. Do you know how to do raytracing basics, such as setting up a camera, and calculating the ray direction for each pixel? I can start there if you need me to. Otherwise I'll just start with raymarching and the distance estimation formula. I take it you're not interested in me just giving you formulas- you also want to know how to derive those formulas mathematically? Turns out, you can derive a distance estimation formula for the Mandelbulb and Mandelbox without resorting to any arcane mathematics- heck, you barely even need to know any calculus.
Logged
flexiverse
Safarist
******
Posts: 99



« Reply #6 on: March 15, 2015, 10:42:26 PM »

You're right- there aren't a lot of good resources for a complete newbie looking to understand everything. After a long time researching and digging through other peoples' code, I finally have a good grasp on the whole process, and I've even made my own experimental ray-tracing program. I can make a tutorial for you. Do you know how to do raytracing basics, such as setting up a camera, and calculating the ray direction for each pixel? I can start there if you need me to. Otherwise I'll just start with raymarching and the distance estimation formula. I take it you're not interested in me just giving you formulas- you also want to know how to derive those formulas mathematically? Turns out, you can derive a distance estimation formula for the Mandelbulb and Mandelbox without resorting to any arcane mathematics- heck, you barely even need to know any calculus.

Well it would be fantastic if you started at the beginning - although I understand basic raytracing ( like ray to sphere intersection ).

It would be good to start from basic raytracing because ray marching is in effect an optimised ray tracing method working with distance estimation rather than intersection.
So starting with basic ray tracing is actually a very very good thing.

Hence the key is understating the real theory behind the formulas rather than just giving formulas most definitely.

I mean I would love to know how to derive the formula without getting into arcane calculus - that sounds exciting!!!

Honestly, this would be a really popular article if you put this on your blog or something!!
So many thanks for helping us newbies....!

 cheesy
Logged
asimes
Fractal Lover
**
Posts: 212



asimes
WWW
« Reply #7 on: March 16, 2015, 12:21:07 AM »

I made a sphere tracer that could do simple Euclidean objects and some fractals (including the Mandelbox) a few months ago. It was for a graduation project so I had to write a short paper explaining what was going on, maybe the paper would be useful to you. It was intended to be read by people who were familiar with common computer graphics techniques but it was mostly made by learning from this forum and Syntopia / Iñigo Quilez articles

Link to PDF (ignore the first 3 pages): http://alexsimes.com/sphere-tracing-distance-fields-and-fractals.pdf
« Last Edit: March 16, 2015, 12:22:53 AM by asimes » Logged
dom767
Explorer
****
Posts: 40


dom767
WWW
« Reply #8 on: March 16, 2015, 01:48:03 PM »

Hi there,

Just noticed your request for help. I have a site that tends to the complex side of things (www.woo4.me) but also has the occasional introductory article.

This one talks about a basic DE function
http://woo4.me/wooscripter/distance-estimation-functions/

Once you've got that working you can copy the DE functions from syntopia to get your mandelbox working. Or you can borrow my source code which is all on github (wootracer for the C++ DE functions, wooscripter for the GUI).

Hope that helps, and interested to know if there are further tutorials you'd find helpful!
Logged
flexiverse
Safarist
******
Posts: 99



« Reply #9 on: March 16, 2015, 10:48:16 PM »

Just to give you a baseline what a tutorial actually is  ( sounds silly I know...! )

But have a look at this : http://www.scratchapixel.com/old/

Which builds a ray tracer step by step with source code teaching all necessary principles along the way, this was written by computer graphics experts.

Why?  Because a key skill to be truly successful is being able to teach others.
It's a magic law of success, in all the success books.   If you are able to teach others a skill you have, the universe rewards you with greater success.

this is in famous books like the 7 habits of successful people.


Here is a video by Tai Lopez:
<a href="http://www.youtube.com/v/hEXNgQ7Oynk&rel=1&fs=1&hd=1" target="_blank">http://www.youtube.com/v/hEXNgQ7Oynk&rel=1&fs=1&hd=1</a>

A relevant example is Iñigo Quilez  and the effort he's put into his articles and good karma recieved in return.
« Last Edit: March 17, 2015, 02:18:35 AM by flexiverse » Logged
dom767
Explorer
****
Posts: 40


dom767
WWW
« Reply #10 on: March 17, 2015, 11:25:34 AM »

I like Inigo's article's too, but I wouldn't say they're the simplest in the world to follow! I think the top tip I can give you is to build up to things gradually. If you don't have a decent knowledge of 3d vectors, then trying to write a mandelbox renderer is going to mess with your mind. There are just too many principles you need to understand before you can do this properly.

I could write you a tutorial from scratch, but it'd be 30000 words long and I need to pay the bills!!

Best bet, start with a sphere raytracer, then extend it to a raymarcher, then extend it to DE. Once you have sphere DEs working, mess about with some if Inigo's other DE primitives, and then go for the fractals. Start with the kaleidoscopic IFS because the formula is simple and hard to implement incorrectly. Then go for mandelbox.
Logged
youhn
Fractal Molossus
**
Posts: 696


Shapes only exists in our heads.


« Reply #11 on: March 17, 2015, 04:05:11 PM »

Just my input on what is what

how-to = just some simple steps
tutorial = how-to + more specific examples on details on steps to take, and examples of results
lesson = tutorial + explanation of the theory of the subject
course = bunch of lessons
study = bunch of courses with similar topics

An overview of the structure for a fractal (art, software, math) study would actually be nice. Say, a virtual non-existing study. What courses would be given there? What subjects are following-up eachother? I can image redoing the first courses throughout the whole study. Bit of chaos. Well, nevermind.
Logged
flexiverse
Safarist
******
Posts: 99



« Reply #12 on: March 17, 2015, 06:53:12 PM »

I like Inigo's article's too, but I wouldn't say they're the simplest in the world to follow! I think the top tip I can give you is to build up to things gradually. If you don't have a decent knowledge of 3d vectors, then trying to write a mandelbox renderer is going to mess with your mind. There are just too many principles you need to understand before you can do this properly.

I could write you a tutorial from scratch, but it'd be 30000 words long and I need to pay the bills!!

Best bet, start with a sphere raytracer, then extend it to a raymarcher, then extend it to DE. Once you have sphere DEs working, mess about with some if Inigo's other DE primitives, and then go for the fractals. Start with the kaleidoscopic IFS because the formula is simple and hard to implement incorrectly. Then go for mandelbox.

For sure Inigos articles are not for beginners. My point was he's put the effort to at least try and explain and put out articles.   
That is a law of success, good karma comes  back to him thus resulting in getting more work and getting paid more.
So you really need to start writing that 30,000 word article, it will help you down the road pay bills.

All you need is to spent 20mins a day and no more doing it.  By doing this by the end of the year you'll have a complete novel.
This is a very important principle to learn.
Here this article explains then 20 min day secret to getting a lot done simply in the age of distraction

http://www.locusmag.com/Features/2009/01/cory-doctorow-writing-in-age-of.html
Logged
dom767
Explorer
****
Posts: 40


dom767
WWW
« Reply #13 on: March 17, 2015, 06:59:49 PM »

Err... I do that already.

www.woo4.me

But this is strictly a hobby for me. I used to do computer games special effects and that's a mugs game! smiley
Logged
flexiverse
Safarist
******
Posts: 99



« Reply #14 on: March 18, 2015, 02:07:10 AM »

Err... I do that already.

www.woo4.me

But this is strictly a hobby for me. I used to do computer games special effects and that's a mugs game! smiley

Curious ! Why is computer games special effects a mugs game? Sounds like a good blog post!
Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
How to program a mandel box ? Tutorial ! Programming flexiverse 13 5738 Last post April 13, 2013, 04:57:19 PM
by flexiverse
Tutorial #4 - Kali's Axolotl Script + Distance Based Rendering Tutorial chaosTube - Tutorials cKleinhuis 6 6548 Last post November 18, 2013, 01:54:45 AM
by zonepatcher
New tutorial: Cinematic Fractal Tutorial Tutorials brasnacte 3 7414 Last post March 20, 2015, 09:23:47 PM
by flexiverse
tutorial #4 - Axolotl Script + Distance Based Rendering Tutorial chaosTube - Tutorials cKleinhuis 0 4414 Last post February 15, 2015, 02:59:23 PM
by cKleinhuis
Problems in custom ray marcher Help & Support Efoia 2 207 Last post September 17, 2016, 09:34:40 PM
by Efoia

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.179 seconds with 24 queries. (Pretty URLs adds 0.011s, 2q)