Neonsky

by Ephidrena

Credits

Soundtrack

Frequent / Ephidrena Jul 2016

Last edited on 15 Jul 2019 by gasman. See all edits

3 comments

s_t_s - 20:18 18 July 2016 #

Lacks gfx but great tune, lovely fx and great choice of colors !

rloaderro - 09:57 28 July 2016 #

After seeing Britelite's recent Hires demo I wondered what else can be done in 640x256 resolution.

The textured tunnel/ball/plane effects

The texture is stored in the palette at 12x12 with lower resolution "miplevels" of 12x6, 12x1, 6x1 and 6x1 again. All together spending 240 palette entries leaving 16 colours free for a sprite overlay (credits). Each level has a different brightness and are resampled from the main 12x12 texture so that one can produce the light at the end of the tunnel without spending any processing power on this. Then each level is color cycled according to their size to produce the effect of the rolling texture. The y-motion is because the table is bigger than the screen (shocking!). 9 different tables are created per tunnel with partial angle and scroll offsets to mitigate the ugliness of 12x12 resolution movement.

The cross fader (photo effects)

Another palette effect where the first picture is using colours 0..15 while the second picture is using colours 0..16 * 16. Then the result of the mix is calculated at the sum of these palette indices. For example a 50% mix of colour 1,1 will be placed at colour 16*1+1. The sum is a side effect of placing the first picture's bitplanes using bitplane pointesr 0-3 and the second image bitplanes at pointer 4-7.

The pictures are from a trip to Hongkong and from the clouds above Trondheim in Norway.

The neon copper bars

A 1D RGB buffer of 256 lines*2 subsamples*3 components is created. Then additive draw a set of 1d points into this buffer. Then perform a IIR blur filter back and forth to add the glow. Then downsample, clamp and put it as a copper list. So it is 2x Supersampled HDR copper bars with bloom!

Biggest problem is I couldn't find any system friendly way to have animated copper list. In the end I poked into the system copper list. If anyone have a suggestion I'm all ears.

The voxel

Rotate/translate some camera rays, intersect them with a plane on left and right side of the screen (a lot of calculations become 0 because the plane coefficients are 0,1,0,0. 2 intersections figured out per line where one is free since the camera can't roll and hence the intersection just depends on y height and y-angle). Look up height map at the intersection point Fill and compare with height buffer to avoid overdraw. If the intersection point is the same as the previous intersection point for this horisontal pixel position then it means we are on top of the voxel so increase brightness to highlight it. When drawing on the side fade towards black as drawing downwards to make this "ambient occlusion" look.

The palette is organised to have shading and fog like this colour = pal[shade+fog*16]; Shade is 0-16 and the palette gets more and more foggy on increments of 16. The "Anyone of these suckers" effect was using shade tables which should be slower than when using an organised palette. The resolution was halved on x without much loss. The effect is quite slow.. Especially in company with the other high framerate effects. Interestingly this effect was slower on emulator than on real HW (Frequent's 060).

The 2d mandelbulb bump with ambient occlusion

Evilryu (quite active on Shadertoy) made a nice mandelbulb effect and I asked if I could get the normal map and ambient occlusion maps from it. Then these were combined by shortening the normals of the normal map using the ambient occlusion factor. Then afterwards this image was converted from true colour to 256 colours. Then we effectively have only 256 unique normals to shade for the image and hence it is resolution independent again. So 2 directional lights + ambient were calculated in palette space and it applies to the whole image using no effort. The image is 640x512 scrolled upwards.

I made my own color reduction algorithm so that I could theoretically also have many more properties such as position,specular,texture and whatnot reduced to 256 unique entries with 12 changeable entries per scanline using the copper. In the end I never made it that far. There is an effect not shown in the demo which I think may be seen if you type "eph-neonsky.exe -k -p head" if you want to see the "change colours" per scanline prototype. Unfortunately only 12 colour changes per scanline was too ugly and I have no good content to show this effect yet. However next demo there might be. I'm not afraid of any amiga coders stealing this effect because you are all being lazy :D

HAM8 logo
This is just showing a HAM8 picture from a set of pre-blurred HAM8 pictures. The logo is saying Ephidrena in Chinese (only the sound of it). Because I live in Shanghai. My idea was to use something like modulo to select differently blurred levels per line. However since all the images have different base palettes, this would not work so I had to drop it.

Sprite overlays
Hires sprite 16 color overlays. The resolution independent sprites are a nice feature. Nicely allocated from the system using GetExtSprite() before getting told I can't have sprite 0...!. Then poking into the system data structures so I can have it anyway letting the system know who is the real boss.

Other stuff

The effects use a lot of chipram because they use hires mode. So I quickly ran out of chipmem even after precalcing two of these tunnel effects. So I made a "system" of copying data back and forth between fast and chip ram. Next time I want to make it progressive as the chip copy can be noticed by a lag at the beginning of each effect.

The ancient startup code got translated from assembly to C (yes startup code in 100% assembly for historic reasons).

First Ephidrena demo to actually use Amiga hardware capabilities except what is needed for 256 color chunky to planar effects. Now there is some foundation code in place for making more use of it later. This was one of my main motivations for making this demo.

End of blogging!

menace - 10:42 30 January 2017 #

Final is out, check the download links above :)