- AVS
- New Ape required
Archive: New Ape required
G_JDean
7th May 2004 03:50 UTC
New Ape required
Often i stoped by problem that my avs-files too large, cause in syperscope's set's i need write full algorithm for each superscope(part of scene). It happens then i make scenes with DCE(Din. Camera Effect) or atomic motion model's or other presets that need more than 10 sinchronized siperscopes.
How about make Superscope_data.ape or Superscope_res.ape includin common parameters for all Sscopes in preset.
I think it can look like this
Render(or Misk)/Sscope_data
resInit:
r=1;rd=5;mx=0;my=0;mz=2;phi=2;rphi=3.14;rmz=2;dpt=2;p=3.14159265;p2=2.0*p;p3=180/p;u=h/w;rr=0.1;rg=0.1;rb=0.1;rdt=0.1
resFrame:
t=t-dt;dt=dt+(rdt-dt)/30;
phi=phi+(rphi-phi)/10;
psi=psi+(rpsi-psi)/10;
mz=mz+(rmz-mz)/10
resBeat:
rphi=rphi+asin(cos(t*sqrt(15)));
rpsi=acos(sin(t*sqrt(2)*6))/3;
rmz=acos(cos(t*9))+1;rdt=0.1/(2-sin(t));
rr=sqr(sin(t*sqrt(5)))*0.9;rg=sqr(sin(t*sqrt(6)))*0.9;rb=sqr(sin(t*sqrt(7)))*0.9;
resPoint:
x2=x1*cos(phi)-z1*sin(phi);z2=x1*sin(phi)+z1*cos(phi);y2=y1*cos(psi)-z2*sin(psi);z3=y1*sin(psi)+z2*cos(psi);x4=x2+mx;y4=y2+my;z4=max(0.1,z3/dpt+1+mz);x=u*x4/z4;y=y4/z4;l=pow(0.5,z3);red=rr*l;green=rg*l;blue=rb*l;
[base1[<]] (base's for 1 to 8, like buffer)
render/superscope
init: car_body;resinit1;n=2500;
frame: resframe1;
beat: resbeat1;
point:i=sqrt(i);z1=(cos(i*n/5)*sin(i*1.75)*1.25)*r;x1=(sin(i*n/5)*sin(i*1.5));x1=(x1*0.7-pow(x1,3)/4)*r;d1=sqr(z1/1.25+0.25)+sqr(sqr(x1*2));d2=sqr(abs(z1/1.25)-0.6)+sqr(abs(x1*1.5)-0.7);cbn=if(below(d1,0.35),(0.35-d1)/1.5,0);
slt=if(below(d2,0.1),(0.1-d2),0);y1=(0.45+pow(i,2)/2-cbn-slt*2)/1.2*r;respoint1;
render/superscope
init: road;n=1000;resinit1;
frame: resframe1;
beat: resbeat1;
point: z1=(atan(tan(i*p))/p*20)*r;
x1=(sin(i*(n-1)*p+p/2))*r;
y1=(1)*r;respoint1;
if Sscopes in preset more than 10 *.avs file size could be very small than avs without Sscope_data.ape.:hang:
Tuggummi
7th May 2004 06:08 UTC
Is that all the code in your superscope? :igor: Because if it is then i guess you are using the old avs version, nowadays we have unlimited local vars and 99 global vars which i think are more than enough. Also we have megabuffers, loops, exec's and whatnot, i don't even know half of it! :p
If you still have the old avs version you really should download wa5. You can just choose not to install things like modern skins, mediacenter, videosupport or such if you want to have a authentic wa2 feel.
TomyLobo
7th May 2004 09:04 UTC
yeah and wa5 takes only a few kb more than wa2 in memory if you don't use modern skins :)
but your idea is basically a good thing. sub-procedure in AVS would be great :) sadly, this can't be achieved by an APE, because an APE can't change the evallib (that's the thing that evaluates and executes the code you write) which would be necessary. Only Nullsoft can do this atm because they have the source :)
sidd
10th May 2004 15:27 UTC
also, with the latest version of avs you definatly can do what you are talking about:
*do all your calculations in an n=0 superscope.
*store all the neccesary output (like rotation values that will be used by more than one scope) in either the global registers (reg00 to reg99) or the dynamic global buffer with assign(gmegabuf[xx],value).
That way, you can caluculate all common stuff first, without taking up much fps.
TomyLobo
12th May 2004 13:27 UTC
but with sub-procedure you could do other things, like this one:
Frame:
rx=something;
ry=some_other_thing;
rz=yet_another_thing;
Point:
ix=something;
iy=something;
iz=something;
rotate(ix,iy,iz,rx,ry,rz);
...
where rotate would be a sub-procedure which would rotate the coords and write them back to i*
Jaak
12th May 2004 15:44 UTC
what TL is talking about could be really useful, but hard to add to avs tho'
(if we only had the bloody source :()
Warrior of the Light
13th May 2004 15:45 UTC
We will never have the source indeed, that's for sure...
Everybody would like to make adjustments to it, so there would be 20 versions in the first week only i'm afraid.
But what we're talking about an entirely different language, this would mean AVS 3.00 (or perhaps 4.00 since I don't really have good memories about Nullsoft and version 3 ;) )
it would be a great idea though... [dreams away]:rolleyes:
jheriko
14th May 2004 05:13 UTC
What we really need is a 3rd party avs editor, then we can just use text replacing to do subs and some more complex text replacement to do proper functions.
Another little tip to optimise that ghastly code up there is to dump all of the static per point stuff to gmegabuf:
i=sqrt(i);z1=(cos(i*n/5)*sin(i*1.75)*1.25)*r;x1=(sin(i*n/5)*sin(i*1.5));x1=(x1*0.7-pow(x1,3)/4)*r;d1=sqr(z1/1.25+0.25)+sqr(sqr(x1*2));d2=sqr(abs(z1/1.25)-0.6)+sqr(abs(x1*1.5)-0.7);cbn=if(below(d1,0.35),(0.35-d1)/1.5,0);
slt=if(below(d2,0.1),(0.1-d2),0);y1=(0.45+pow(i,2)/2-cbn-slt*2)/1.2*r
is being calculated every point every frame, why not calculate it once for each value i can take and dump x1,y1,z1 etc.. to megabuf? If each point always has the same colour you can dump your colors in the megabuf too.
This way your per point code ends up mostly as assigns(=).
Jaak
14th May 2004 05:35 UTC
But what we're talking about an entirely different language, this would mean AVS 3.00 (or perhaps 4.00 since I don't really have good memories about Nullsoft and version 3 )
Justing is gone, so dont hope for ANY avs updates
We will never have the source indeed, that's for sure...
Im sure this would happen more likely than new avs version, we just need a person (ok, lots of them) to ask nullsoft really nicely... or not... :(
what we really need is new fucking vis that is VERY similar to avs!!
Tuggummi
14th May 2004 07:15 UTC
If jaak, jheriko, jhackelshafar, ;-C, tomylobo, sidd, nic01, unconed and so on would be involved in making a new avs-like plugin or modifying the source, then i can definetly say goodbye to avs. Why i wouldn't understand a thing! You make things so overly complicated :hang:
But im just speculating :rolleyes: :p
Jaak
14th May 2004 09:46 UTC
tugg you evil constervative bastard, go back in your hole and don't come out again!
:p
Warrior of the Light
14th May 2004 11:44 UTC
I really don't mind creating stuff in fact I'd love to, but all I know right now is some Pascal.
Visual C and/or Visual Basic are on the schedule for the next schoolyear.
[edit] I hate these stretched forums[/edit]
Tuggummi
14th May 2004 16:00 UTC
Heh, i am wondering, why did these people choose avs? It's obvious they don't want to be restricted, why avs then? Im happy in my avs-cage :p But these evil little codemonkeys want to break my cage and run free! Why can't you just move into a different one and break that! :p
I'll give you bananas... ;)
Jaak
14th May 2004 16:09 UTC
Evolution baby EVOLUTION
one day all your base are belong to code monkeys
Tuggummi
14th May 2004 16:22 UTC
Babies evolve? How? When? I never... *gaga* *gugu* *iiii!* *gigiligugili* *snork*
hungryskull
14th May 2004 23:50 UTC
[panic]Evil monkeys, I must get away![/panic]
/me hides
Just kidding;)
I doubt codemonkeys will ever completely take over AVS.
G_JDean
2nd June 2004 08:43 UTC
can you write full Sscope help? what new inits it use, some your own methods, any ideas or specified objects
Sscope it is realy SUPERscope, need only knowledges