Logo by AGUS - 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: Did you know ? you can use LaTex inside Postings on fractalforums.com!
 
*
Welcome, Guest. Please login or register. October 21, 2020, 06:59:03 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: Inside out MandalayBox  (Read 616 times)
Description: Modified MandalayBox
0 Members and 1 Guest are viewing this topic.
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« on: May 31, 2015, 09:19:33 PM »

Modified MandalayBox.frag, looking for colors found another dimension of complexity smiley

Code:
// coordinate to invert to infinity
uniform vec3 InvertC; slider[(-5,-5,-5),(0,0,0),(5,5,5)]

// Roqen's domain mashup performs the active c = T(s)
vec3 domainMap(vec3 c)
{
  float s = dot(c,c);
  return c/s * InvertC;
}

float DE(vec3 p) {
     // first line
     p = InvertC ? domainMap(-p) : p;

     // the rest of the DE() function
}
<a href="http://vimeo.com/moogaloop.swf?clip_id=129356171" target="_blank">http://vimeo.com/moogaloop.swf?clip_id=129356171</a>
and this is zoomed into the round part of the surface at the first pause in morphing, that's where it's inside out I think wink

http://www.fractalforums.com/index.php?action=gallery;sa=view;id=17854 for the full 3840x2160 version
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
visual.bermarte
Fractal Fertilizer
*****
Posts: 355



« Reply #1 on: June 01, 2015, 02:56:41 AM »

Nice, shouldn't be
Code:
uniform bool Invert; checkbox[false]
and then
Code:
p=(Invert ? domainMap(-p) : p);
Logged
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #2 on: June 01, 2015, 06:52:49 AM »

yes, that works, as does...
Code:
p=(InvertC != vec3(0,0,0)) ? domainMap(-p) : p);
but they seem to look/act a little differently, as it is, it gets cast to bvec3
not being a mathmatician myself, I couldn't tell you if it should or shouldn't be something else, there are probably better ways, but it gets a look that I like and plan to explore smiley
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
visual.bermarte
Fractal Fertilizer
*****
Posts: 355



« Reply #3 on: June 01, 2015, 02:21:37 PM »

Macs are more picky hurt
with
Code:
p = InvertC ? domainMap(-p) : p;
I get
Code:
Error: Condition must be of type bool
« Last Edit: June 01, 2015, 03:15:44 PM by visual.bermarte » Logged
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #4 on: June 01, 2015, 03:26:39 PM »

hmmm... I get...
Code:
Fragment shader compiled with warnings: Fragment info
-------------
0(1166) : warning C7509: OpenGL requires the selection first expression to be a scalar boolean
0(1166) : warning C7011: implicit cast from "vec3" to "bvec3"

Compiled script in 85 ms.
just warning, no error, so it's a 3 way bool opperation that acts a bit different than a single bool switch?
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #5 on: June 01, 2015, 05:07:44 PM »

I was also quite puzzled about this. The standard says that: "The ternary selection operator (?smiley. It operates on three expressions (exp1 ? exp2 : exp3). This
operator evaluates the first expression, which must result in a scalar Boolean. ", so I don't think there is a 3-way ternary operator.

Your image looks great. Would you mind posting the entire DE?
Logged
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #6 on: June 02, 2015, 04:47:57 AM »

I'm not sure exactly how it gets handled internally by the compiler (although I should have a look at the asm dump) but...
using a single bool flag for deciding to do the operation or not,
using vec3(0,0,0) or
using cast to bvec3 (implemented by compiler with warning)

the first 2 produce the same result undecided while bvec3 does not seem to have  this effect

the settings are identical for the pics except for the (single) bool being switched, I think that when using bVec3 transitioning through 0 it either never exactly hits 0 or when @0 it switches out the distortion from the domainMap() function, but when using a bool flag it's on through 0... does that make sense?
my understanding is that when casting to bool from float in GLSL 0 == false and anything else, + or -,  == true

I believe you are correct re:3-way ternary operator  embarrass

The DE is MandelayBox.frag as provided by knighty using the mod described above (attached), no other changes
using support files 3DKn-1.0.1.frag  BufferShader-1.0.1.frag  DE-Kn2.frag  MathUtils.frag


* singleflagOn.jpg (19.82 KB, 405x236 - viewed 184 times.)

* singleflagOff.jpg (45.45 KB, 405x236 - viewed 206 times.)
* InsideOutDetail.frag (4.78 KB - downloaded 97 times.)
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #7 on: June 02, 2015, 05:59:58 AM »

my assumptions about GLSL booleans...

A == B ? C = A : C = B

using vec3 would go something like this...

A.x == B.x ? C.x = A.x : C.x = B.x
A.y == B.y ? C.y = A.y : C.y = B.y
A.z == B.z ? C.z = A.z : C.z = B.z

which is a very easy thing for GPU to do

the error is only generated when InvertC (float vec3) is tested by itself against true/false (bool single), when tested against another vec3 there is no error reported, hence my assumption

edit: I think that the compiler should cast the single bool to match the type required before the test without complaining because vec3(0) is valid
« Last Edit: June 02, 2015, 07:49:10 AM by 3dickulus, Reason: thoughts » Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Getting a look inside... Mandelbulb 3d The Rev 6 1733 Last post November 01, 2010, 12:08:27 AM
by The Rev
Inside-Out Mandelbulb3D Gallery dainbramage 0 381 Last post January 30, 2011, 06:04:57 PM
by dainbramage
On the Inside Mandelbulb3D Gallery dainbramage 0 383 Last post February 16, 2011, 03:38:32 AM
by dainbramage
Inside Out II Images Showcase (Rate My Fractal) Ross Hilbert 0 454 Last post April 08, 2011, 06:03:09 PM
by Ross Hilbert
From the Inside Mandelbulb3D Gallery lenord 0 340 Last post September 28, 2011, 05:45:36 AM
by lenord

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.116 seconds with 28 queries. (Pretty URLs adds 0.008s, 2q)