Archive: Texer II alpha


26th October 2003 17:11 UTC

Texer II alpha
After an afternoon of trying to iron out the final showstoppers, texer 2 is finally working ;). Changes with texer 1:

- Support for all blend modes (use Misc / Set Render Mode)
- Support for resizable particles
- Includes a standard bitmap (thanks Tuggummi)

And finally, it's now directly codable so this means:
- Subpixel accuracy when resizing is on
- Overlapping particles are possible
- No more disappearing particles at the edges

Get it from:
http://acko.net/t2/texer2.zip

Includes two 3D presets showing off how to use the resize ability for 3D particle rendering. Basically you set sizex and sizey to 1/z.

The help is still to-do (I mailed justin to ask if it's possible to include the standard help panel like in a superscope/dm), but you shouldn't have much trouble with it because it behaves mostly like a superscope.

It seems stable here, but crashes are always possible. However because it uses the AVS scripting library, it's possible that one of the AVS bugs can trigger when working with Texer2, and there's not much I can do about that.

Oh by the way, I need a couple of simple examples for inclusion. If anyone feels up to it ;).

This version is not final, but the code interface won't change anymore. Only bugfixes/additions.


26th October 2003 18:16 UTC

Very nice! This will be incredibly useful. I just had a thought now though - is it possible to code the T2 so that you could use a buffer save as the image, or would that be too slow?


26th October 2003 18:21 UTC

HOLY MOTHER OF GOD THAT'S THE COOLEST THING I'VE EVER SEEN

BUT

is it possible to use anything you did in this version to make a trans \ texer II?


26th October 2003 18:25 UTC

Why would you want trans texer after this??


26th October 2003 23:54 UTC

Ahh, the perfect companion for my lighting DM :D


27th October 2003 03:31 UTC

ahh it looks complicated...


27th October 2003 05:33 UTC

with resizable particles its gonna take AVS to the next level. thanks a bunch.


27th October 2003 06:29 UTC

So why the alpha-ness
what is yet to be done.

Very nice work btw.
;D


27th October 2003 09:41 UTC

OMFG This is great! :D Damn, I love it. I'll try and make you some examples UnconeD.

edit:

You might want to add the var b. b=1 onbeat, else b=0. Just a thought ;).


27th October 2003 10:44 UTC

Here are some examples, there is only the texer II used, nothing else (except sometimes for set render mode :p). Hope you'll use them, or at least inspired you.


27th October 2003 11:16 UTC

Well I'd like to stay away from 3D except very simple examples (like in the SSC), but your oscilloscope dots are a great example of a 2D texer.

BTW if you're going to do 3D, you should use resizing, it looks much more correct.
Set sizex and sizey to 1/z.


27th October 2003 11:17 UTC

Aww.. it causes my WA3 to crash...


27th October 2003 11:57 UTC

Originally posted by ;-c ,rattaplan
Aww.. it causes my WA3 to crash...
of course it does, since avs 2.7 is not and will never be available for winamp 3!

27th October 2003 12:10 UTC

lol, ok. Though I liked the 3 3D Beatcircles :p. I'll see what I can do, but have to study some tentams (or whatever it is in english) now.


27th October 2003 12:58 UTC

@#$!@... I knew that. I'll try it again when I'm @home (with WA2)


27th October 2003 13:12 UTC

pretty sweet looking...


27th October 2003 13:43 UTC

Is this more what you're looking for, or is this still to advanced?


27th October 2003 15:03 UTC

Another resize example
edit: use n=w/40 to make it work in all resolutions.


27th October 2003 18:47 UTC

Ok I uploaded a new texer:

- Fixed bug, the non-scaling render didn't draw the last column/row of an image
- Added b variable
- Included 4 examples
- Mentioned skip variable (set skip=1 to abort drawing a particle)
- Shouldn't crash on older AVSes, instead it will put out a message and refuse to work.

Daemon/gaekwad2: I modified your examples a bit to be clearer, if you don't want this just tell me and I'll remove them. I will credit you both in the help once I integrate with the rest of the AVS help.

The url is the same: http://acko.net/t2/texer2.zip


27th October 2003 20:33 UTC

ah skip nes...

that could be handy..
care to explain how we use it?


27th October 2003 21:21 UTC

I'd be honoured!
btw I just realized that if you size them with something/w (or h) you can make the particle size stay the same independent of resolution.
Didn't crash on 2.60 but I didn't see any message either.


27th October 2003 21:23 UTC

In the beat-responsive circle example, you forgot to remove the point variable ;).

I assume the variable skip means how many beats to skip?

Again, great work :)

<edit>
Damn, I love it that UnconeD uses some of my work as example in this best APE yet :D. Thank you very much for it.

PS. In the final version, can you please credit me for it in the documentation or whatever? A personal AVS friend of me will never believe this :D

</edit>


27th October 2003 21:43 UTC

gaekwad2: Well it should put a message in the init box if you add a new Texer2 to a preset in AVS2.6-. It was just a little something I added quickly, I'd expect most new presets to be broken anyway on AVS2.6.

sidd: if you set skip to 1 during the per-point code, the particle will not get drawn. Skip is reset for the next particle, so you do not need to unset it later. I thought it might be useful when speed is important to avoid drawing useless particles. And in fact Jaak suggested it as well (it was in it from the beginning, but I forgot to mention it).

Daemon: actually, if you'd look at the code, you'd notice point is used a lot. Basically, you can't use 'i' for circles w/ texer2, because I goes from 0 to 1, and so one particle would get drawn twice in additive blend. I thought of this, but decided to keep the old SSC 'i' behaviour for compatibility, and because you can get around it by making your own point-counter like I did.
And I already answered your credit question. Read more carefully :weird:.


27th October 2003 21:48 UTC

whoops, must've read over it. The changes you made in the code are fine by me, this is indeed much better to decipher for newbies as well :). About the point thingie, I missed the part that you used it in angle, so sorry 'bout that.

<edit>
I'm so honoured, I hardly dare to ask you one more thing. Please spell my name correct when adding credit to the help. It's Deamon, not Daemon. And I want to say this one more time: THIS IS A FUCKING GREAT APE! You rule, UCD, and I don't want to be a slimeball, I mean it.
</edit>


27th October 2003 22:00 UTC

not home, and won't be able to check texer 2 (though i did dl it) out for a few days, but is it, more or less, like a super scope replacer?


27th October 2003 22:04 UTC

Take a dot-like superscope, with a build-in trans/texer, and then multiply that with 1*10^<insert large amount of numbers here>. That's the Texer II.


28th October 2003 01:35 UTC

w00t! Texer 2 kicks serious ass, and I anin't playing! Don't know if this is like one of the examples already given, since I haven't downloaded them yet, but here is mine, I might have gone a little bit over the top, but I think I do a good job of showing some off this Texer's feautures, i.e.-perpoint drawing, COLORS!, and resizing.

/edit
I would also like to ask if anyone could fix the aspect ratio parts, I don't know if I did them right off the top of my head, and I slso did not put any on the X or Y variables, just on sizex and sizey.
/edit


28th October 2003 06:34 UTC

OMFG! I just love this ape! Great work UCD :up: :D

Just a question: will the final version support jpg and gif files (maybe even animated ones?)


28th October 2003 07:42 UTC

:confused: The correct resize formuls is w/something, of course.
I used it on S_T's example and now it works in all resolutions even without maxblend.


28th October 2003 11:34 UTC

Man this ape is sick :). You make kick ass presets, but your apes, this is where your skils realy blast off. And its fucking fast as well. There was a strange thing that happend yesterday when i tried it out (i couldnt resist even though im being crushed by giant piles off work). I tried to use it as a render for a raytraced picture (just ported the VissBizz code and made the grid cover the screen to get a 50*50 picture) and even when i turned off color check and resizeing some points didnt get rendered (the ball). I used 'k' to set the size of pictures (which gave some sort of a raster image. How come they didnt draw? I couldnt experiment more because of lack of time but I thought that if I turend both options off the damn thing should be picturles (all points same size and color). I gues I dont get the thing :D.
I know I shouldnt bug you with this but isnt this code allmost a ssc, could you make one with codable line width.I gues all thats missing is a decent line function. Am I wrong? Please tell if I am so that I can get the idea out of my head.

And the most important thing, thank you:).

p.s. the bitmap menu going out off the config looks cool:D.


28th October 2003 12:08 UTC

JPGs would be mostly useless because it deals with small pictures usually. I won't implement GIF support for various reasons, though I might consider PNG/MNG if I can get that to work.


28th October 2003 20:12 UTC

this is pure leetness :) Thank you UCD !


28th October 2003 21:31 UTC

Will the final version be integrated with the 'gear' that comes standard with AVS? D'you think you can get Justin to that?


29th October 2003 00:38 UTC

The question is, do I want to give away the code I worked a LOT of time on to a company owned by AOL?


29th October 2003 03:08 UTC

it comes down to that..

i would keep it..
plus it would just be a headfuck if you suddenly need to update it.


29th October 2003 06:19 UTC

Bug detected:

Loading huge pictures will cause Winamp to crash. I currently use the Wa2.91 with avs2.7pre8.

This is not really a problem because why the hell would someone like to texer a 800*600 image? But sometimes i accidently picked one and its fucking annoying to loose your code...

I guess that texerII is not able to buffer such big images.

Either please preread the size and pop up a message if it is above a certain size saying that it cannot be loaded or fix it so it will work with any size.

thnx


29th October 2003 09:38 UTC

I gues your anvser is no:(


29th October 2003 10:13 UTC

@fsk: why would you like to draw lines?
This ape is just for point drawing purposes, those points will get replaced with a picture of your choice and resized by code.

Try to create a line ssc and then add a trans/texer(I) to the scope this is what it would look like what you're requesting...


29th October 2003 10:43 UTC

I asked for a seperate ssc2 ape and i asked because i think Steven would write a line comand faster than I can spell my nick and because the curent ssc sucks and I have a feeling Justin aint gonna fix it.


29th October 2003 12:35 UTC

Oh, i didn't got that. ;)
So your request goes here i think :D


29th October 2003 12:48 UTC

way cool UCD! thanx.


29th October 2003 13:18 UTC

Another bug:
Resizing cuts off border pixels.
Try the attached BMPs


29th October 2003 14:26 UTC

Actually that's not a 'bug' per se, it's 'by design'.

The texels on the edge of the texture-image are placed on the border of the rectangle of the particle. So 'the area of influence' of those texels is smaller. If I didn't do this, then the texels on the edge would have to blend with non-existant ones outside the image, which would require me to check the bounds of every single pixel (slow) or add a border around the image which duplicates the outer texels.

If you want to show your border texels, you need to manually add a border around your image. I chose this approach because it's the most flexible one. For example in additive mode, you'll want a black border around your image. With replace mode you'll want a 'duplicate pixels' border. With subtractive 2, you'll want a white border. Etc.

Bilinear filtering is messy on the inside because of this.

I did just change the code around a bit to be extra greedy with texels (causes a difference of half a texel or so), so as much border area as possible is covered, so perhaps it's better now. But if you want your border texels to be blended to the outside of the particle as well, you need to manually add a border.


29th October 2003 16:41 UTC

OK, thanks for the explanation!
Maybe you should write something about this in Help to prevent similar complaints in the future.


29th October 2003 17:21 UTC

here you go: a simple shockwva example


29th October 2003 19:10 UTC

By the way, I've been experimenting with the 'large images crash Texer 2' and the results are weird.

Sometimes it works perfectly (I tried with both an 800x600 and a 4096x4096 picture) and sometimes it crashes in DDRAW.DLL (DirectDraw). The problem is that the error is caught by some internal handler (either Winamp or DDraw's) so I can't debug it easily.

In any case, my code was written to go up to 32767x32767 pictures without problems. Above that, integer overflow occurs (I use signed 16.16 fixed point for the bilinear filtering).

I'll try and see what's causing it, but to be honest I have no idea. The only thing I can think of is that a large image causes a certain process to take longer than it should, and a crash occurs during a normally instantaneous process.
I put my image loader inside a so called 'critical section' that is exclusive with the rendering code, so that no race conditions can happen.

Also, the particles will get clipped to the AVS window, so a huge image shouldn't offer any more problems than one as a big as the window.


29th October 2003 22:24 UTC

interesting.... i will create a preset using a 32767*32767 bitmap, and we'll see how long it takes to download.. hahahahah bwah haha


29th October 2003 23:47 UTC

Heh well I didn't write it on purpose *just* so you could go up to that size, it's more a side effect of using fixed-point math.


30th October 2003 07:01 UTC

but still think of the size of the file...

over a billion bmp pixels... it would be enornmus


30th October 2003 07:53 UTC

Any date set for the final version?ยด
Oh and btw. have you planned what will happen to Texer 1 ? Is it still okay to use it? i think there could be some effects that can't be done with texer II... Take Example the worm-o-rama arcade mix :)


30th October 2003 07:55 UTC

@Horsefly: If all pixels are of the same color, they should be easily zipped down to floppy size :p

@UCD: Ff everything fails just make sure that large pictures won't be loaded or even better, are excluded from the load-image combobox. Maybe add a checkbox "use images above xxx*xxx too" so we could still use em on our own risk. This is the best solution imho as long as the error cannot be traced back.


30th October 2003 11:43 UTC

The problem is that I have no idea what the limit is, and I think it's even CPU dependant.


30th October 2003 12:02 UTC

If i'ts caused by a thread-delay, noone can tell. You'd have to limit it to a reasonable size (eg 100*100) which should work on most pc's (we'd have to test it on some really od and crappy machines).

But how comes that this bug does only exist since texer2? The old version should work the same way.


30th October 2003 14:11 UTC

My PC is perfectly suited for the test :D


30th October 2003 14:36 UTC

Go ahead please :D


30th October 2003 14:49 UTC

Magic: I have no idea, which is why it's so darn hard to debug. The fact that it crashes in DDRAW.DLL makes it even weirder, because Texer2 gets nowhere near DirectX.
On top of that, if it were a problem with not having the image loaded properly, it would crash in TEXER2.APE. The code only reads from the image data, so heap/stack corruption is out of the question.
For now, I'm going to leave it like this.
What is an 800x600 BMP doing in your AVS dir anyway? :weird:


31st October 2003 13:04 UTC

hehe something i just made up.


31st October 2003 15:40 UTC

Sorry atero, I can't help it. AAAAAAAAAAAAAAAAAAGH.

y=y1/(2+z1)*w/h;

Fix the aspect ratio please. It makes all those 3D scopes horribly squished. Like shreyas' avatar.


Nice preset though, reminds me of Tripex. Speaking of which, it had a couple of really nice particle scenes that should be easy to recreate in Texer II.


31st October 2003 16:20 UTC

ahh. very true.. i must have another good look at tripex now.

im starting to see many nice presets from here and ff using t2. The resizablenessness is yet another breakthough. 'Tis a great time to be an avser.


31st October 2003 23:04 UTC

as it was always, sidd :). Though yes, some tripex stuff comes in view again now indeedy. Still, some of it is normal scopable as well. Though you would need a killer-computer for that.


1st November 2003 10:41 UTC

A wise man once said:

originally posted by killahbite
very original to do something that already exists.. using inferior technics like avs :p

1st November 2003 22:12 UTC

Nice. I see point sprite models in the future. :)


2nd November 2003 06:21 UTC

ooohhh! there's so much fun with T2.:);):D


3rd November 2003 07:22 UTC

any idea when the final is coming out?


3rd November 2003 11:25 UTC

When justin adds the help API.

In the meantime I've sped up the Texer 2 a bit, and added a Wrap-around function, which wraps particles around the border of the screen (handy for tilable patterns).

Haven't uploaded it yet though, but it's such a minor update that it really doesn't matter much.


3rd November 2003 17:19 UTC

so you're not going to let them put it standard with avs?


3rd November 2003 22:02 UTC

Noooooooooooooooooooooooooooo, It maded my winamp crash, ne1 know y???

Help me pleeeeeeeez, I wana play wif it too.:cry:


3rd November 2003 22:04 UTC

texer 2 is in alpha stages... you use the program at your own risk :p


4th November 2003 05:45 UTC

Mrgrabber.....are you drunk??


7th November 2003 06:22 UTC

small bugsy

If you choose one of the examples, and then change the texer image, and then change to another example, the image goes back to the default image.

This is fine, but the image listbox doesnt update. It still says whichever one you selected before, even though the default one is being used.

Also, i got a crash once when i mouse scrolled very quickely thought the list of texer images. But it hasnt happened since.


7th November 2003 11:29 UTC

I haven't had any crashes, though the first mentioned 'problem' occurs over here as well.


11th November 2003 12:21 UTC

Hmm, yes, very nice ;)


16th November 2003 23:46 UTC

Fixed that XOR bug and the imagelist bug. Latest at:

http://acko.net/dump/texer2.zip

Help won't work on currently available AVS pre's, you need the (unreleased) pre9 for this.


17th November 2003 01:48 UTC

:o

did you say pre9????


17th November 2003 02:54 UTC

Yes, he did say pre9, now wake up :)
Don't bother with the amazement, let's just say for now that pre9 allows kinda individual help files.

As for pre10, that'd be v1.0, that'd be 3 days from now, 20/11/03.


17th November 2003 03:18 UTC

Basically the help button opens up the same help dialog as the help button in the standard AVS components (superscope/dm/...) with a Texer 2 specific tab along side the others. In case you didn't know, this is one of the new things in AVS 2.7.

Justin simply didn't implement any way for APEs to use this dialog until pre9.

Here's the text in the texer 2 tab:

Texer II is a rendering component that draws what is commonly known as particles.
At specified positions on screen, a copy of the source image is placed and blended in various ways.


The usage is similar to that of a dot-superscope.
The following variables are available:

* n: Contains the amount of particles to draw. Usually set in the init code or the frame code.

* w,h: Contain the width and height of the window in pixels.

* i: Contains the percentage of progress of particles drawn. Varies from 0 (first particle) to 1 (last particle).

* x,y: Specify the position of the center of the particle. Range -1 to 1.

* v: Contains the i'th sample of the oscilloscope waveform. Use getspec(...) or getosc(...) for other data (check the function reference for their usage).

* b: Contains 1 if a beat is occuring, 0 otherwise.

* sizex, sizey: Contain the relative horizontal and vertical size of the current particle. Use 1.0 for original size. Only works if resizing is on.

* red, green, blue: Set the color of the current particle in terms of its red, green and blue component. Only works if color filtering is on.

* skip: Default is 0. If set to 1, indicates that the current particle should not be drawn.



The options available are:

* Color filtering: blends the image multiplicatively with the color specified by the red, green and blue variables.

* Resizing: resizes the image according to the variables sizex and sizey.

* Wrap around: wraps any image data that falls off the border of the screen around to the other side. Useful for making tiled patterns.



Texer II supports the standard AVS blend modes. Just place a Misc / Set Render Mode before the Texer 2 and choose the appropriate setting. You will most likely use Additive or Maximum blend.

Texer II was written by Steven Wittens. Thanks to everyone at the Winamp.com forums for feedback, especially Deamon and gaekwad2 for providing the examples and Tuggummi for providing the default image.

17th November 2003 08:59 UTC

Originally posted by UnConeD
Fixed that XOR bug and the imagelist bug.
would this be the "no green in XOR mode" bug?

17th November 2003 11:09 UTC

@UCD

I recently installed the new DX9b and all of a sudden i could use large images! Crashes still happen now and then but basically it works now even with those f**king huge bitmaps.

As you pointed out before, tex2 does'nt use DX, but check this yourselfes. Maybe you should add the advice to upgrade DX to your help.


17th November 2003 16:57 UTC

Are PNG's supported in winamp 5 AVS UCD?


17th November 2003 22:45 UTC

no.


17th November 2003 22:52 UTC

Originally posted by UnConeD
no.
to which question?

17th November 2003 23:07 UTC

The smart one.


18th November 2003 02:19 UTC

uh....


18th November 2003 12:24 UTC

...Will it be possabile to set the rotation angle of the bitmap (per-particle) someday?
I know it'll slow the whole thing down, but... dreams... :)


18th November 2003 21:01 UTC

or skew and distort pictures from the corners


19th November 2003 03:21 UTC

You can hardcode it yourself...

...So realistically, no.


20th November 2003 08:32 UTC

You dont need a rotation function, if you use one other object you can have particles rotating about the origin. I aint tellin yet :P.


20th November 2003 10:30 UTC

Because of your sonic preset?


20th November 2003 11:56 UTC

http://forums.winamp.com/showthread....hreadid=156793