|
|
|
|
#1 |
|
Forum King
|
AVS Primer - now hiring.
As some of you may now, I'm working on an update for AVS Primer. This time I want everything documented. However, I don't know exactly how everything works, so I need your help. This is the list of things I'm still missing. I've marked important updates with an asterisk.
TRANS -Brightness --What exactly happens with the 50/50 blend bug (not important, but it'd probably be useful) -Bump --Exactly what is blended into what with the render blend modes - "replace" doesn't replace the picture with the bumped image, etc. *Colorfade --An exact description of what those bars actually do --What do "On-beat change" and "on-beat randomize" actually do? (in reality, somehow they screw up the colorfading) *Grain --What does the slidebar do --Am I correct in assuming it multiplies each pixel's raw RGB values by a random number from 0..1? -Interferences --Same with Bump (what do the blend modes do?) --What the bug with Additive blend is all about -Mirror --Why "smooth transitions" have the strange effect of darkening the image quite a bit -Mosaic --Whether the color of each cell is calculated by a) the center pixel; or b) the average of every pixel covered by the cell (probably a, since b would be rather slow) -Scatter --What's the bug with the top and bottom rows? *Unique Tone --The exact process involved here *Water bump --"What the fork?" --Is it just me, or does this seem to gravitate towards +x+y (bottom right)? RENDER -Dot fountain --What're all the cyan, brown, green, and blue particles at the bottom all aboot? -Moving Particle --How do they move -Simple --What bands are drawn for the spectrum analyzer? -Text --Any way to fix that additive blend bug... -Superscope --The limit on the number of variables MISC -Custom BPM --What the First Skip slidebar does --When the first beat is registered in skip mode OTHER -What does the Buffer Blend mode do? -TRUE proofs (i.e. you can prove it without making assumptions) of rotation matrices and 3D-2D (and 4D-3D for that matter) translation. Thanks in advance, guys!
"guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings |
|
|
|
|
|
#2 |
|
Forum King
Join Date: Dec 2002
Location: Manchester
Posts: 6,470
|
the mosaic colour is almost definately calculated by the center pixel because when you render something with just a thin line like a timescope or superscope or something when you put in a mosaic the colours show up and since there just lines its probably impossible to get more in a line than whats around it.
|
|
|
|
|
|
#3 |
|
Major Dude
|
Here is goes...
Bump : "Replace" mostly adds in the new bumped texture as masked, and the whole picture is re-included - Which is why additive mode acts like a fast brite. 50/50 seem to just reduce the bumpedness. Colorfade : I don't know for sure, but first bar is hue, 2nd is sat, 3rd is lum - I believe they control how fast they increase/decrease, but I also believe it's more like percentage of the original image. OnBeat Change is crappy, you can't control how long it lasts. Randomize randomizes. Grain : It multiplies each pixel's colors by either 0 or 1. If static, the calculation only done once and saved for the rest of the time. The slidebar controls the probability of each outcome, I think. Interferences : Replace - Replace. I believe the color of each sheet of the screen is controled by the n, then the sheets are added together. Additive - Just a little bug that makes the area of addition constricted to the top of the screen (Or was it border?) 50/50 - Same as replace, Just with the typical fx-list 50/50 output. Unique Tone : For replace, it's max channel. For others, apply the fram from replace. Water Bump : Never *really* experimented with it, but I think it's somewhat nice. I think it simulates height of water (From waves) when you have some disturbances in it... What's next, I do NOT know. Dot fountain : Some pattern of colors Nullsoft (Or Justin) thinks nice. You got to admit though, it's a rather nice starting color set. Moving Particle : It chooses some center point and revolves around it (With some deformations to it - It's almost never a circle, but ellipse almost all the time). Speed and distance from chosen center gets lower over time. The distance from chosen center and distance from chosen center to true center is determined by the "Distance From Center" bar. Text : Same way as to fix the replace problem : Don't use any 0/0/0 color (Or and 0 in that matter) - Use any number bigger than that. 1-5 is transparent, BTW. On the other hand, this problem disappeared after I installed winamp into my 2nd HD (Don't ask)... Maybe it's that 192 mb memory... Nah... Superscope : 32 or 64... Total. Subtract the preset variables for custom. Custom BPM : First skip? The amount of beats to skip at the beginning. Buggy as hell. First beat is registered after you skip n beats (Look at the bar for n). So if you want every 5 beats, set the skip to 4. --- I think that's all (I know). [soon to leave, sirs] |
|
|
|
|
|
#4 |
|
Forum King
|
I'm pretty sure that grain multiplies by decimals too, because using a white object, it will turn some pixels grey and they will eventually fade away. And moving particle is somewhat music responsive, although I don't know exactly how.
|
|
|
|
|
|
#5 | |||||||
|
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
Some answers I know off the top of my head:
Quote:
- original pixel color + if (source pixel != 0) { diffuse light value relative to light position } The image is treated as a height-map, where brightness = height. The bump effect calculates the normals and calculates the diffuse lighting coefficient at each pixel (actual algor. is very simple). As indicated above, the original color value is added. This explains the blend-modes: - blend 50/50: original pixel * 50% + output pixel * 50% = original value * 50% + (original value + diffuse) * 50%) = original value + diffuse * 50% Additive: original pixel + output pixel = original value + (original value + diffuse) = 2*original value + diffuse This performs a bump, but uses the x2 color for the output result. Note that diffuse is based on the x1 color! Quote:
Quote:
The smooth-transitions option performs an alpha-blend between the two mirror states. When performing an alpha blend, there are two situations for colors between color A and B: - A and B are similar colors: e.g. (255,128,0) - (255,64,128) let's consider the 50% blend value: (255,96,64). This brightness of this color is not much lower than A or B. - A and B are very different colors: e.g. (255,0,0) and (0,0,255). the 50% blend value is (128,0,128), which is much darker dan either A and B due to the logarithmic nature of light-intensity (non-linear perception of brightness). Because most pixels will be very different (second situation), the part that is being blended will look darker in its 50% phase. Quote:
When you have a pixel (x,y) and request the pixel at offset (x+a,y+b), you have to make sure the resulting pixel is inside the picture (x >= 0, y >=0 ) and ( x < width, y < height ). The scatter effect seems to have a maximal (x,y) distance between the scattered pixel and the original pixel (let's call this distance 'd'). Because of lazyness, the scatter effect ignores the top and bottom 'd' rows. Quote:
The mapping from (R,G,B) to (G) = max(R,G,B) / 255. e.g. color (255,0,0) -> 1.0, color (64,128,64) -> 0.5, color (64,64,64) -> 0.25 => Unique tone is the same as a colormap with key 'maximal channel', output 'replace' and a single colorpoint (no gradient). Quote:
input 1 (140,150,160), input 2 (255,0,0), buffer pixel (100,200,50) buffer: max(100,200,50)/255 = 200/255 ~~ 0.8 so output = (140,150,160) * (1 - 0.8) + (255,0,0) * 0.8 = (232, 30, 32) Quote:
As for rotation matrices, here's the idea for one axis, do this for all three in sequence and you get a rotation matrix: Rotation of point p(x,y,z) around axis Z. (1) Co-planarity: We know the Z coordinate will stay constant by rotation around the Z-axis, because the shortest vector connecting the axis and the point has a zero Z-component = p..z(x,y,0) (2) We now transform into the plane parallel with the x,y plane: z = p(z) (because the z-coord is not affected by rotation here) We can express the point (x,y) in polar coordinates as (d,r): x = cos(r)*d; y = sin(r)*d; Rotating this point means increasing or decreasing the polar angle 'r'. We know the following formulas are true (proofs to long to type here): cos(a+b) = cos(a)*cos(b) - sin(a)*sin(b) sin(a+b) = sin(a)*cos(b) + cos(a)*sin(b) So if we rotate a point over angle r', we get: x' = cos(r+r')*d; y' = sin(r+r')*d; Using the formulas above, you get exactly the coefficients in the rotation matrix for rotation around the z-axis (remember that matrix-notation is just a handy way of writing linear operations on a set of variables). The rotated 3D point p'(x',y',z) can now be rotated around the Y-axis (y'=constant) into: p''(x'',y',z'') And the x-axis (x''=constant), to give: p'''(x'',y''',z'''). |
|||||||
|
|
|
|
|
#6 |
|
Forum King
|
Unconed, I think you have the source code to AVS.
You know way too much about what is actually happening. Very good job of explaining x,y,z rotation. Atero, when you write the primer make sure you put the conversion of 3-D polar coordinates -> 3-D cartesian coordinates right after this. This primer is going to be a really useful reference.
|
|
|
|
|
|
#7 | |
|
Forum King
|
Quote:
If anyone cares I could hash up a diagram in paint or something. |
|
|
|
|
|
|
#8 |
|
Forum King
|
Nic, I was looking for more specifics; I know what everything does, but I want to know how everything works (read: I want to be god, god dammit.) Thanx anyway, tho.
UnConeD, thank you for the info, you shall inherit the earth, and maybe mars, if you're lucky. Jheriko, show us your mad mspaint skillz0rz...especially since I can't understand any of that
"guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings |
|
|
|
|
|
#9 | |
|
Forum King
|
Quote:
Unconed should get the earth, mars, and saturn, after all he did make them.
|
|
|
|
|
|
|
#10 |
|
Forum King
|
I skanked it up in psp instead since mspaint is even crappier than i thought and can not save to .jpg
The only thing on the picture that may not be immediately clear (to those who know their trig anyway) is why the second angle i labeled 'a' is equal to a, the reason is because the angle which is opposite a and the right angle of the smallest triangle nearest the top of the second diagram (with the red line and blue line for two of its sides) and the angle which is on the opposite side of its vertex are equal. You can then use the 'sum of triangles angles = 180 deg' rule to deduce that the angle must be a. |
|
|
|
|
|
#11 |
|
Forum King
|
that's not only the ugliest-ass picture i've ever seen ("wink"), it's completely vague, in the most vicious sense. mind explaining any of that, jherry?
"guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings |
|
|
|
|
|
#12 |
|
Forum King
|
I feel disappointed in you Atero. Here is your explanation.
sin x = (length of side opposite angle)/(length of hypotenuse) cos x = (length of side sharing angle with hypotenuse)/(length of hypotenuse) i.e. the basic trig rules for a right angled triangle. If you look at the diagram you will see that all that I have done is used these rules to work out the lengths of all of the lines which you need to find the two lengths which are equal to cos(a+b) and sin(a+b) - the blue and red lines. |
|
|
|
|
|
#13 |
|
Forum King
|
"Boy, do I feel STUPID!!!"
I have no idea what the process you're taking is...basically you're telling me to look at a diagram used in a proof and try to find out what that proof is, based on the diagram. "guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings |
|
|
|
|
|
#14 |
|
Forum King
|
I don't understand the diagram either jheriko. It would help some if all of your 90 degree angles were actually 90 degrees.
|
|
|
|
|
|
#15 |
|
Major Dude
Join Date: Jan 2003
Location: Estonia.
Posts: 851
|
Hey, U dont have to be SO DEAM accurate. Man made his point clear and this is all we need, u dont need to see the exact 90 degree angles...
Phi = (1+sqrt(5))/2 |
|
|
|
|
|
#16 |
|
Senior Member
Join Date: Jul 2002
Posts: 149
|
I found Jherikos diagram clear but for anyone who didnt here is another proof:
Let t and s be some numbers. Draw a circle whith r=1 and the centar in point S(0,0). Now on the circle mark these points: A=E(0) A(0,1) B=E(t+s) B(cos(t+s),sin(t+s)) Its obvios(just look at the picture) that part of the circle between A and B has lenght of t+s. Now mark points: C=E(-s) C(cos(-s),sin(-s)) => C(cos(s),-sin(s)) D=E(t) D(cos(t),sin(t)) Part of the circle between C and D has also the lenght of t+s. Now draw two lines one connecting A and B and one C and D. Since the parts of the circles connecting them are the same lines will also be the same. |AB|=|CD| You can see that(from the pitagoras rule or something, I dont know whats the correct term in english): |AB|^2=(cos(t+s)-1)^2+(sin(t+s))^2 =2-2cos(t+s) and |CD|^2=(cos(t)-cos(s))^2+(sin(t)+sin(s))^2 =2-2cos(t)cos(s)+2sin(t)sin(s) Now becouse |AB|^2=|CD|^2 we get: 2-2cos(t+s)=2-2cos(t)cos(s)+2sin(t)sin(s) And this means that cos(t+s)=cos(t)cos(s)-sin(t)sin(s) You can proof it the similar way for the sine if you want. |
|
|
|
|
|
#17 |
|
Forum King
|
once again...that made no sense (to me anyway)
"guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings |
|
|
|
|
|
#18 |
|
Senior Member
Join Date: Jul 2002
Posts: 149
|
Here is a picture.
You can see that |AB|^2=(cos(t+s)-1)^2+(sin(t+s))^2 and |CD|^2=(cos(t)-cos(s))^2+(sin(t)+sin(s))^2 are true from the definition of sine and cosine. sin(t+s) is the distance from point B to the x acces becouse the angle between B and x acces is t+s |
|
|
|
|
|
#19 | ||
|
Forum King
|
Quote:
Quote:
The process is called geometric proof. The diagram isn't simply used in the proof it *IS* the proof. I'll explain the where all of the lengths on the diagram come from and why they need to be determined, this should help you understand why the diagram is a proof. (It would help if you read this with the diagram handy) To start with you take the two triangles drawn and the only known length is the unit length of the exposed hypotenuse. We will lable the two topmost angles a and b. By using simple trig you can now see that the sides of the triangle with hypotenuse 1 are sin(b) and cos(b) respectively, this makes the hypotenuse of the second triangle cos(b). So the two other sides of the second triangle are going to be sin(a)cos(b) and cos(a)cos(b). If you now look at the second diagram you will see that a third triangle has been 'overlayed' onto the first two. This triangle shares the hypotenuse of length one and contains the angle a+b, by looking at the diagram and comparing this triangle to the very first one we looked at (if required) you can see that its two sides (the red and blue lines) are going to equal cos(a+b) and sin(a+b). The length sin(a)cos(b) is shorter than the length sin(a+b) and we can see that the difference between them is equal to the length of the side, parallel to the length sin(a+b), of a fourth triangle which I have also marked on the second diagram. This triangle has an angle of a labeled inside it. This can be verified by using two rules as I explained earlier in this thread. Since we know the hypotenuse length of this triangle is sin b and one of its internal angles is a then the other two sides have lengths sin(a)sin(b) and cos(a)sin(b) respectively. The length we need is the cos(a)sin(b) (because it is the side parallel to the sin(a+b) and sin(a)cos(b)). Looking at the diagram and understanding where all of the lengths come from, you should now be able to clearly see that the line of length sin(a+b) has equivalent length to the sum of the lengths of the two lines with lengths sin(a)cos(b) and cos(a)sin(b), i.e. sin(a+b)=sin(a)cos(b)+cos(a)sin(b) You can do a similar thing using the other side of the small triangle, length sin(a)sin(b), and by subtracting it from the length of the side of the second big triangle (with hypotenuse cos(b)), which has length cos(a)cos(b), you can see by the diagram this difference equals cos(a+b). NOTE: They don't teach geometric proofs, or geometry infact, very much in schools which may be why some of you don't understand it. Geometric proofs are often much easier than algebraic proofs for geometry related problems when you know about them. When dealing with trigonometry this is especially true because it is very difficult to represent sin x or cos x algebraically, (it will involve infinite series or powers of e... which are also infinite series), where as it is very easy to define them geometrically as the two sides of a right angled triangle with hypotenuse length 1. Hopefully thats cleared it all up. |
||
|
|
|
|
|
#20 |
|
Forum King
|
Jheriko, that second quote isn't mine it's atero's.
|
|
|
|
|
|
#21 | ||||
|
Forum King
|
Quote:
![]() Quote:
Quote:
Since this is where your proof falls apart, I'm going to leave it for now until you stop expecting me to know what number you're thinking... Quote:
"guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings |
||||
|
|
|
|
|
#22 | |||
|
Forum King
|
Quote:
Quote:
Quote:
|
|||
|
|
|
|
|
#23 |
|
Senior Member
Join Date: Nov 2002
Location: Australia
Posts: 190
|
Hey I got a question I think might be funda-mental. When looking through code i see two lots of the same variable used ie
x=..... x=..... or the simmilar, I was wondering how this actually comes into play? Does it do both or chose one over the other, (especially in SSC's) if it does both please explain technicaly. Unconed you might know this one I've seen it in your code. Mabey if a sufficent explanation is forthcomming you could use it atero |
|
|
|
|
|
#24 |
|
Forum King
|
either this is the wrong thread, or you're being a total idiot, visag.
now then...no, you weren't clear before, jheriko. in fact that was one of the most vague proofs i've ever seen. ten to one you give that to your teacher and he laughs. and please explain how the upper-right angle in the smallest ("fourth", which, in and of itself, is a bad term) triangle is equal to the angle A? btw, an algebraic proof of sin(x)^2+cos(x)^2=1 is easy enough that you don't need a geometric proof: o^2/h^2+a^2/h^2=1 (o^2+a^2)/h^2=1 o^2+a^2=h^2 (pythagorean theorem) "guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings |
|
|
|
|
|
#25 |
|
Senior Member
Join Date: Jul 2002
Posts: 149
|
Jheriko I just went over yore proof again(and mine) and they bouth show that
cos(a+b)=cos(a)*cos(b)-sin(a)*sin(b) sin(a+b)=sin(a)*cos(b)+cos(a)*sin(b) are true only for a+b<pi becouse you cant have a triangle whith a bigger angle. |
|
|
|
|
|
#26 |
|
Forum King
|
visag, what preset has a ssc that sets x twice?
|
|
|
|
|
|
#27 | ||
|
Forum King
|
Quote:
Quote:
|
||
|
|
|
|
|
#28 |
|
Forum King
Join Date: Dec 2002
Location: Manchester
Posts: 6,470
|
UnConeD - WaterCube
first superscope Init: n=0;md=0; On Beat: x=rand(7);md=if(x,md,rand(4));mv3=if(x,mv3,rand(5)+3); Per Frame: t=t-0.05;n=getspec(0,.1,0)*50;kp=if(n,0,1);n=if(kp,10,n);iw=2/w;ih=2/h;mv2=-.5+getspec(0,.1,0);x=0;y=0; Per Point: pc=bor(equal(md,0),equal(md,3)); x=if(pc,sin(getosc(i*.5,0,0)*2*3.1415)+if(kp,(rand(3)-1)*.2,0),0); y=if(pc,sin(getosc(i*.5+.5,0,0)*2*3.1415)+if(kp,(rand(3)-1)*.2,0),0); pc=equal(md,1); x=if(pc,cos(i*6.28)*mv2,x); y=if(pc,sin(i*6.28)*mv2,y); pc=equal(md,2); mv3_=(i*mv3)%(mv3+1)/mv3;m3_=rand(10)*.1; x=if(pc,cos(mv3_*6.28)*m3_,x); y=if(pc,sin(mv3_*6.28)*m3_,y); pc=equal(md,3); x=if(pc,i*2-1,x); y=if(pc,getosc(i,0,0)*.5,y);
|
|
|
|
|
|
#29 |
|
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
A statement like
x = if(something,value,x) means, if 'something' is true, set x to 'value', otherwise keep its current value. That explains the multiple x's. In that watercube scope example, the scope can choose between a couple of different dot patterns which is each defined separately. However you should know that most of my complicated scopes use the built-in vars (x,y,red,green,blue,...) as temporary variables (due to the limit on the amount of vars allowed), so you'll have to pay attention whether it's an actual 'x' being calculated, or just a temporary variable that'll get overwritten no matter what later on. |
|
|
|
|
|
#30 |
|
Forum King
|
oh, okay, i see that now - i thought you were talking about a different triangle (once again, you didn't specify explicitly).
thanx to both of you ![]() btw raz, i want your sig
"guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings |
|
|
|
|
|
#31 |
|
Forum King
Join Date: Dec 2002
Location: Manchester
Posts: 6,470
|
ahh, i see now, ill have to make some crappy messy superscopes to find out what i can do with it now.
![]() heh, the sig text is mine, ALL MINE HAHAHAHAHAAAAAA...
|
|
|
|
|
|
#32 |
|
Wildly Confused
(Major Dude) Join Date: Jan 2003
Location: Minnesota
Posts: 1,204
|
Hey I figured out what a sigmoid is!
A sigmoid is a S-shaped part of the colon! Sorry it's not in math terms, I just thought it was interesting
"It's like saying give a man a Les Paul guitar and he becomes Eric Clapton, and of course that's not true, give a man an amplifier and a synthesizer and he doesn't become...whoever; he doesn't become us." - Roger Waters |
|
|
|
|
|
#33 |
|
Forum King
|
Seriously... what the hell does that sigmoid function do??? Is it meant to be a summation or something?
|
|
|
|
|
|
#34 |
|
Forum King
|
It's a function used to create values that are all in the range of -1 to 1, i don't really know how its done, but it's graph looks like an S with points (-infinity,-1),(0,0),(infinity,1). I haven't had much use for it except for messing with the default DDM stuff.
|
|
|
|
|
|
#35 |
|
Senior Member
Join Date: Jul 2002
Posts: 149
|
Sigmoid(x,y) is a fast way to calculate 1/(1+exp(-x*y)).
I have no idea why would anyone want to do that or how can it be used in avs. |
|
|
|
|
|
#36 | |
|
Senior Member
|
Quote:
|
|
|
|
|
|
|
#37 |
|
Major Dude
Join Date: Apr 2002
Location: Ballarat, Australia
Posts: 529
|
The sigmoid in AVS maps (0,1) to (-infinity,infinity), such that f(.5) = 0.
Although I would have made a function that maps 0=0, and -1 to -infinity, I'm also a person who created a system of working with undefined values .
|
|
|
|
|
|
#38 |
|
Forum King
|
SIGMOID can be used for extra-smooth on-beat transitions.
But how the fuck did it get it's name...?! "guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings |
|
|
|
|
|
#40 |
|
Forum King
|
Thanks, Anubis. I just kept thinking of the sigmoid colon and...it kinda freaked me out
"guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|