|
|
#1 |
|
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
Render Picture II
As you might know, I'm working on a "Render > Picture" replacement that expands the flawed original.
![]() This is what it looks like at the moment. Firstly, it's faster than the original for most pictures (except tiny ones), because it calculates the enlarged image only once rather than every frame. This also means it does bilinear filtering at no cost at all (only the pre-processing takes a bit longer, but that happens only once). I also implemented all the standard blend modes (replace, 50/50, additive, maximum, sub1, sub2, multiply, xor, adjustable). Currently it only does .bmp, but I'm currently figuring out libpng (for .png support). Once that's done, I'll try JPEG, if I find a good library. However I have a few questions about what else I should do. For instance, the original component has a "blend 50/50, onbeat additive" mode. This would logically expand to an extra output selection box for onbeat, so you can do any combination of regular and onbeat modes. However, I've almost never used this feature, so I'm not sure if I should implement it. Do you guys ever use it? You could easily duplicate this effect by using two instances of the picture renderer in onbeat-switched effect lists, where one receives an inverted beat pattern. Next is aspect ratio correctness. Implement it? Finally any other suggestions? I don't want to turn it into one mega component though, because you can do quite a lot with AVS already. This APE is of course mainly aimed at experienced AVSers, so I'd like as little fluff as possible: only really useful stuff. |
|
|
|
|
#2 | |
|
Senior Member
Join Date: Aug 2002
Location: Narok<Where I live<Valhalla
Posts: 165
|
Quote:
(if that is what i think it is: a way to strech pictures so they fit better) oh yeah, i hope you get .jpg support, you would be the coolest .ape (programmer) around
|
|
|
|
|
|
#3 |
|
Bin King
Join Date: Mar 2001
Location: Finland
Posts: 2,179
|
Could it be possible to define the position of the picture? (like in text)
Yes you can do it with movements, but if it's faster to implent it directly to the ape it would be better. I was also wondering about defining the picture size also. Possible? fast? Or am i just talking crazy
|
|
|
|
|
#4 |
|
Major Dude
Join Date: Apr 2002
Location: Ballarat, Australia
Posts: 529
|
Yeah, have an option for size based on both percent and absolute pixels.
|
|
|
|
|
#5 |
|
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
|
hm, does this work with transparent PNGs aswell?
|
|
|
|
|
#6 |
|
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
If I manage to read PNGs, making an additional blend mode "Alpha channel" shouldn't be a problem.
|
|
|
|
|
#7 |
|
Forum King
|
Alpha channel sounds infinitely useful. I don't suppose youd be able to make a 'draw alhpa channel only' option? Then you could make 'quake 3 shader' style effects for textures.
![]() Either that or have multiple blend modes for the alpha channel... but I think that would be the more awkward way to do it. |
|
|
|
|
#8 |
|
Senior Member
Join Date: May 2000
Location: Sofia,Bulgaria
Posts: 137
|
If you could add possibilities for "On "N" beats change picture" will be cool. User may chouse folder with pictures and program will load pictures in name order or randomly from this folder on every "N" beats. Or may be instead of loading from one folder user may create playlist with pictures (from different folders) than program will load files from this playlist again in playlist order or randomly.
|
|
|
|
|
#9 | |
|
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
If you want to use multiple pictures, wouldn't the improved AVI player be better?
As I said, I don't want to make a mega APE, just fix the flawed Render / Picture. Quote:
|
|
|
|
|
|
#10 |
|
Forum King
|
I was just thinking about saving on pictures. Where as you would need two pictures for a texture and an alpha channel you could save on the number of pictures needed by using the same one for both. You might want to use the alpha channel from the picture on something else as well as the picture, say if you wanted to add blend some scopes over a picture (for whatever reason) and you wanted a circular black hole in the middle, you could recycle the alpha channel from the picture to multiply with the scopes to get the hole in the middle of them to match exactly with the hole in the middle of the texture so that when you add them together you don't end up with scopes in the hole.
|
|
|
|
|
#11 |
|
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
Just do a subtractive blend of a picture of the alpha channel on the scopes? By the way, additive blending doesn't need an alpha channel
.I'm only going to do replace-alpha blending. Most other modes don't need it (you can modify the picture itself), and I fail to see the point of an alphablended XOR for example . Besides, you could use a regular AVS buffer blend for that anyway (see what I mean with keeping it simple? ).
|
|
|
|
|
#12 |
|
Forum King
|
Like I said... I was just thinking about saving on the number of pictures used. You'd only need 1 picture rather than 2, it keeps the pack size down. Its not mega important, I just thought that it would be nice.
This Render/Picture II sounds really good anyway, and really fast.(framerate = god)
|
|
|
|
|
#13 |
|
Forum King
|
For the blending, I think this would be the fucking shit:
Normal blend: blend options (adjustable slidebar and %) X On-beat blend: blend options (adjustable slidebar and %) . X On-beat frames: n .(X After beat decay: x) (blend options: ignore, replace, max, min, sub1, sub2, buffer, multiply, pixel w/alternate, line w/alternate, xor, adjustable) X is a checkbox, and (...) is an option that's only useable when using adjustable blend. On-beat frames keeps the blending option for n frames, and after beat decay (only with adjustable blend on both normal and on-beat) starts decaying the on-beat setting back to the normal setting at rate X. Adjustable % is a textbox to specifically set what percent of the picture is used (instead of just a slidebar). Lastly, the pixel/line w/alternate means that it uses the alternate set of pixels and lines. The aspect ratio correction NEEDS to be there. Have it just be correct, instead of making it correct on either the x- or y-axis. Also have it correct ******ds OR inwards. (in other words, if the picture is taller but thinner than the window, have it either expand to the width, or shrink to the height.) Was that too many suggestions?
"guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings |
|
|
|
|
#14 | |
|
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
Buffer blend is not possible because APEs can't access the internal AVS buffers. You'll have to use an effect list.
I just implemented minimum blend, because it's just switching around two lines from the maximum code .Why would you need a percentage box? I doubt you'll notice the difference between 38 and 39%. Does anyone *every* use those alternating pixel/line patterns? Think of stuff you're going to use, not stuff that just sounds cool :P.Quote:
|
|
|
|
|
|
#15 |
|
Senior Member
Join Date: Jul 2002
Posts: 149
|
Cool we are going to have a new Unconed ape.
![]() What is minimum blend and how does it work? |
|
|
|
|
#16 |
|
Forum King
|
Minimum blend blends the two pixels as little as possible.
I meant that instead of correcting on the x-axis OR the y-axis, which can result in either shrinking or zooming the picture, do one or the other in all cases. So if correct inwards is turned on, you would shrink either the x-axis or the y-axis to fit the window, and vice versa for correct ******ds. Do I make sense now? BTW, I have uses for both a manual percentage text-box and an alternate every other pixel. They're hard to explain, though. And come to think of it...they don't really apply to render / picture. Never mind
"guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings |
|
|
|
|
#17 |
|
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
Minimum blend simply compares the channels of the two pixels and always takes the lowest value, just like maximum blend takes the highest value from the two.
E.g. blend (128, 0, 200) with (0, 50, 100): minimum: (0, 0, 100) maximum: (128, 50, 200) |
|
|
|
|
#18 | |
|
Bin King
Join Date: Mar 2001
Location: Finland
Posts: 2,179
|
Quote:
|
|
|
|
|
|
#19 |
|
Major Dude
|
steven, what does the xor blend actually do
batman |
|
|
|
|
#20 |
|
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
It performs a bit-per-bit binary XOR... just like the regular AVS XOR mode.
|
|
|
|
|
#21 |
|
Major Dude
|
umhh, the thing is that i meant was that i did't understand what the xor blend avs does actually (how does it work)?
batman |
|
|
|
|
#22 |
|
Forum King
|
The binary XOR does an exclusive or on the bits by returning 1 if the bits are different and 0 if they are the same.
eg. 00101101 xor 11011101 --------- 11110000 In AVS it just uses the colour for the foreground and background to XOR, the colours are in hex in the form 00RRGGBB where RR,GG,BB are the red, green, blue out of 255 in hex. Since hex digits are equal to 4 bits each you can easily convert this into binary and do the XOR blend. For instance, xor blending a = red=255,green=64 and blue=8 with b = red=64,green=128 and blue=0 you convert this to hex, then binary: a=00FF4008 b=00408000 (ignoring the front zeroes) code: so the result is 00BFC008 so the resulting pixel will have color: red = BF = 11*16+15 = 191 green = C0 = 12*16+0 = 192 blue = 08 = 0*16+8 = 8 ![]() EDIT: Oh... and the reason for the two leading zeroes is to make it fit into 32 bits. I know that in a targa file you can use those extra bits to store the grayscale alpha channel information, its probably the same with other formats with alpha channels. |
|
|
|
|
#23 |
|
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
The reason AVS uses 32-bit as well is for processor reasons. The Pentium memory bus is 32-bits wide and has to fetch data from 32-bit aligned addresses.
Suppose AVS used 24-bit instead, it would sometimes have to fetch 64-bit to get one whole pixel: R1 G1 B1 R2 | G2 B2 R3 G3 | B3 R4 G4 B4 In order to get the second pixel, the two first chunks have to be fetched. R1 G1 B1 00 | R2 G2 B2 00 | R3 G3 B3 00 | R4 G4 B4 00 So by padding with zeroes, you get an increase in memory size, but a large speed-up as well. And yes, usually 32-bit color means RGBA (with an alpha/transparency channel) instead of RGB0. |
|
|
|
|
#24 |
|
Forum King
|
[offtopic]
Meh.. the x86 architechture is crap. All of its problems spawn from intels foolish desire to make every single processor fully backwardly compatible, I mean who wants to run software written for the 4004 on a Pentium 4? Thats just insanity. Personally I think that they should start a new architecture from scratch and make their processors be compatible with both for a few years, then phase x86 out. Or they could slowly introduce the new one... anyway, it shouldn't be too hard a thing to organise and maybe they would learn a lesson, like 'do things properly in the first place'. [/offtopic] |
|
|
|
|
#25 |
|
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
Isn't that what IA-64 is supposed to be?
|
|
|
|
|
#26 |
|
Forum King
|
I'll have to ask about that, most of what I know about the architecture comes from the intel (propaganda filled) manual and pak-9 (who is doing a degree in software engineering). But as far as I am aware the IA-64 is going to retain all backward compatability, its one of the things that intel is most proud of (god knows why) so it will still have all of the flaws of x86.
Apparently one of the biggest flaws is the program counter which uses two registers because it needs 20-bits, so it uses 2 16-bit registers where a single 20-bit or 32-bit register would do fine, and also make everything run much faster. |
|
|
|
|
#27 | |
|
Forum King
|
Heres an email I got from P9 on how flawed x86 is.
Quote:
|
|
|
|
|
|
#28 |
|
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
If you think regular x86 is incomplete, check out MMX. It's as if they took a list of all possible instructions, and then picked only a few implementations.
For example, you can't shift 8 packed bytes, only 4 packed words or 2 packed dwords. Or, comparisons only work on signed integers, not unsigned. So you have to flip the sign bit before and after doing a comparison of unsigned ints. Division is also missing. All in all, quite annoying :P. |
|
|
|
|
#29 |
|
Forum King
|
I thought that they tidied that up with SSE and SSE2. I know that they included a lot of other packed types, like double and single precision floats.
|
|
|
|
|
#30 |
|
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
Yeah but SSE is far less common than MMX. Plus, it seems MSVC++6.0 doesn't understand SSE instructions... so I can't use them at the moment anyway.
|
|
|
|
|
#31 |
|
Senior Member
Join Date: Feb 2002
Location: an UFO near planet earth
Posts: 164
|
nothing yet availlable?
|
|
|
|
|
#32 |
|
Whacked Moderator
Join Date: Jun 2001
Posts: 2,104
|
Well I do have a working .bmp renderer with bilinear filtering and all the AVS output modes (which is already better than render/picture 1), but I haven't fixed PNG support yet. LibPNG is still crashing sometimes.
However, there is a different problem I didn't see: libpng and zlib (the two required for png support) combine to about 180KB. If I were to add JPG support, it would mean even more size. Since people would have to distribute the APE along with their packs, it would probably be bigger than just using .bmp's. I'll see if I can't crunch it down some more by cramming everything into the APE, but it's still a major bummer. Anyway I decided to put down R/P2 for now and pick up an older project of mine: an open-source compiler for AVS code , for use in APEs.
|
|
|
|
|
#33 |
|
Forum King
|
I'm pretty sure that you could make the APE do the file loading and stuff. As long as you know the file format or have some source it shouldn't be too difficult. I think that there are a few .jpg tutorials around and definately tons of targa ones.
I'd recommend looking through places like flipcode. (I'd look for you but I'm so damn lazy )
|
|
|
|
|
#34 |
|
Senior Member
Join Date: Feb 2002
Location: an UFO near planet earth
Posts: 164
|
have a look at: http://www.programmersheaven.com
|
|
|
|
|
#35 |
|
Bin King
Join Date: Mar 2001
Location: Finland
Posts: 2,179
|
Sad to hear that you have problems, since this is the first ape i actually would want to use, it would be very handy in my Bitmapped pack which im planning to do somewhere in the future... Well i think it will probably be ready by the time i start to make that pack
![]() But what if i start to make presets with the old picture render and then use the ape when it is done, would it cause any complications etc.? |
|
|
|
|
#36 |
|
Forum King
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
|
hmm, nsis uses bzip2 compression and will use even more effective 7zip compression in future. it's still gonna be a big file i guess, but well, that's what it takes sometimes.
|
|
|
|
|
#38 |
|
Senior Member
Join Date: Dec 2002
Location: Australia
Posts: 181
|
.gif support would be highly useful (moreso than .jpg which shouldn't make much difference than a .bmp). That way I can render transparent/masked pics which would be damn nice.
|
|
|
|
|
#40 |
|
Member
Join Date: Apr 2004
Location: Slovenia [EU]
Posts: 69
|
thank you UnConeD, you are a good.
this is something that I needed the most. |
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|