Hi all, I just throwing these presets I've been messing with in a new thread in case anyone is interested in doing something with these. I kind of hit a stopping point with what I can do with the limited (non-existent) coding knowledge I have.

What is this you ask? When I saw amandio c - muybridge's horse, I thought it would be awesome to be able to swap different pictures into a preset for different effects, kind of like having a template for multiple images for a preset. Well, obviously Milkdrop and other presets doesn't play nice with multiple images and trying to mix shaders into this did not work. When it is coded into gmagabuf, then some shaders would work, but I am clueless on gmagabuf.

Until I stumbled on a preset by none other than, Martin, with his face down ass up preset, and that was a huge help.

In my trying to understand this, amandio c was able to sequence 16 images that ran in order in the per-frame section whereas Martin did it in the warp shader which limited it to 5 images but was able to be forced to play nice with other presets. Amandio c's did their thing no matter what.

So xmuzack + martin + various - stormy midnight drive is 5 pics with effects in a 12345 sequence that reacts to music and

xmuzack + martin + various - EQ Dancer has effects, reacts to music too but the images show up in random order instead of 12345 sequence. I was trying to have the dancer hit a different pose each time a beat hit, but it's not quite there, lol

Anyone is welcome to tinker with these or make it better if so desired, I hit a dead end on what else I can do to make these better.

I too, have a similar vision, for multiple images serving more than horse, but I'm becoming aware that the dancer has her limits as well.

Back before the legend endowed my feeble grasp on Milkdrop, I was scavenging google images for .gifs to disassemble and mash in with shaders. Today, I still get very confused. It might take me a whole semester of kindergarten to connect the dots with your equations, so instead of tinkering with your preset, I tinkered with the dancer and put her in a preset I have been tinkering with recently. Somehow I've already reached the maximum # of textures, so I wasn't able to squeeze in the last image, but she still mashes well with comp shaders. Until I tinker out where this extra texture is, I'll save my questions about the legends water effects.

By the way, I love that jellyfish you did. You did more with that one image than I with fifteen.

Butterbeaster, thanks for the compliments, but I can't really take any credit for the coding since I'm sill struggling with Milkdrop coding and am merely working off of the back of giants like Martin and Flexi. Heck, even your coding is awesome. I still have your first preset you asked for help here in my rotation. I'm still trying to learn enough to where I can present my own original preset.

Wow! Your !!!!!!!!!!!!!!tester4cuttlefish in bucket with chips and dip for xmuzacks dancer is amazing! I'm trying to figure out how you managed to get the bnot(t) in the per_frame working with the comp shaders. I tried and tried and tried and it either has no affect or shows a black screen, but you did it, wow. And Martin managed it with megabuf.

I guess the best way to feed more textures into a preset is to pack them into a single file. Milkdrop supports DDS which I think is suitable, but I never tried it.

@Butterbeaster: The preset does not show because textures are missing. Please do not expect me to have all textures posted on the forum on my drive.

@xmuzack: What is your issue with bnot ? Whatever you define in the frames section, you can convey to the shaders via the q variables (and only these ! The shader sections do not know megabuf neither the reg variables).

Tip: bnot(1-t%5) can be written shorter: t%5==1. These old milkdrop boolean functions still work but are no longer required, and can also be written in C style, e.g.
bnot(a) is the same as !a (negation)
equal(a,b) is the same as a==b
above(a,b) is the same as a>b
below(a,b) is the same as a<b
band(a,b) is the same as a&b (bitwise and)
Saves some typing and is easier to read

Hi Nitorami, interesting you mentioned Milkdrop supporting DDS. I'm going to have to play with that since Photoshop is in my background. So would learning C or C++ be a help for a few ideas I have for Milkdrop? Tons of resourses on C on the web, and it seems to me Butterbeaster used some C. I could be wrong of course.

Here's the issues I'm having, I'm sorry if this is a bit long:

Barrowed form Amandio C's Muybridge Horse and shortened to used 5 images, I understand that the samples is defined in the comp shader so the only way for that to work is to manually work the shaders in there. Example being the Muybridge Horse pixelated preset (not shown below).

Blatant errors is an understatement. I've spent weeks trying to figure this out and it was staring right at me in my face. I'm a dunce, lol Thank you Nitorami for pointing this out to me. Honestly, I was scared of asking for help.

So, tex2D has to be right next to the () and Milkdrop was screaming to me the answer, undeclared identifier 'text2D' wow. I'll work on improving my coding.

Whelp, the code worked as soon as I fixed it and I now realized it's not limited to only 5 images. Yay.

Hmm, I wonder why my mistakes worked in the comp_shader and not in the warp_shader. Interesting. Disregard this last sentence, I see my mistake here.

Last edited by xmuzack; 18th February 2018 at 21:01.
Reason: Added sentence

tex2D(uv, some_texture) is a function, and "samples" some_texture at point uv.
uv has a x- and y- coordinate uv.x and uv.y.
Both are floating point numbers between 0...1.
So uv contains 2 floating point numbers and is therefore of type "float2". A "point" in x-y-coordinates.
The shader works on all pixels at the same time. What happens when you define

ret = tex2D(sampler_dancer1,uv);

is that the shader "samples" the texture sampler_dancer.jpg at each x,y coordinate between (0;0) and (1;1) at the same time and throws the result to the screen (which is "ret").

More precisely not each coordinate, because the number of possible coordinates would be infinite, but each pixel. On a 1024 x 1280 screen, this would be 1.310.710 pixels.

Thanks Nitorami, if I remember correctly, I believe I saw a post from you from years ago, where you mentioned images within Milkdrop wasn't your strong suit.

The explanation you just gave me above is the best explanation I've read on the mysteries of tex2D, Milkdrop coordinates and ret and makes reading the Milkdrop Preset Authoring Guide a bit easier to comprehend. I'll be working through it again with your insight in mind.

To a lot of folks, shaders seem to be a mystery. And indeed shader programming is different to what one would naively expect when doing a image processing routine in a language like C or any other. We would start with loops

code:
for x:= 0 to 1279 do
for y := 0 to 1023 do
ret := Some_Colour_as_function_of (x,y)
end;
end;

In the shaders, the loop is implicit. You do not need to define it manually. It took me quite a long while to understand this principle:

The video card runs the exact same shader code for each pixel on the screen.
Then why isn't each pixel the same and we only see a uniform screen ?Because the code uses variable uv, which is the screen position for each pixel.

The entire shader code is one big formula which does the same for each pixel, only depending on the screen position uv. If your code does not use uv, all pixels will inevitably be the same. Using uv is the ONLY way to produce some sort of picture.