Logo by Pauldelbrot - 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: Support us via Flattr FLATTR Link
 
*
Welcome, Guest. Please login or register. March 28, 2024, 11:04:01 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 2 [3] 4   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: Fractal Gun: paintbrush/spraypaint style modification of fractals  (Read 5962 times)
0 Members and 1 Guest are viewing this topic.
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #30 on: January 10, 2016, 02:16:50 AM »

UPDATE:  Had to fix something in the raytracer which was responsible for the IntWidget problems.  embarrass embarrass embarrass


   Attached are a couple <beta!!!> frags to use with the above source.  To figure them out (betas don't come with instructions, although I'll give you pointers if you ask!), look at the loops inside the DE calculation (this is in the Menger):

It's fun to play with after you get the gist of it.  cheesy


  

Code:
while (fi<=feedbackstop) {  
if (feedbackcontrol1[fi].x==m) {   //do we apply this iteration???
zappaz=length (pos-feedback[fi].xyz);  
if (zappaz<feedbackcontrol2[fi].x) {    // check to see if it is within feedback radius

// if it's in the effect's radius, we do a simple drop off in intensity from the center of the effect (maximum effect)
// to the edge (0 effect) :     zappaz = (FeedbackRadius-zappaz) * FeedbackStrength;
zappaz= (feedbackcontrol2[fi].x-zappaz)*feedbackcontrol2[fi].y;

if (feedbackcontrol1[fi].y==1.) {     //FBFormulaType = 1
if (feedbackcontrol1[fi].z==1.) {   // FBApplicationType = 1
z2=vec3(zappaz,0.,0.);  // we just add in a vector of zappaz length
//                                                   ////  z2 rotated around FBRotVector by FBRotAngle (we started out on x axis, so..)
z2*=rotationMatrix3(normalize(feedbackrotation[fi].xyz),feedbackrotation[fi].w);
z+=z2;   // setting direction with our rotation vectors and angle
} else if (feedbackcontrol1[fi].z==2.) {   // FBApplicationType = 2
z2=vec3(zappaz,zappaz,zappaz)*sr13;  // we just add in a vector of zappaz length
//                                                   ////  z2 rotated around FBRotVector by FBRotAngle (we started out on x axis, so..)
z2*=rotationMatrix3(normalize(feedbackrotation[fi].xyz),feedbackrotation[fi].w);
z+=z2;   // setting direction with our rotation vectors and angle
} else if (feedbackcontrol1[fi].z==3.) {
z+=feedback[fi].xyz*zappaz;
} else if (feedbackcontrol1[fi].z==4.) {
zappaz=length(feedback[fi].xyz)*zappaz;
z2=vec3(zappaz,0.,0.);
z2*=rotationMatrix3(normalize(feedbackrotation[fi].xyz),feedbackrotation[fi].w);
z+=z2;
}
} else if (feedbackcontrol1[fi].y==2.) {   //formula =2
z2= (pos-feedback[fi].xyz)*zappaz;
z2*=rotationMatrix3(normalize(feedbackrotation[fi].xyz),feedbackrotation[fi].w);

if (feedbackcontrol1[fi].z==1.) {   //app type = 1
z=z2;
} else if (feedbackcontrol1[fi].z==2.) {   //app type =2
z+=z2;
}

} else if (feedbackcontrol1[fi].y==3.) {  /form 3
if (feedbackcontrol1[fi].z==1.) {  //app 1
z*= rotationMatrix3(normalize(feedbackrotation[fi].xyz),feedbackrotation[fi].w*zappaz);
} else if (feedbackcontrol1[fi].z==2.) {
if (zappaz<0) {zappaz=-(feedbackrotation[fi].w-zappaz);} else {zappaz+=feedbackrotation[fi].w;}
z*= rotationMatrix3(normalize(feedbackrotation[fi].xyz),zappaz);
} else if (feedbackcontrol1[fi].z==3.) {
if (zappaz<0) {zappaz=zappaz-.1;} else {zappaz=zappaz+.1;}
z*= rotationMatrix3(normalize(feedbackrotation[fi].xyz),feedbackrotation[fi].w/zappaz);
}

} else if (feedbackcontrol1[fi].y==4.) {  

//heightmap function here
// feedcontrol1.w = texture speed
// feedcontrol2.zw=  heightmap texture offset
// feedbackcontrol1.z= texture to use instead of application type.  

MapType=HeightMapType;
textoff=vec2(feedbackcontrol2[fi].z,feedbackcontrol2[fi].w)*.1;
texturespeed=feedbackcontrol1[fi].w;
hintensity=zappaz;
ColorTex=int(feedbackcontrol1[fi].z);    
z2= z*rotationMatrix3(normalize(feedbackrotation[fi].xyz),feedbackrotation[fi].w);
z2=TextureIT(vec4(z2,length(z2)));

z+=z2*hintensity;

} else if (feedbackcontrol1[fi].y==5.) {

// this is a fun one, use the FBRotVector for the one part, FeedbackStrength effects this part:
r=zappaz * length (vec3(
z.x*feedbackrotation[fi].x,
z.y*feedbackrotation[fi].y,
z.z*feedbackrotation[fi].z
));

//  use the Feedback Variables (1, 2, and 3)  for this part.  You can stretch stuff, or whatever... fun!  

z=vec3(z.x+feedbackcontrol1[fi].w*r,
z.y+feedbackcontrol2[fi].z*r,
z.z+feedbackcontrol2[fi].w*r);

}
}  //zapparadius check
}   //feedbackcontrol iteration check
fi++;
} // end of while (fi<FeedBacks)


A working windows Binary without EXR is here (if you can't compile from source):

https://drive.google.com/open?id=0B0EcJQ49B_yOQ0JjRFFhQXBKUXM


  Keys are set like 3dickulus said.  Still a work in progress.. need to make quantized space to work in.  

* Menger_with_Feedback_beta.frag (33.46 KB - downloaded 103 times.)
* Mandelbulb.frag (10.7 KB - downloaded 244 times.)
* Fast-Raytracer-with-Textures.frag (18.18 KB - downloaded 98 times.)
« Last Edit: January 11, 2016, 07:30:55 AM by M Benesi » Logged

mclarekin
Fractal Senior
******
Posts: 1739



« Reply #31 on: January 10, 2016, 02:41:18 AM »

Simple question from a simple person

Can I compile in Ubuntu with QT , or do I need to go to Windows?
Logged
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #32 on: January 10, 2016, 03:09:56 AM »

yes, use the "mklinux.sh" script or have a look at it and follow the process

if you just want the "bare bones" version you can use the CMakeLists.txt in Fragmentarium-Source folder or follow the steps in the 3rd part of "mklinux.sh", the default configuration is w/o OpenEXR and w/o nVidia GL4
if you want the "phat" version set the options NVIDIAGL4PLUS and USE_OPEN_EXR in Fragmentarium-Source/CMakeLists.txt to "ON" this will enable EXR file format for textures and output plus a GPU assem browser that displays the shader assembler language of post processed frags

I recommend cmake-gui for generating the makefiles or an IDE like KDevelop for building  a "bare bones" version, or QtCreator and use the Fragmentarium.pro file ( these may need tweaking for your particular system )

pm me if you have any problems compiling

EDIT: oops for some reason the diff I applied to the sources on my web server didn't hook up quite right so I'm going to compile a few win exes to make sure it actually works on windows, I'll post links to them so if you already have one of the earlier Fragmentarium executable packages installed you can just grab one of these and put it in your working folder , again  embarrass my humblest appologies
« Last Edit: January 10, 2016, 04:19:33 AM by 3dickulus » 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 #33 on: January 10, 2016, 05:26:16 AM »

Ok! hopefully able to redeem myself... fixed things up, source should readily compile on Win and Lin w/o much hassle.
not making any announcements anywhere else as this will probably only be of interest to those following this thread wink

Here are the Windows executables for anyone that already has a recent version of Fragmentarium installed, the sources, in varying flavors, can be found on my website, the frags that M Benesi provided should run w/o problems but for one small caveat (sorry MB), these...
Code:
//feedbackcontrol1.x[]    
uniform float ApplyOnIteration;slider[0,0,30]
//feedbackcontrol1.y[]
uniform float FormulaType;slider[1,1,30]
//feedbackcontrol1.z[]
uniform float ApplicationType;slider[1,1,30]
...are indexes and need to be...
Code:
//feedbackcontrol1.x[]    
uniform int ApplyOnIteration;slider[0,0,30]
//feedbackcontrol1.y[]
uniform int FormulaType;slider[1,1,30]
//feedbackcontrol1.z[]
uniform int ApplicationType;slider[1,1,30]
unless they have been changed already.

wrt fragments MB is the guy with the large math brain
wrt GUI I would be more than happy to answer any questions

Bon Apetite!
« Last Edit: January 14, 2016, 07:10:49 AM by 3dickulus, Reason: link » Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #34 on: January 10, 2016, 05:51:04 AM »

lol, I have plenty of time to change them from floats to ints.  That's easy.  wink 
Logged

3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #35 on: January 10, 2016, 07:33:00 AM »

...so... int sliders, are working correctly.
« Last Edit: January 13, 2016, 04:57:33 AM by 3dickulus » Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Tim Emit
Conqueror
*******
Posts: 111



https://www.facebook.com/
WWW
« Reply #36 on: January 13, 2016, 04:22:38 PM »

arghhh you guys are too good.. wish i understood the code jibberjabber.. will try to get it to work.. really nice concept..as ever thanks for sharing all your hard work
Logged
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #37 on: January 14, 2016, 03:34:57 AM »

@Tim grab the exes from 2 posts up
CTRL+LBM
CTRL+ALT+LBM
CTRL+SHIFT+LBM
CTRL+ALT+SHIFT+LBM
make it work, you will need M. Benesi's frags too
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #38 on: January 14, 2016, 06:42:07 AM »

I need to check those frags!  Might still have ints instead of floats, so they won't even work!

  Thanks 3dickulus (for posting the int version below)!


The frags are probably quite a mess, just trying out a couple of things, didn't ever write out the code for the mini-fractals yet.  That's in the future, which could get here a bit quicker if someone else wants to help with the work.  If not.. it'll get done. 
« Last Edit: January 14, 2016, 08:01:06 AM by M Benesi » Logged

3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #39 on: January 14, 2016, 07:14:39 AM »

Hi All smiley

release of some polished code for the M. Benesi Spray Gun feature in Fragmentarium, everything seems to be working smoothly

some enhancements to the standard stuff...

Shift+Tilde resets the target to look through 0,0,0
Shift+LMB rotate around 0,0,0
Alt+Shift+LMB rotates around target

MMB centers screen @ click, that's a wheel click when DepthToAlpha is checked this puts target at surface where you MMB click, this makes setting up AutoFocus much easier

Controls for the spray gun... ( clicking and dragging on the fractal object )

CTRL+LMB increments the index, recording push
CTRL+ALT+LMB increments the index, recording pull ( ALT changes the sign of the feedback strength )
CTRL+Shift+LMB decrements the index, erasing
CTRL+Shift+ALT+LMB clears the array

you will need the latest package that suits your setup from my website

EDIT: v1.0.20 compiled with MinGW 4.9.1 and Qt 5.4.2 may not work with MinGW 4.8.2 and Qt 5.3.2 DLLs

It comes in a few different flavours,
exe only, if you already have a recent version, just drop the exe of your choice into your Fragmentarium working folder.
NODLLs, if you want the Examples/, fqscript/ and Misc/ folders + win binaries, basically the whole thing but without the Qt 5.3.2 DLLs
and the full package, has everything smiley

You will also need M. Benesi's fragments that use the new mouse feedback arrays, all other frag files should also work fine with this version too.

I am genuinely excited to see what might be created with this new tool, I've only been testing as I write the code so I'm not fully versed regarding all of the possibilities, I hope I've done my part well and that you find this easy to use. Further refinement will be in updated frag code and hopefully a tutorial from M. Benesi.

caveats: in fragment code

     DepthToAlpha must be checked or we get wrong values
     feedback[] is changed to feedbackcrds[] makes sense?
     feedbackcountmax is changed to feedbackcount as it's the current count not the maximum count

     all of these uniforms must exist in the fragment code or Fragmentarium will not recognize this as a "Feedback Enabled" fragment...

     vec3 feedbackcrds[102];
     vec4 feedbackcontrol1[102];
     vec4 feedbackcontrol2[102];
     vec4 feedbackrotation[102];

     int feedbackcount;

     int ApplyOnIteration
     int FormulaType
     int ApplicationType
     float FeedbackRadius
     float FeedbackStrength
     float FeedbackVariable1
     float FeedbackVariable2
     float FeedbackVariable3
     Vector3f FBRotVector
     float FBRotAngle
     int FeedBackCutOff

     if these are not in the fragment code it won't work or may crash

    other (normal non-feedback) fragments will work fine but when playing with feedback all are required

    you can also Save and Load (under "File" menu) the feedback data as <name>.fdbk , this is a flat text file so you can recreate or share these manipulations

  and HUGE! HUGE! thanks to M. Benesi for the crazy math lessons and awesome ideas, he did the hard stuff I just helped patch it in A Beer Cup A Beer Cup A Beer Cup
« Last Edit: February 01, 2016, 01:22:55 AM by 3dickulus, Reason: swansong » Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #40 on: January 18, 2016, 02:25:12 AM »

   Just helped patch it in.  right...  roll eyes
Logged

Tim Emit
Conqueror
*******
Posts: 111



https://www.facebook.com/
WWW
« Reply #41 on: January 18, 2016, 03:49:13 PM »

@MBenesi & @3dickulus  .. This looks great,  now all I have to do is get it all to work..thanks so much for all this great work. I might start a separate fragmentarium thread where ( if anyone would consider it) you guys can help dimwit no coder non mathheads like me and hold our hands through compiling and working with fragment code?!! what do you think???  I just hit brick walls that without better code knowlege I just keep banging my already bruised head against. smiley
Logged
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #42 on: January 18, 2016, 08:04:20 PM »

@Tim Emit  if you're using windows it's much easier to grab one of the executable packages, for linux you need the Qt5 development stuff, libs and headers and the gcc compiler with all of it's goodies, standard on most linux dists.
You will also need this zip of M. Benesi's fragments that use the new mouse feedback arrays, these have been tested with the exes/sources on my website, other versions may not work unless they have applied the changes mentioned above.
The source packages have a mkmingw.bat file for win and a mklinux.sh script for linux (might work on mac too), open these in a text editor before running them, read the commands and comments, that should help, and remove the "break" line and they will run through the process of compiling, I put the "break" line there to make sure you have to open the file and look at it, the bat file expects Fragmentarium-1.0.19-3Dickulus/ folder to be in C:\ , if you have it somewhere else you will have to change the paths to your location, for linux, in a console window, just CD to Fragmentarium-1.0.19-3Dickulus/, where ever it is, and run the mklinux.sh script.

let me know if you have any problems  smiley
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #43 on: January 18, 2016, 10:41:15 PM »

  Look in the frags, start a thread and ask away.   afro

  If you look at the frags, I added a little bit of code to them to add Feedback functionality (this is from the Menger- I added some heightmap functionality, which requires the use of my fast raytracer with textures, or fast raytracer with textures and multisampling):

Code:
while (fi<=feedbackstop) {
if (feedbackcontrol1[fi].x==m) {   //feedbackcontrol1[fi].x =  ApplyOnIteration
zappaz=length (pos-feedback[fi].xyz);
if (zappaz<feedbackcontrol2[fi].x) {     //feedbackcontrol2[fi].x= Radius of effect!
zappaz= (feedbackcontrol2[fi].x-zappaz)*feedbackcontrol2[fi].y;
      //feedbackcontrol2[fi].y = strength of effect, holding in alt key makes negative!!!
if (feedbackcontrol1[fi].y==1.) {  //feedcontrol1[fi].y= formula type
if (feedbackcontrol1[fi].z==1.) {  //  application type  
//zappaz=length(feedback[fi].xyz)*zappaz;
z2=vec3(zappaz,0.,0.);
z2*=rotationMatrix3(normalize(feedbackrotation[fi].xyz),feedbackrotation[fi].w);
z+=z2;
} else if (feedbackcontrol1[fi].z==2.) {
z+=feedback[fi].xyz*zappaz;
} else if (feedbackcontrol1[fi].z==3.) {
zappaz=length(feedback[fi].xyz)*zappaz;
z2=vec3(zappaz,0.,0.);
z2*=rotationMatrix3(normalize(feedbackrotation[fi].xyz),feedbackrotation[fi].w);
z+=z2;
}
} else if (feedbackcontrol1[fi].y==2.) {
z2= (pos-feedback[fi].xyz)*zappaz;
z2*=rotationMatrix3(normalize(feedbackrotation[fi].xyz),feedbackrotation[fi].w);

if (feedbackcontrol1[fi].z==1.) {
z=z2;
} else if (feedbackcontrol1[fi].z==2.) {
z+=z2;
}

} else if (feedbackcontrol1[fi].y==3.) {
//formula type 3 lets you rotate around the point- not fully set up yet..  should set it up so that space and the fractal can be
// twisted around a certain line/cylinder
if (feedbackcontrol1[fi].z==1.) {
z*= rotationMatrix3(normalize(feedbackrotation[fi].xyz),feedbackrotation[fi].w*zappaz);
} else if (feedbackcontrol1[fi].z==2.) {
if (zappaz<0) {zappaz=-(feedbackrotation[fi].w-zappaz);} else {zappaz+=feedbackrotation[fi].w;}
z*= rotationMatrix3(normalize(feedbackrotation[fi].xyz),zappaz);
} else if (feedbackcontrol1[fi].z==3.) {
if (zappaz<0) {zappaz=zappaz-.1;} else {zappaz=zappaz+.1;}
z*= rotationMatrix3(normalize(feedbackrotation[fi].xyz),feedbackrotation[fi].w/zappaz);
}

} else if (feedbackcontrol1[fi].y==4.) {

//heightmap function here   ***************************************************
// feedcontrol1.w = texture speed        ************    Selecting formula type = 4 get you the heightmap
// feedcontrol2.z=  heightmap texture selection
// zappa uses feedcontrol2.y as the heightmap strength variable...
MapType=HeightMapType;
textoff=vec2(feedbackcontrol2[fi].z,feedbackcontrol2[fi].w)*.1;
texturespeed=feedbackcontrol1[fi].w;
hintensity=zappaz;
ColorTex=int(feedbackcontrol1[fi].z);    //set colortex to height map 1 texture
z2= z*rotationMatrix3(normalize(feedbackrotation[fi].xyz),feedbackrotation[fi].w);
z2=TextureIT(vec4(z2,length(z2)));

z+=z2*hintensity;

//  I didn't set it up so that you could set up multiple shapes to stamp with yet (square stamp, rectangular, etc.)
//  but you can heightmap specific places at specific iterations....  



} else if (feedbackcontrol1[fi].y==5.) {
//  formula type 5 is sort of cool- you can set it up to stretch and distort based on fractal values... play with this one!
r=zappaz * length (vec3(
z.x*feedbackrotation[fi].x,
z.y*feedbackrotation[fi].y,
z.z*feedbackrotation[fi].z
));
z=vec3(z.x+feedbackcontrol1[fi].w*r,
z.y+feedbackcontrol2[fi].z*r,
z.z+feedbackcontrol2[fi].w*r);

}
}  //zapparadius check
}   //feedbackcontrol iteration check
fi++;
} // end of while (fi<FeedBacks)


  I realized the code looks... complicated, not like something you can just use without a lot of effort, and this isn't the case.


  The tool itself is easy to use, you just have to pick some of the frag's feedback settings (radius, strength, formula type, application type) and then use your mouse, <ctrl>, <alt>, and <shift> keys.  I'll have to set up a few presets so that you can play around. 

  You can add specific heightmaps to certain locations of your fractal (on specific iterations, or whenever) by spraying them on, etc.  Just ask how.  smiley
« Last Edit: January 19, 2016, 06:59:19 AM by M Benesi » Logged

claude
Fractal Bachius
*
Posts: 563



WWW
« Reply #44 on: February 02, 2017, 02:01:56 AM »

Doesn't seem to work with the Progressive2D camera mode.  Any chance of a version that does?  Or guidance to the relevant parts of the source code so I can try to add it myself?  Thinking it would be good for implementing the recent inflection mapping experiments posted by Dinkydau and Kalles Fraktaler...
Logged
Pages: 1 2 [3] 4   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
A fairly classic-style fractal Images Showcase (Rate My Fractal) David Makin 5 2573 Last post December 09, 2006, 02:30:37 AM
by Unhooked
Weird mandelbrot modification. Meet & Greet init 1 1149 Last post September 11, 2011, 11:48:16 PM
by lycium
Cheater's Brot... and spokes modification Theory M Benesi 0 2204 Last post February 29, 2012, 05:35:30 AM
by M Benesi
Do fractal-artists actually know which modification effects what in MB3D ?How..? Help & Support psYnfinite 1 487 Last post June 03, 2013, 07:27:46 PM
by vinz
Circle and Line, fractal style Images Showcase (Rate My Fractal) Eric B 1 2010 Last post January 07, 2014, 09:27:26 PM
by youhn

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.197 seconds with 25 queries. (Pretty URLs adds 0.022s, 2q)