- AVS
- Dynamic Clear Screen v2, completed....
Archive: Dynamic Clear Screen v2, completed....
shreyas_potnis
1st May 2003 10:28 UTC
Dynamic Clear Screen v2, completed....
So, here goes...I had completed the ape about two days ago, but because of the combo-box stupid problem I couldnt release it..
can someone do me a favour by posting this at devart?
whenever I try to go to devart, internet explaorer crashes.
one time I managed to load the devart window (dont know how) but when I try to sign in and clicked the button, internet explore stopped responding :confused:
dont download this, download the one after killahbite's post
Yathosho
1st May 2003 10:37 UTC
Originally posted by shreyas_potnis
whenever I try to go to devart, internet explorer crashes.
get
firebird
shreyas_potnis
1st May 2003 10:54 UTC
complete with 4 blend modes:
1) Replace
2) 50:50
3) Additive
4) Accidental.
Accordin to me, the fourth onw I think will be the most useful one, dont know what it does exactly, but is great.
discovered while playing around with additive blend :)
I am including a preset which I made with accidental blend mode :)
AVS Axer
1st May 2003 12:42 UTC
nice work.. will be much more useful with some more modes.. work on the two subtractive modes c=(a-b) and c=(b-a).. very easy to code.
also xor would be nice.. but much harder to code..
your acident looks somewhat like additive and then halved, or averaging or something.
vry nice .. seems like someone else is beggining to make 'useful' ape's!
Raz
1st May 2003 14:28 UTC
I still prefer the easy:
misc/set render mode/whichever one i want
one dot scope with colour coding where i can control the colours
movement: d=0;
Yours is probably faster though. I just prefer having full control of the colours.
AVS Axer
1st May 2003 14:36 UTC
ah, but no screen flickering in this.. d=0 makes frame flickers.. frame flickers that can cause some really big messes if you wanbt to apply effects afterwards.
UnConeD
1st May 2003 15:56 UTC
AVS Axer? Eh? XOR is the easiest blend method to code... just xor the entire 32-bit dwords of the pixels with eachother.
Oh and as far as I can tell, accidental mode is just the same as using additive with the inverted color.
Considering the slowdown this APE generates, I assume it doesn't use MMX. I'll stick to d=0 + SSC :)
AVS Axer
1st May 2003 16:29 UTC
c'mon unconed.. a little encouragement for the guy making the ape.
good point about xor but.
btw can everyone please call me axer, i stuck avs in front cause there was already another axer.
dirkdeftly
1st May 2003 21:04 UTC
okay avs axer.
shreyas: it's okay...but not really that useful imho. it also needs more blend modes...mind showing us the code for this "accidental" one of yours?
shreyas_potnis
2nd May 2003 10:54 UTC
I havent used MMX extensions as I dont know even a bit about them, the pieces of code you gave me UnConeD wont work (dont know why, maybe because I dont know how to make them work).
Magic.X
2nd May 2003 13:07 UTC
*me senses a need of a "UnConeD explains use of MMX" thread
shreyas_potnis
3rd May 2003 11:16 UTC
Originally said by UnconeD
HOWEVER, and this is VERY important... you should realize by now that
if you
do this for every pixel, that the result won't be very fast. Doing 8
ANDs, 3
ORs, 3 additions and 3 divisions per color is not acceptable for lots
of
operations. That's why you should use MMX (multimedia extensions).
These are
special instructions in the CPU that allow you to do one operation on
several variables at once (perfect for working with the 3 color
channels
simultaneously). To use them, you must use assembly programming: this
is
when you use literal CPU instructions rather than a higher-level
language
(like C++ or Pascal) and is much harder.
With most C++ compilers, you can include pieces of assembly code inside
an
__asm-block, so you can leave your entire program in C++ except for a
few
small parts.
So here are some pieces of code for the additive and 50/50 blend mode
that
you can use. If you want to understand how they work, you will need to
learn
about assembly programming, and this can take a while (a good book is
'The
Art of Assembly Language Programming', but this doesn't cover MMX). You
can
use Google to find more info if you want (look for stuff related to
'mmx
instructions' and 'alpha-blending').
In this code, we assume that 'color1' and 'color2' are 2 32-bit
integers
representing the two pixels. The result is put back into color1.
/* Additive:*/
__asm {
movd mm0, color1
paddusb mm0, color2
movd color1, mm0
}
/* 50/50 */
__asm {
pxor mm7, mm7
movd mm0, color1
movd mm1, color2
punpcklbw mm0, mm7
punpcklbw mm1, mm7
paddusw mm0, mm1
psrlw mm0, 1
packuswb mm0, mm0
movd color1, mm0
}
Finally, at the end of any function that uses these MMX codes, you need
to
put the following code (before the return statement of course):
__asm {
emms
}
This is due to technical reasons and signals the end of MMX-enabled
code.
What's also important is that you cannot use any floating-point code
(this
means using real-numbers like 0.12345 or 3.1415, or functions like
sine/cosine/square-root) in combination with MMX. Between any piece of
MMX
code and floating point code, you must put an 'emms' block (see above).
shreyas_potnis
3rd May 2003 11:18 UTC
and by the way, here's a more updated version and IMO, this APE is OVER, I had a very nasty bug in this APE which was due to some typo in the code, which I fixed.
Phaze1987
4th May 2003 20:48 UTC
good ape,but the old d=0 (or r=0) movement is faster on my computer so...Anyway great job !
Magic.X
6th May 2003 08:18 UTC
I found this site googling for all the mmx commands.
This should help to understand the mmx thing:
http://www.angelcode.com/articles/mmx/mmx.asp
shreyas_potnis
6th May 2003 09:58 UTC
but hey, the new version of the APE is faster then a ssc+d=0 movement in an effect list (to phaze)
Tuggummi
6th May 2003 10:00 UTC
But im a control freak and i can do something with a ssc line & a movement that this ape can't do... GRADIENTS! w00t!
shreyas_potnis
6th May 2003 10:24 UTC
what's w00t?
sidd
6th May 2003 10:37 UTC
sigh.. you can do alot more with a superscope aswell, but that dont mean you should never use moving particles if you want a moving particle effect.
If im looking for an effect that clears the screen random colours on beat and fades neatly between those colours.. il use CS2.
if i want gradients, ill do them the manual way.. duh..
[Ishan]
6th May 2003 11:33 UTC
I go with siddartha_one.:thumbsup:
Magic.X
6th May 2003 14:30 UTC
I use whatever suits best.
sidd
6th May 2003 15:43 UTC
"I use whatever suits best."
aint that the way avs should be done tugg?
Magic.X
6th May 2003 20:16 UTC
/me fears this will result in a philosophic flame war about math ownership and using others ape's again
[Ishan]
7th May 2003 06:58 UTC
Come on guys this thread for started by shreyas for others to review his ape, not for others to decide how avs should be used?
sidd
7th May 2003 09:01 UTC
im sorry all...
i get pissed of over ppl fraternising. my bad.
sorry tugg.
before you knowit ill turn into atero!
hehe..
Magic.X
7th May 2003 09:12 UTC
Erm, Atero how he was or Atero as he actually is?
shreyas_potnis
7th May 2003 09:30 UTC
well, ok no one answered my question: what's the meaning of 'w00t'?
sidd
7th May 2003 09:31 UTC
youknow, the cliche of atero..
abusive and not very firendly at all..
the atero that once was
shreyas_potnis
7th May 2003 09:34 UTC
ok, I didnt understand...anyways forget it
[Ishan]
7th May 2003 11:20 UTC
i did'nt understand too O_o
Magic.X
7th May 2003 11:40 UTC
shreyas: i think just a saying a bit alike to yeah! or so.
i didnt knew exacly either, just guessed by the context its used in ;)
shreyas_potnis
8th May 2003 09:43 UTC
and then whats 0_o Ishan? :)
(seriously, i dont know)
[Ishan]
8th May 2003 10:05 UTC
it kinda like":igor: "
Magic.X
8th May 2003 11:00 UTC
Hey mods, pull up a "smillies and forum vocabular explanation" site quickly! :D
shreyas_potnis
8th May 2003 11:54 UTC
and i think the forums should have more smilies too...:)