jump to navigation

Switch back in high resolution December 5, 2006

Posted by winden in coding, demoscene.
1 comment so far

So, a while ago I wrote about going low-res on my flatpannel… but in the end could not bear it… all that bilinear blurriness just kills me to no end… rather than that, spent a good while yesterday hacking e-uae to support upscaling via opengl… so now I can run a 320×256 screen, the emulator only has to calc and upload 320×256 pixels and the videocard expands to required size + does double buffering… let me tell you that pixelling a 320×256 picture on a 1280×1024 flatpannel is now really possible and even fun :)

Almost forgot… also went back to 16bit screen… gives a little speed boost and anyways OSX is doing dithering for the color spreads, shading and all the shiny stuff onscreen :)

Playing ADPCM sounds on Amiga… November 5, 2006

Posted by winden in coding, demoscene.

So yesterday I finally started to code an ADPCM sound player, since upon scrounging google I didn’t really manage to find any public 680×0 sources to do the playing like for example can be done with players like “the player 6.1” are not turned up when searched for, so maybe there are really free-to-use players… but anyways, armed with a tutorial from jurassic pack 14 by scicco/scarab about how to drive the Amiga to make a buffered sound loop, I dove into the hardware hacking and a few hours later I had a 16bit uncrompressed wav sounding as a 8bit realtime dithered wave on the Amy.

Fun started when I started trying to covert the standards-provided reference sourcecode for IMA-ADPCM into a 680×0 routine… and today after a few more hours it’s starting to sound somewhat like the original but with pops and clcks (which the original roxette song didn’t have ;)… so I think I may be nearing the first version with proper sound :)

What I’ve also detected is that ADPCM decoding will be difficult to optimise regarding cpu pairing and the like… so after I have it working maybe I’ll have to spend some time making my own compressed format which could be decoded with less serial dependencies.

Off to code some more…

Learning to read japanese reminds me of learning to read math September 12, 2006

Posted by winden in coding, japanese.
1 comment so far

Meta-info 1: I was studying “math major” at university.

Meta-info 2: I have yet to find out if unicode has proper math symbols.

So I goto my first math class at univ. together with leunam (who had entered math univ. one year before), and we sit at some random place. Enter stage left a young but strict looking female teacher and after some pleasanteries…

teacher: This being math analysis (the one where you learn to do weird symbolic integrals, symbolic power series and lotsa greek letters in both cases), I will now write most of the math symbols we are going to need (she always used scientific-speak at class of course) opposite their translation

winden (whispering): leunam, this is when we get to learn “for-every” and such like symbols?

leunam: just wait and see

winden: yeah

teacher: *write* *write* *write* *write* *write* …

winden: holy crap i can’t keep up

leunam: told you so, to wait and see

teacher: *write* *write* *write* *write* *write* *write* …

chalkboard: *error no space left on device*

teacher: *goto chalkboard 2* *write* *write* *write* *write* *write* … *goto chalkboard 3* *write* *write* …

winden: I just can’t keep up on somewhat writting them down, much less writting them with proper form… we really have to learn all these symbols?!?!?!

leunam: hehe

teacher: Can I erase the first chalkboard? *waits 3 secs* *erase* *write* *write* *write* …

winden: Can’t believe how fast she’s writting while maintaing goodlooking symbols!!! (i have always been keen on font desings)

leunam: Don’t despair winden of network

[end of “ohhh i remeber when i as young and wawawa”-mode]

What does this story have in common with japanese? You see, japanese has different symbols for writing than latin-derived languages, so learning entails not only pronunciation and associating sounds with ideas, but also the combo of sound with ideas with symbols, just like when learning to write in math-speak “for-every n belonging-to naturals with n greater-than 0, exists some m belonging-to naturals with n being less-than m” (this definition of infinite-ness of the natural numbers is hereby provided free of charge ^^).

(fixed: found out how to cast the math-with-unicode spell: “∀n∈ℕ|n>0, ∃m∈ℕ|n<m”

newschool shaderz – part 1 July 17, 2006

Posted by winden in coding, demoscene.
add a comment

So… it looks like some of my antique addictions haven’t dissapeared completely:

shader raytunnel

68060-optimised texture mapping – part 1 July 3, 2006

Posted by winden in coding, demoscene.
1 comment so far

So, hanging out on the ADA forums, we came up with a conversation about 060-specific optimising, which is sort of like pentium-specific (U/V pipes of fame) optimising. 060 has pretty harsh rules for address generation delays, so there is ample of oportunity to try ingenious ways to reorder stuff as to get no half-cycles wasted… linky linky provided for your pleasure ;)
The only real limitation I can see for this mapper is that the loop count has to be less than 255, but then again I don’t believe in big polygons :P

; 8 cycle per 2 pixels 8.16 mapper
; remixed from an ADA thread contributed by
; krishna^scoopex, kalms^the.black.lotus,
; krabob^mankind and winden^network^batman.group
; d0 vvUUuuuu		a0 dvDUdudu
; d1 cc--VVvv		a1
; d2 dc--DVdv		a2
; d3 --UUVV-- 0		a3
; d4 --UUVV-- 1		a4
; d5 pixel buffer	a5 tex
; d6			a6 scr

	move.b	(a5,d3.w),d5	; p1
	move.l	d0,d3		; s1
	move.b	d5,(a6)+	; p2
	move.w	d1,d3		; s2
	lsr.l	#8,d3		; p3
	add.l	a0,d0		; s3
	addx.l	d2,d1		; p4
	move.b	(a5,d4.w),d5	; p5
	move.l	d0,d4		; s5
	move.b	d5,(a6)+	; p6
	move.w	d1,d4		; s6
	lsr.l	#8,d4		; p7
	add.l	a0,d0		; s7
	addx.l	d2,d1		; p8
	bcc	.xloop		; p9 if not predicted, zero if predicted

dithering – part 2 May 23, 2006

Posted by winden in coding, demoscene.
1 comment so far

Yesterday I was coming back from work when I remembered the idea about doing realtime dithering… I had started in 1999 to make some routines but since the concept was not that complex, I prefered to recode rather than lose 2 hours searching on the amiga hd… lo and behold, some time later I managed to make a simple moving stripe routine in 256 greyscales, and later added the filter to convert the 256 greys to 16 grey values via floyd-steinberg dithering…

Using 4 bitplanes instead of 8 (16 instead of 256 colors) gained half of the speed of the chunky2planar routine (the dumping from fastmem to chipmem), but the dithering is still far from optimised so perhaps there is still hope about using it for more complex routines :)

dithering – part 1 May 22, 2006

Posted by winden in coding, demoscene.
add a comment

I don’t exactly remember the first time I saw a dithered picture, but I must have been a lot of ages ago… since then, I was really fascinated with all those patterns which seemed to multiply the colors… soon after I started coding demos, I tried to make my own dithering routine but of course the first attempts failed :)

Later on, just before the euska party 5, we were preparing a nice invitation demo and for some strange reason the dithering theme appeared on #amycoders… this led me to code a little “dithered-rotozoom” by making some 4×4 ordered dither patterns and using them as a virtual character mode screen:

But dithering was not forgotten as you will see soon…

How about some more advanced texturing? May 17, 2006

Posted by winden in coding, demoscene.
add a comment

So, I recall sometime about 8 years ago, Ryan/Centolos told me that he had added support for texture + RGB interpolation to his 3dfx renderer, and was bitching about the fact that, while adding the support to the software renderer was possible, it would probably take a big hit on the speed due to the need to interpolate another 3 values per-pixel…

Fast forward a couple of years later, and you’d find me bored one day when I remembered this conversation and, like any bored amiga coder would do, started to think… RGB interpolation, if PC can do it, why not on amiga?… I already had a routine which interpolated 4 texture coords and had released it on synthesis (the tex+bump+env+shade rotozoomer), and recalled that registers were a bit short so didn’t realize at first how to cram not 4 but 7 interpolators into the inner loop, but luckily I had just started to work near home so every day I had a full hour of emptiness to fill with arguments about this optimisation

I recall this took one or two weeks, but finally I managed to cram all the crap into the registers…

; texture + bump + environment + shadetable + additive RGB texturer
; interpolated RGB values are added after modulating
; the texture color with the environment, so I'm not
; too sure this is really of any help for visual effects,
; but anyhow...
; pending: if (when) i get a 060, attempt to
; better utilise the dual pipelines
; d0	JJjjVVvv	a0	DJdjDVdv
; d1	IIiiUUuu	a1	DIdiDUdu
; d2	RRrrBBbb	a2	DRdrDBdb
; d3	ccGGgg--	a3	01DGdg--
; d4			a4	TT00DJDI	texture.b + 0.b + bump.w
; d5			a5	EE		environment.b
; d6			a6	RRGGBB--	screen.l
; d7			a7	RRGGBB--	shader.w

.xloop	move.l	#$ff00ff00,d4
	move.l	#$00ff0000,d5
	move.l	d4,d6
	move.l	d4,d7
	and.l	d0,d6		; d6 = JJ--VV--
	and.l	d1,d7		; d7 = II--UU--
	and.l	d2,d4		; d4 = RR--BB--
	and.l	d3,d5		; d5 = --GG----

	lsr.l	#8,d7
	or.l	d6,d7		; d7 = JJIIVVUU
	or.l	d5,d4		; d4 = RRGGBB--

	move.l	(a4,d7.w*4),d6	; d6 = TT--DJDI
	swap	d7		; d7 = ----JJII
	add.w	d6,d7		; d7 = ----JJII + bump
	swap	d6		; d6 = ----TT--
	move.b	(a5,d7.w),d6	; d6 = ----TTEE

	add.l	(a7,d6.l*4),d4	; d4 = RRGGBB--
	move.l	d4,(a6)+

	add.l	a0,d0
	add.l	a1,d1
	add.l	a2,d2
	add.l	a3,d3
	bcc	.xloop

This was done after I had stopped making any productions, so it has sit unused for some years… but lately I’ve been thinking about normal mapping for amiga and the though of having to interpol the normal for the per-pixel lighting calculation reminded me of this one…

ps. notice that this routine doesn’t need any memory accesses besides the texture ones. keeping the deltas on the stack would free 3 registers, so it would definitely be possible to interpolate even more values ;)

normal mapping May 2, 2006

Posted by winden in coding, demoscene.
add a comment

Code-wise, I was already expecting some amiga demos to use HDR or at least light-bloom effects, so it didn’t take me so off guard upon seeing it on both tbl and ephidrena demos… but ephidrena’s use of bloom + normal mapping gave a very very very great look to the demo, even if it was a bit too slow… but then again i haven’t coded any complete 3d engine yet (no, i’m not kidding, i always were a 2d effect junkie) so maybe it’s just too damned complex…

So, while taking a walk back from work today, I started to wonder about how I’d implement normal-mapping on amiga, and later on I’ve downloaded some normal-mapping lightwave plugins for OSX that manage the creation of normal maps via the well-known method of having both a low-poly and a high-poly object and somehow mixing them. The page even provided a simple and effective manual on how to make a test from start to finish, so I was able to make a simple and crappy blob, generate a normal map and then use it to render the lowpoly object. So, providing I could manage to endure the creation of some lightwave scene exporter or at least a newschool lightwave object loader, I’d be able to use a normal-mapped in some yet-to-be-written-engine.

Optimizing the implicit-equation drawing February 20, 2006

Posted by winden in coding, demoscene.
add a comment

NOTE: moving to my new winden homepage