Title: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: M Benesi on November 30, 2015, 03:56:12 AM I'm mulling over developing a method of modifying fractals on the fly. Not sure if it's pragmatic to do in Fragmentarium, or if it's more of a Mandelbulber type of thing (I have access to free c++ compilers- not free Delphi, so... M3D programming is out of reach at the moment).
1) Calculate and display fractal (or other mathematically generated object), storing pixel position and orbit information 2) Modify or add to original fractal with a "spray gun" that either: a) "sprays" math that penetrates the fractal to specified depths and/or permeability settings (perhaps weighed by orbit values and/or fractal density in the area) b) "sprays" another formula that grows from the surface of the other fractal, with a new origin point set either on the surface of the fractal, or seeded to a specific depth. Scale the pixels around the new origin so that the longer you "spray", the larger the fractal gets. 2a will allow us to alter existing fractal structures with various formulas that we can "spray" on, that penetrate the fractal in such a way that it modifies the original fractal. So you could spray a bit of Menger on a Mandelbulb and see how it changes the fractal, when you set its penetration level and the other fractal's permeability level.... 2b will allow us to spraypaint sections of other types of fractals onto the original fractal. So we'll have one fractal, then spray something on it that is slightly different. Grow some other fractals on the surface of the first like crystals... or plants. As long as nobody makes fun of me for growing fractal plants in the desert. Set new origins (0,0,0) at the center of the "spray" for 2b. You wouldn't want full sized fractals to grow from there, so for a fractal that is the size of a Mandelbulb, you'd probably start out with a really high pixel scale (100x) from the new origin, so that you have a tiny one growing out of the other at first, that would slowly grow as you sprayed more "formula" on the fractal (reduce the pixel scale... so if pixel scale = 1, you get a full sized fractal growing out of the side of your original, if pixelscale=100, you get a 1/100th size fractal growing out of the original). That's not the only idea- but these 2 options would greatly increase the ability of those who pursue the mathematical arts, and may lay the groundwork for the creation of fractal worlds to explore, that evolve according to their own rules. Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: Patryk Kizny on November 30, 2015, 10:53:45 AM Very interesting!
Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: mclarekin on December 01, 2015, 03:01:58 AM Quote Grow some other fractals on the surface of the first like crystals... or plants. That will be cool O0 O0 O0 Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: 0Encrypted0 on December 01, 2015, 04:14:01 AM Animate multiple sprays with collision detection to mimic real world fractal formation?! :dink:
Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: M Benesi on December 01, 2015, 06:45:31 AM Let's hope we can pull this one off. :D I'm caught up in a coloring scheme at the moment... will post it in another thread.
Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: 3dickulus on December 01, 2015, 07:06:14 AM wow, some crazy math, in some of my latest pics (and posted frag) a mandelbulb and a menger sphere are rendered in the same space and we see the interference. Being able to control that interference via a "spray" would be an amazing feat.
The "spray" controls which formula has dominance in the same space? Spray "droplets" grow clusters based on orientation when they hit the surface? I think the first will be easier, spraying bulb solvent and/or sponge solvent at a space that contains both bulb and sponge, area eroded by bulb solvent is dominated by sponge formula and area eroded by sponge solvent is dominated by bulb formula. Way out there man! O0 Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: M Benesi on December 01, 2015, 07:17:41 PM I would think we might be able to weight the formulas for dominance, permeability, and penetration :tongue1:
1) set up a framework to target specific locations of the fractal on mouse over. I think Syntopia said something about there being some hurdles to overcome if we wanted to do something like that with Fragmentarium- I think an early feature request was to be able to click on the fractal to select a specific part of it (extract Julia coordinates), and Syntopia said there were problems passing information back and forth between the GPU and CPU. We need to implement a way to pass the fractal window's pixel position and depth to an accessible array that mouse over would allow us to select from. That would be useful for exploration anyway (x,y,z position on mouse over). This will have to be hard coded into Fragmentarium, rather than being another frag, since it will be part of the interface. I think M3D and Mandelbulber already have the ability to extract Julia coordinates from the fractals, so... they have at least part of this covered already. We need to do this for M3D exploration window!!!! 2) use this information to allow local alteration of the fractal. For now, I'd recalculate the whole fractal just to get this thing working, but we eventually want to be able to do a quick local redraw. -center the alteration at a certain point (new origin at that point) - scale pixel distance from new origin for added fractal -- either do a simple blend of the old fractal's orbit values with the new fractal (centered at and scaled to the new origin values), grow where the old fractal is not, or blend formulas according to permeability, penetration, dominance, etc. We might not want the new formula to add new structure: it might be an acid that eats away at the existing structure... We can already do pretty simple blends, by programming a second formula to only interact in a specific area after we calculate the first formula*. The major thing is the ability to mouse over and select specific areas to do it visually, instead of using parameters to center a second formula. Pretty sure Mandelbulber might have something that allows you to do things like this already, from what I've seen. Mclarekin? * So, I'd calculate the first formula, and if it is withing a certain distance of the new origin, scale pixels appropriately, start out new fractal from new origin (one or more iterations:f2,f2,f2), then add in (maybe scaled) orbits from the first formula as you continue to iterate Down the line: 3) set up permeability, etc. 4) set up spray gun- maybe create multiple new origins due to adherence (3Dickulus), sometimes they could interfere, sometimes not... Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: 3dickulus on December 02, 2015, 05:30:26 AM Fragmentarium currently renders to 2 textures (flipping with each subframe to accumulate, rendering to one and accumulating to the other), RGB, and uses A for accumulation amount, this texture is rendered to a quad for display. At this stage (display) the depth buffer is lost due to the flat surface used for rendering the texture... and these are 2 separate glframebufferobjects. Standard GL mouse "picking" code does not work here.
the first subframe depth buffer gets filled with real fractal depth values and is used to draw the spline paths with occlusion and for saving (1.0/z) as alpha channel in EXR format images, in "progressive" render the alpha channel is preoccupied with tracking accumulation but before the texture is rendered to a quad for display (buffer shader) the depth buffer is available (this is when it can be written to EXR file as alpha channel). the glframebufferobject with the depth information should be able to be polled for a z value and xy can be figured out using a transform on mouse@screenXY vs camera->pos->dir but me thinks your average gfx card would be way too slow to make this useable... however... there is this https://www.youtube.com/watch?feature=player_embedded&v=uFWw6hGIKmc Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: Crist-JRoger on December 02, 2015, 05:53:15 PM however... there is this How add this chromatic aberration effect in fragmentarium? :embarrass: 88) Maybe other simple post-effects...Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: M Benesi on December 02, 2015, 06:19:01 PM the first subframe depth buffer gets filled with real fractal depth values and is used to draw the spline paths with occlusion and for saving (1.0/z) as alpha channel in EXR format images, in "progressive" render the alpha channel is preoccupied with tracking accumulation but before the texture is rendered to a quad for display (buffer shader) the depth buffer is available (this is when it can be written to EXR file as alpha channel). the glframebufferobject with the depth information should be able to be polled for a z value and xy can be figured out using a transform on mouse@screenXY vs camera->pos->dir So we can't grab the pixel position prior to passing it to the DE loop, saving it if it's a hit, then compare mouse@screenXY to camera->.... because the pixel position is not passed by the front end, rather it is calculated in the GPU.. nevermind. Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: 3dickulus on December 03, 2015, 05:30:26 AM yes, no pixel information is available until after the shader executes on the GPU
I tried, some time ago, to poll the depth buffer for coordinate feedback but did not get it working right, I do think it is possible to get depth value @mouseXY, I just haven't found the method yet, I was looking at GL "object picking" example but this requires two passes of GLpaint, one for image one for depth, and a "pick" buffer. Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: M Benesi on December 03, 2015, 07:01:38 AM There has to be an efficient way to pass the depth to a cpu array on detection of hit.
What about mouse click on the window recalculates the depth of the pixel the mouse pointer is over? Or we could do mouse hover> .3 seconds = pixel depth check at current location... Other stuff: http://www.fractalforums.com/index.php?topic=21759.msg87160#msg87160 https://www.opengl.org/sdk/docs/man2/xhtml/glReadPixels.xml Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: 3dickulus on December 03, 2015, 07:47:18 AM I use...
Code: glReadPixels(0, 0, w, h, GL_DEPTH_COMPONENT, GL_FLOAT, myDepths); Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: M Benesi on December 03, 2015, 09:10:52 AM :D might be nice.
So we will have depth + coord, so we can get the vertex from that. I think there should be a function that you can put coord + depth into to extract a vertex, right? Inverse projection matrix??? Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: Patryk Kizny on December 03, 2015, 06:34:38 PM You guys actually inspired me quite a lot to mix spatially various formulas. And this can be easily done using sin-based fields or so.
Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: M Benesi on December 03, 2015, 08:20:07 PM lol... I'm going to do something along those lines while I await 3dickulus's response.
Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: 3dickulus on December 04, 2015, 05:53:50 AM :D might be nice. So we will have depth + coord, so we can get the vertex from that. I think there should be a function that you can put coord + depth into to extract a vertex, right? Inverse projection matrix??? in DisplayWidget.cpp perspective matrix is set from current Eye, Target, Up and FOV before drawing splines but after rendering our image-to-texturewith shader code before on-quad with buffershader like... Code: QMatrix4x4 matrix; matching the shader code... Code: // sets depth for spline path occlusion as evidenced by visible spline occlusion, the values seem good, I would like to fix a few bugs and clean up a little before starting to code something new, so maybe the larger math brains can look at the numbers while I'm trying to squish a few texture bugs. you can check the docs for functions built into QMatrix here http://qt.apidoc.info/5.1.1/qtgui/qmatrix4x4-members.html the thing you require may already be there ;) edit:clarification re: the order of rendering texture + rendering with buffershader mentioned above, just a thought... if the depth buffer is not cleared between shader and buffershader (true) then depth should be readily available in the buffershader frag? (could also be passed as vec4 color.w) if that is the case there is a lot of code space available for tinkering with because buffershader compiles to a little more than 200 lines of assembler, the max for a shader is over 15000, render primary obj in shader, render "spray" in buffershader :hmh: edit2: I think you will have to "record" a stroke then render it on MouseButtonUp, this is a very ambitious goal that may require a lot of GPU power to realize at a reasonable rate, but if you write the code and it works, even slowly, I'm sure the hardware will catch up :) Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: M Benesi on December 04, 2015, 08:56:38 AM lol.. thanks for the update. I am worried about mouse clicks using up too much in the way of GPU resources...
Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: M Benesi on December 10, 2015, 11:20:12 PM This is still on my mind. Have another easier thing to implement first.
Might fix the heightmap/texture thing first too... ;) ... not like we won't be spraypainting heightmaps onto fractals when we get the chance. ;) Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: M Benesi on January 05, 2016, 01:15:05 AM Fractal spray gun is AWESOME. Official release will wait for 3dickulus to update.
It's pretty fun. 3dickulus and I set up some simple code that basically allows you to smoothly "hammer" and mold fractals. Holding in the mouse and <ctrl> button makes it happen continuously, which acts a bit like a "spray gun". Wow... It is awesome. Completing code- one or 2 things need to be added for it to be complete, although maybe put it out there for you to test before it is completely done. Probably (definitely :D ) want this in Mandelbulber and M3D. :D Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: mclarekin on January 05, 2016, 11:18:56 PM Looking forward to trying this out. Hurry hurry hurry :)
Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: Crist-JRoger on January 06, 2016, 07:06:06 AM Fractal spray gun is AWESOME. Official release will wait for 3dickulus to update. sorry, my english not so good... what you talking about?It's pretty fun. 3dickulus and I set up some simple code that basically allows you to smoothly "hammer" and mold fractals. Holding in the mouse and <ctrl> button makes it happen continuously, which acts a bit like a "spray gun". Wow... It is awesome. Completing code- one or 2 things need to be added for it to be complete, although maybe put it out there for you to test before it is completely done. Probably (definitely :D ) want this in Mandelbulber and M3D. :D Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: M Benesi on January 06, 2016, 08:59:26 AM It's a tool to modify fractals by clicking on them in the fractal window... in early stages of development. It can be used in many ways.... like a hammah. It's not what I originally intended to create (I intended on storing all data in a massive array, and then interacting with the data directly instead of re-rendering every time we add something), but it's good.
These are all regular z^8 Mandelbulbs that I "pushed" and "pulled" on with the tool, the one I tried making mini-fractals on, but didn't set the frag up correctly to get details (just selected "closest" DE of the minibulb and the main one, instead of figuring out the math...): (https://lh3.googleusercontent.com/-xkewc-SAra0/VozMKZNMycI/AAAAAAAAEkM/ETsqwd0LzGk/s400-Ic42/demo%2525204.jpg)(https://lh3.googleusercontent.com/-y5CzO6_b0is/VozGGYhVaYI/AAAAAAAAEjs/uO2nJi0vbTI/s400-Ic42/demo.jpg) (https://lh3.googleusercontent.com/-tWMoWD5I5lU/VozIHgEj1yI/AAAAAAAAEkA/0hj-p9UyZF8/s400-Ic42/demo%2525202.jpg)(https://lh3.googleusercontent.com/-ixraU2HI4Bc/VozIGpMeMgI/AAAAAAAAEj4/6b7W0VWQF54/s400-Ic42/demo%2525203.jpg) Still needs a bit of work prior to release, but it's getting there. Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: M Benesi on January 07, 2016, 07:13:46 AM not stretched.. stretched. Why? Needed to stretch a Menger.
Probably should write miniMengering code, ehh? (https://lh3.googleusercontent.com/-BIz0eAGEpZY/Vo4BmjyGMtI/AAAAAAAAEks/pgcz05HUi_8/s400-Ic42/mm2.jpg) (https://lh3.googleusercontent.com/-a7LKvUe1TjQ/Vo4Blzd-VtI/AAAAAAAAEkk/Rmy4c0-w8lo/s400-Ic42/mm1.jpg) I'm thinking directional stretching, only applied to one axis would be sort of cool. Wait. Maybe real cool. Imagine opening a drawer on a Menger. Is it possible? Can it be done? I better put on some tunes before I code any more. Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: 3dickulus on January 07, 2016, 08:47:06 AM edit: see next post Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: M Benesi on January 07, 2016, 09:18:24 AM Ok.. re-clicked "publish". Apparently leaving a youtube webpage after clicking publish actually makes it so the video doesn't publish, even when you click "publish" (it warned me to wait until it was done... I assume it's for people who decide not to publish something at the last second and try to close a tab to keep it from going live). https://www.youtube.com/watch?v=mQzi0LuG3yo (https://www.youtube.com/watch?v=mQzi0LuG3yo) Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: Patryk Kizny on January 07, 2016, 07:44:50 PM This looks sick! How far will we be able to interact with the fractal?
Would the brush data be accessible as a 3D vector field or a texture? So that I can access it from the code and implement different formulas to manipulate the fractal? Is this available as a source code or there are already any builds? Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: M Benesi on January 07, 2016, 09:05:28 PM How far do you want to interact with a fractal?
For now, we're storing information in uniform arrays that are accessible from frags. A more complete implementation with quantized space (for various reasons, eliminate loops, etc.) might be in the works, but it will still use this code so that we can undo and redo the last changes made to the fractal. For now.. you have to use loops in frags to apply changes to the fractal and recalculate entirely, instead of applying changes to locations in quantized space without recalculating the whole thing. Code: quantized space.... eventually: Otherwise, a line of code has to be changed. Building and testing now. haha.. fixed it. What a pain. A whole morning of work to get a couple of lines of code to work!@$!@$ that's life, ehh? I'm putting together a couple of frags to demo the functionality, Code exists, waiting for 3dickulus to look it over. whistle whistle... Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: LMarkoya on January 09, 2016, 02:25:03 AM Looks like a great start, looking forward to playing with this one :thumbsup1:
Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: 3dickulus on January 10, 2016, 12:53:25 AM should have put this one up earlier, need to refine it to the simplest form so that it's a bit more generic and applicable to fractal objects without rewriting all of the frags in the Examples folder.
https://www.youtube.com/watch?feature=player_embedded&v=nZNG68ePF2s source code is available but by no means finalized hot-keys work like this... CTRL+LMB = adding/pushing CTRL+ALT+LMB = flip sign to negative, subtracting/pulling CTRL+SHIFT+LMB = delete the last one, decrement index to array of recorded mouse clicks CTRL+ALT+SHIFT+LMB = reset, delete all and start again Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: M Benesi 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. :D (https://lh3.googleusercontent.com/-6jC4QSEc6ks/VpFyK4vdE7I/AAAAAAAAEmg/RWJeNLDAVlk/s720-Ic42/mm5.jpg) Code: while (fi<=feedbackstop) { 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. Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: mclarekin 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? Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: 3dickulus 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 Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: 3dickulus 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 ;) Here are the Windows executables for anyone that already has a recent version of Fragmentarium installed, (http://www.digilanti.org/fragmentarium/) 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[] Code: //feedbackcontrol1.x[] 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! Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: M Benesi on January 10, 2016, 05:51:04 AM lol, I have plenty of time to change them from floats to ints. That's easy. ;)
Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: 3dickulus on January 10, 2016, 07:33:00 AM ...so... int sliders, are working correctly.
Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: Tim Emit 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
Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: 3dickulus 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 Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: M Benesi on January 14, 2016, 06:42:07 AM 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. Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: 3dickulus on January 14, 2016, 07:14:39 AM Hi All :)
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 (http://www.digilanti.org/fragmentarium/) 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, (http://www.digilanti.org/fragmentarium/Fragmentarium-1.0.20-Qt_5_4_2_MinGW-exe-only.zip) just drop the exe of your choice into your Fragmentarium working folder. NODLLs, if you want the Examples/, fqscript/ and Misc/ folders + win binaries (http://www.digilanti.org/fragmentarium/Fragmentarium-1.0.20-Qt_5_4_2_MinGW-NODLLs.zip), basically the whole thing but without the Qt 5.3.2 DLLs and the full package, (http://www.digilanti.org/fragmentarium/Fragmentarium-1.0.20-Qt_5_4_2_MinGW.zip) has everything :) You will also need M. Benesi's fragments that use the new mouse feedback arrays (http://www.digilanti.org/fragmentarium/MB-FS-tex.zip), 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 :beer: :beer: :beer: Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: M Benesi on January 18, 2016, 02:25:12 AM Just helped patch it in. right... 88)
Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: Tim Emit 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. :)
Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: 3dickulus 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 (http://www.digilanti.org/fragmentarium/MB-FS-tex.zip), 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 :) Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: M Benesi on January 18, 2016, 10:41:15 PM Look in the frags, start a thread and ask away. O0
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) {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. :) Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: claude 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...
Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: 3dickulus on February 02, 2017, 03:45:12 AM If you do a global search for "Benesi" on the files in the source tree you will find about 20 occurrences, these mark the "feedback" code.
I only test for 6 uniforms to identify a frag as a working feedback shader but (there's always one but) the frag must have all of these vars in order to work... 1. "feedbackcrds" 2. "feedbackcontrol1" 3. "feedbackcontrol2" 4. "feedbackcount" 5. "feedbackrotation" 6. "FeedBackCutOff" 7. ApplyOnIteration 8. FormulaType 9. ApplicationType 10. FeedbackVariable1 11. FeedbackRadius 12. FeedbackStrength 13. FeedbackVariable2 14. FeedbackVariable3 15. FBRotVector 16. FBRotAngle as listed in MainWindow::setFeedbackUniforms() they are designed for 3D but should be accessible in the 2D fragment code, you'll just have more data to play with ;) I can probably dredge up some of the beta frags if you can't find an example in the threads, just let me know or ask Matt. Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: claude on February 02, 2017, 08:17:26 AM Thanks for the hints!
Ok, after adding the many uniforms with widgets where appropriate in a #group called Feedback (to help with the "widget doesn't display if GLSL compiler dead-code-eliminates it" issue), I get the Zappa toolbar to show when loading my frag, which I guess is a good sign. But now I get this in the status bar, and the zappa spinbox is stuck on -1, and nothing seems to be happening with my ctrl-clicks.... Code: Current Zappa:0, -1 : 226,24,0 Current non-working frag attached... appreciate any feedback (sorry for the pun!).. I'm using 1.0.29 because I didn't see anything in the changelog to make it worth asking for the source of the latest. Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: 3dickulus on February 03, 2017, 06:21:52 AM a little info here... represents the current state...
http://www.fractalforums.com/announcements-and-news/fragmentarium-1-0-10/msg91090/#msg91090 this ^ ^ ^ development was done with Examples/Benesi/Mandelbulb_with_Feedback.frag (attached) and works with all versions of FragM since v1.0.21 Matt came up with the idea and code for feedback and I helped expose it in the GUI, it's all his magic, so this is probably about as much help as I can offer. oh, you can also load and save the feedback data as a text file, when a frag is recognized as a valid feedback frag there will be 2 new items for this under the File menu. in v1.0.30 the 2DCamera control switches to non-progressive mode when the mouse button (any) is down ie:when dragging the view around, so that there is less lag when running a "heavy" frag with high iterations or complicated formula. This does not seem to have any impact with the above mentioned frag because it uses the Fast-Raytracer.frag which doesn't do progressive rendering. reminder:please use the windows installer for FragM as it makes updating via MaintenanceTool painless, for linux/mac/win current source is available just ask ;) Title: Re: Fractal Gun: paintbrush/spraypaint style modification of fractals Post by: 3dickulus on February 05, 2017, 02:32:10 AM EDIT: after a look at the code I must revise this post... I know you're looking at this for 2D, however, in the 3D version depth is required for calculating the Z component, the attached Fast-Raytracer.frag has the depth code, adds checkboxes in the Post tab and copies the depth value into the alpha channel. I noted a wee bug when testing with v1.0.30, you must click LMB in the GL area before pressing CTRL+LMB to add zappas or they get the wrong depth and you can't see their effect. Mandelbulb_with_Feedback.frag and Fast-Raytracer.frag included in the dist should work out-of-the-box. For 2D you might have to populate the alpha channel with an offset or something but the depth code must exist as in Fast-Raytracer.frag for Fragmentarium to process the data properly. You should be able to add it to Progressive2D.frag. in DisplayWidget.cpp lines 1190 - 1192 Code: /// copy the depth value @ mouse XY hmmm... 1. currently will not work with camera=2D 2. currently ZAtMXY is not initialized to a default at startup I will make the adjustments in DisplayWidget.cpp so that ZAtMXY is initialized to 0.0 at startup and remove the cameraID test, that should allow it to work, the frag depth code will still have to put a useful value there. |