Skip to content
Forum Archive

Dynamic Clear Screen v2, completed....

36 posts

shreyas_potnis#edited

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 😕

dont download this, download the one after killahbite's post
Yathosho#edited
Originally posted by shreyas_potnis
whenever I try to go to devart, internet explorer crashes.
get firebird
shreyas_potnis#edited
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#
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#
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#
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#
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#
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#
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#
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).
shreyas_potnis#
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#
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.
Magic.X#
I found this site googling for all the mmx commands.

This should help to understand the mmx thing:

shreyas_potnis#
but hey, the new version of the APE is faster then a ssc+d=0 movement in an effect list (to phaze)
Tuggummi#
But im a control freak and i can do something with a ssc line & a movement that this ape can't do... GRADIENTS! w00t!
sidd#
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..
Magic.X#
/me fears this will result in a philosophic flame war about math ownership and using others ape's again
[Ishan]#
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#
im sorry all...
i get pissed of over ppl fraternising. my bad.
sorry tugg.
before you knowit ill turn into atero!
hehe..