mirror of
https://github.com/WinampDesktop/winamp.git
synced 2024-12-03 00:37:16 +01:00
278 lines
12 KiB
INI
278 lines
12 KiB
INI
/*
|
|
|
|
NOTE: AS OF MilkDrop v1.04, the functionality of the 'burn' variable
|
|
has changed. See below.
|
|
|
|
NOTES/TIPS
|
|
-sprites range from 00-99
|
|
-'img=' line is mandatory. File types currently supported (as of v1.04):
|
|
JPG
|
|
PNG
|
|
BMP
|
|
TGA
|
|
DDS
|
|
PPM
|
|
DIB
|
|
-valid filenames are:
|
|
relative: img=billy.jpg (to winamp\plugins dir)
|
|
img=..\billy.jpg
|
|
img=images\billy.jpg
|
|
absolute: img=c:\blah\billy.jpg
|
|
NOT ok: img=c:billy.jpg -must specify path
|
|
NOT ok: img=\billy.jpg -must specify drive
|
|
-textures can be as large as 2048x2048 and do not have to be square.
|
|
-texture dims in memory will be next power of 2 higher for w, h.
|
|
ex: 500x60 texture will be stored in memory as a 512x64 texture.
|
|
-big textures can take up a lot of video memory and seriously
|
|
drop the frame rate; recommend sprites be no larger than 512x512.
|
|
256x256 is even more preferable.
|
|
-if there isn't enough video memory for the texture, it will downsample
|
|
the texture (to as low as 16x16 pixels) trying to fit it into video
|
|
memory.
|
|
-IMPORTANT: to terminate a sprite from within its own code, set the
|
|
'done' variable to a nonzero value (such as 1). For example,
|
|
"done=above(frame,500);" would make the sprite auto-self-terminate
|
|
after 500 frames. To make this framerate-independent, based it on
|
|
'time' or 'frame/fps' (they are equivalent).
|
|
-there is currently a maximum of 16 sprites that can be on the screen
|
|
at one time.
|
|
-the sprite manager supports instancing, so if you load two sprites
|
|
that access the same image on disk, only one texture will exist
|
|
in video memory.
|
|
-the sprite manager frees textures immediately when all the sprites
|
|
using that texture (all instances) expire or finish.
|
|
-all of the mathematical functions available for milkdrop's per-frame
|
|
and per-pixel equations are available here for doing funky things
|
|
with the sprites; see milkdrop_preset_authoring.html for a complete
|
|
list of all the functions available.
|
|
-you can define your own variables in the init_ code just by setting
|
|
them to some value (like in the per-frame or per-pixel code of a
|
|
milkdrop preset). You can then access this value later in the
|
|
per-frame (regular) sprite code. If you change its value, the
|
|
change will be remembered from frame to frame. Also, if you
|
|
change the value of a built-in (read/write) variable, this change
|
|
will also be remembered from frame to frame.
|
|
|
|
|
|
READ-ONLY VARIABLES
|
|
-------------------
|
|
time
|
|
the amount of time that has elapsed since the sprite
|
|
was launched (in seconds).
|
|
frame
|
|
the # of frames that have elapsed since the sprite
|
|
was launched.
|
|
fps
|
|
the current fps (frames-per-second) the MilkDrop is running at.
|
|
progress
|
|
the progress (0=start .. 1=end) through the current MilkDrop preset.
|
|
bass, mid, treb
|
|
the relative amount of each audio band being heard this frame.
|
|
1 is normal; a number less than one (say, 0.5 .. 1) means
|
|
the band is quiet; and a number greater than one (say, 1..2)
|
|
means the band is loud.
|
|
bass_att, mid_att, treb_att
|
|
the same, but attenuated to be relative to the average band levels
|
|
over a longer period of time (i.e. more heavily attenuated/damped).
|
|
|
|
READ/WRITE VARIABLES
|
|
--------------------
|
|
x,y
|
|
the x and y position of the sprite's center on the screen.
|
|
x is 0 at the left, 1 at the right; y is 0 at the top, 1 at the bottom.
|
|
r,g,b
|
|
the red, green, and blue color brightness of the sprite. 0..1.
|
|
a
|
|
the opacity (alpha) of the sprite. 0=transparent, 1=opaque.
|
|
note that the effect of this variable depends on the blendmode
|
|
(see below), and that sometimes, due to the blendmode, the value
|
|
of 'a' has no effect.
|
|
sx, sy
|
|
the size (stretching) of the sprite, in the X and Y directions.
|
|
if these are both 1, then the image will be scaled up just large
|
|
enough so that no part of it goes off the screen. If these are
|
|
both 0.5, the image will be half that size; 2, and it's doubled.
|
|
If sx and sy are not equal, the image will be stretched
|
|
appropriately.
|
|
rot
|
|
the angle of rotation, in radians, of the sprite. The unit circle
|
|
goes from 0 to PI*2 (6.28) radians. At zero radians there is no
|
|
rotation; PI/2 is like a 90-degree counter-clockwise rotation;
|
|
PI, 180 degrees; PI*3/2, 270 degrees; and PI*2 radians (the same
|
|
as zero radians): 0 degrees.
|
|
blendmode
|
|
determines the manner in which the sprite image is blended onto
|
|
the screen.
|
|
0=blend: the image is multiplied by (r,g,b) and then blended,
|
|
where 'a' decides the amount to blend.
|
|
1=decal: the image is multiplied by (r*a,g*a,b*a) and then pasted
|
|
onto the background, with no transparency. 'a' values
|
|
below 1 will modulate the color of the sprite, making
|
|
it darker.
|
|
2=additive: the image is multipled by (r*a,g*a,b*a) and then added
|
|
onto the background, making it brighter. Again, 'a' values
|
|
below 1 will make the sprite darker.
|
|
3=srccolor: the amount to blend each pixel with the background
|
|
is equal to the inverse of the pixel's color. White texels
|
|
in the sprite will be fully drawn, while black texels will
|
|
be transparent; in-between texels will be blended partially
|
|
based on their brightness. Requires hardware support.
|
|
The alpha value ('a') has no effect when this blendmode
|
|
is set; the alpha value is taken from the R,G,B color in
|
|
the image at evert point.
|
|
4=colorkey:
|
|
pixels that match the color specified in the colorkey are
|
|
drawn transparently, and all other pixels are drawn opaquely,
|
|
much like a television bluescreen. When using this blendmode,
|
|
a line like the following is required to be present in the
|
|
sprite:
|
|
colorkey=0x000000
|
|
where the value is some 24-bit hexadecimal color. The first
|
|
two digits are 00 through FF hexadecimal (0-255 decimal)
|
|
and are the red value; the third and fourth digits are the
|
|
green value; and the last two digits are the blue value.
|
|
So, 0x000000 makes black the see-through color; 0xFFFFFF
|
|
makes white pixels transparent; 0x0000FF makes blue pixels
|
|
transparent; and so on.
|
|
|
|
When the blendmode is not 4, the colorkey setting will have
|
|
no effect.
|
|
|
|
When blendmode is 4, the alpha value ('a') still works, too;
|
|
it simply modulates the overall opacity of the sprite.
|
|
|
|
NOTE that this effect does not work on all video cards, and
|
|
also tends to hiccup when running in 16-bit color. Try it
|
|
in 32-bit color for best chances for it to work.
|
|
|
|
NOTE that prior to MilkDrop v1.04, this feature worked
|
|
slightly differently; there was a range of color key values
|
|
(and you specified 'colorkey_lo' and 'colorkey_hi')
|
|
instead of just one single colorkey value ('colorkey').
|
|
My apologies for any confusion this change might cause.
|
|
flipx
|
|
if nonzero, the sprite will be flipped horizontally.
|
|
flipy
|
|
if nonzero, the sprite will be flipped vertically.
|
|
repeatx
|
|
the number of times to repeat the texture over the surface of the
|
|
sprite, in the x direction. A value of 1 is the default; a value of
|
|
2 will cause the texture to tile twice in the x direction; and so on.
|
|
|
|
**NOTE that if the width or height of the source image is not a
|
|
power of two (16,32,64,128,256,512,1024,2048) then repeating the
|
|
image could cause strange bands to appear (on some poorly-written
|
|
display drivers or older video cards). If using repeating, pre-
|
|
stretch the source image to be a power of 2 to alleviate this
|
|
problem.**
|
|
repeaty
|
|
like repeatx, but in the y-direction.
|
|
done
|
|
set this to some nonzero value to make the sprite self-terminate.
|
|
frees up resources associated with the sprite.
|
|
burn
|
|
if set to a nonzero value, then the sprite will burn into MilkDrop's
|
|
background and become part of the animation. If set to zero, there
|
|
will be no burn-in. You can set this to 1 for a long time to make
|
|
cool trails of the sprite, or you can set it to 1 just on the last frame
|
|
(at the same time that you set 'done' to 1), to make the sprite burn into
|
|
the background and die off, much like song titles and custom messages do.
|
|
( NOTE: prior to v1.04, 'burn' only worked on the last frame, when done
|
|
was set to 1. With v1.04 and later, 'burn' works on any frame. )
|
|
|
|
|
|
|
|
/end of critical info
|
|
|
|
|
|
*/
|
|
|
|
[img00]
|
|
// testing color keying... not working well on GF2MX!
|
|
img=c:\z\nova.jpg
|
|
colorkey=0x000000
|
|
init_1=blendmode = 4;
|
|
code_1=rot = time*0.27;
|
|
code_2=new_scale = 0.75 + 0.1*sin(time*0.6);
|
|
code_3=sx = new_scale;
|
|
code_4=sy = new_scale;
|
|
code_5=r=0.5+sin(time*0.9);
|
|
code_6=a=0.5+sin(time*1.3);
|
|
|
|
[img01]
|
|
// this tests the 'done' function, and burns into the screen @ the end
|
|
img=c:\z\osapien.jpg
|
|
init_1=blendmode = 3;
|
|
init_2=x = 1;
|
|
init_3=orig_y = 0.5;
|
|
code_1=time_to_reset = below(x,-0.5);
|
|
code_2=x = x*(1-time_to_reset) + time_to_reset*(1.5 + 0.01*rand(100) + 1);
|
|
code_3=orig_y = orig_y*(1-time_to_reset) + time_to_reset*(0.3 + 0.4*0.01*rand(100));
|
|
code_4=sx = sx*(1-time_to_reset) + time_to_reset*(0.25 + 0.4*0.01*rand(100));
|
|
code_5=sy = sx;
|
|
code_6=x = x - 0.008 + 0.0033*sin(time*1.371);
|
|
code_7=y = orig_y + 0.12*sin(time*1.9);
|
|
code_8=done=above(frame,80);
|
|
code_9=burn=done; // burn into screen @ end
|
|
|
|
[img02]
|
|
// this burns into the screen *every frame*
|
|
img=c:\z\osapien.jpg
|
|
init_1=blendmode = 3;
|
|
init_2=x = 1;
|
|
init_3=orig_y = 0.5;
|
|
code_1=time_to_reset = below(x,-0.5);
|
|
code_2=x = x*(1-time_to_reset) + time_to_reset*(1.5 + 0.01*rand(100) + 1);
|
|
code_3=orig_y = orig_y*(1-time_to_reset) + time_to_reset*(0.3 + 0.4*0.01*rand(100));
|
|
code_4=sx = sx*(1-time_to_reset) + time_to_reset*(0.25 + 0.4*0.01*rand(100));
|
|
code_5=sy = sx;
|
|
code_6=x = x - 0.008 + 0.0033*sin(time*1.371);
|
|
code_7=y = orig_y + 0.12*sin(time*1.9);
|
|
code_8=done=above(frame,80);
|
|
code_9=burn=1; // burn into screen every frame
|
|
|
|
[img03]
|
|
// for testing: show a large (nova2) or large+skinny (nova3) texture
|
|
img=c:\z\nova3.jpg
|
|
init_1=blendmode = 2;
|
|
code_1=rot = time*0.27;
|
|
code_2=new_scale = 1.0 + 0.1*sin(time*0.6);
|
|
code_3=sx = new_scale;
|
|
code_4=sy = new_scale;
|
|
code_5=new_alpha = min(0.9,max(0.2, 2*max(bass-.05,bass_att)-1.1 ));
|
|
code_6=a = a*0.83 + 0.17*new_alpha;
|
|
|
|
[img04]
|
|
desc="cool: an 'osapien' drifts across the screen every so often."
|
|
img=c:\z\osapien.jpg
|
|
init_1=blendmode = 3;
|
|
init_2=x = -100;
|
|
init_3=orig_y = 0.5;
|
|
code_1=time_to_reset = below(x,-0.5);
|
|
code_2=x = x*(1-time_to_reset) + time_to_reset*(1.5 + 0.01*rand(100) + 3);
|
|
code_3=orig_y = orig_y*(1-time_to_reset) + time_to_reset*(0.3 + 0.4*0.01*rand(100));
|
|
code_4=sx = sx*(1-time_to_reset) + time_to_reset*(0.25 + 0.4*0.01*rand(100));
|
|
code_5=sy = sx;
|
|
code_6=x = x - 0.008 + 0.0033*sin(time*1.371);
|
|
code_7=y = orig_y + 0.12*sin(time*1.9);
|
|
|
|
[img10]
|
|
img=c:\z\nova.jpg
|
|
init_1=blendmode = 2;
|
|
code_1=rot = time*0.27;
|
|
code_2=new_scale = 2.0 + 0.2*sin(time*0.6);
|
|
code_3=sx = new_scale;
|
|
code_4=sy = new_scale;
|
|
code_5=new_alpha = min(0.9,max(0.2, 2*max(bass-.05,bass_att)-1.1 ));
|
|
code_6=a = a*0.83 + 0.17*new_alpha;
|
|
|
|
[img11]
|
|
img=c:\z\baily2.jpg
|
|
init_1=blendmode = 2;
|
|
code_1=rot = -time*0.2;
|
|
code_2=new_scale = 2.0 + 0.2*sin(time*0.6);
|
|
code_3=sx = new_scale;
|
|
code_4=sy = new_scale;
|
|
code_5=new_alpha = .4*min(0.9,max(0.2, 2*max(treb-.05,treb_att)-1.1 ));
|
|
code_6=a = a*0.83 + 0.17*new_alpha;
|