Friday, July 31, 2020

Argus 3D

A night of spontaneous stomach twitches again, bah. A good day of work though, I managed to program the 3D display for the Costumes/3D objects in Argus:

These can be rotated too, the points scaled, or translated, and faces 'flipped' (inverted). I also carefully textured and designed the primitives that can be selected as standard objects. I imagine that the planes will be used almost exclusively, but I've created 12 objects: Plane, Two-Sided Plane (objects are one sided for speed, polygons that print anti-clockwise are not printed), Cube, Anti-Cube - an anti-cube is a box with only the inside walls visible. This might be useful for a 'room' or other backdrop. The textures here are wrapped on all four walls though, so I'm unsure how useful it might be. This is a 'flipped' cube, so might not be needed now that I've added the flip option.

I've also created a few spheres, two anti-spheres (these might be useful for backgrounds), and finally a Tetrahedron and Icosahedron which are textured in triangles rather than squares. Perhaps these would be useful for particle effects.

It's really hot today, but this house is cool. The Covid-19 news is bad, and, looking at the world, it's getting worse everywhere. It's amazing how complacent people here are, so many people ignoring distancing. I've not seen Deb inside since March, and at times it feels like we are the only ones being cautious and obeying the guidance. At least today, our decisions feel vindicated. I'm amazed that anyone would want to go on a foreign holiday this year or next. I'm also amazed that Japan delayed the Tokyo Olympics by a mere year when 4 years seems far more reasonable. If anything, I expect things will be worse next summer.

Thursday, July 30, 2020

Argus Sequencer

More programming today, and work on the main sequencer window. This is the most complex window, lots of graphics here. Last night I wondered about 'actors' that appear; when their modulator should trigger. Like a musical instrument, these should trigger once when they appear, but you should be able to move them afterwards, sort of like changing the pitch of an instrument after it is struck, while it is decaying, so I need two types of event to place actors; one to make them Appear and one to Move them but not re-trigger modulators.

In an animation this will make it possible to create an object, like an expanding ring for example, that is placed at a certain frame and it will animate (or move) all by itself. Another ring can be added later with ease, like a new note being pressed, rather than the need to reset the modulation/animation of it all. Creating a series of animated objects in this software will be as fast and easy as pressing piano keys. As you can see, my inspiration for Argus is music software.

After a week of intense work on this I'm close to being able to create a first test screen using 'real' objects.

Here is the software so far:

The sequencer displays really tiny events, one pixel wide per frame, and a mere 16 pixels tall per track/actor. This will allow a large amount of data and time to be visible in a glance. The details are rarely important, but a large overview is often very useful. Those websites that show page after page of 10 items per page are so inefficient and annoying compared to one that shows 1000 items all at once.

I'm not doing much other work at the moment. My every thought is Argus themed.

Wednesday, July 29, 2020

Event List and More

A full day working on Argus.

Task one was to work out how to load each texture once even when multiple objects might use it, and free and duplicate these correctly. This involved calculating a unique ID for each one based on the filename, identical filenames mean identical textures. This was quite simple and complete before 10am. The bulk of the many hours of today was taken up developing the Events List, which is hugely complicated and needs 100+ icons.

There aren't many types of Event, but unlike in my music software Prometheus, there are a lot of parameters per Event. We can tell an object (actor) to jump to a specific place at a specific angle, and specific size, alpha (transparency), and texture (frame). For the camera, we only have place and angle, and for lights we also have RGB data, and for all of this we have a bitmask too, because we can choose to tell the program to ignore certain data (which might be important if we record the movement of something in one or two axes but don't want to overwrite the data in other axes). It might be useful to be able mute and mask off these separate streams of data in future... I'm not yet sure, but the bitmask does add a layer of complexity to it all.

All of these possibilities makes for a complex interface. Lots of icons to populate and correctly turn on/off, and there are controls to add new events, delete and move them in the same time index, but not shift them absolutely (at least, not yet, in Prometheus this is strictly forbidden because notes can be modified by future events, here, there are fewer restrictions, so it might be fine to move events about.

A full, full day, and very tired now. I've had an email about displaying some art in Crewe Town Centre. The Coloured Earth Festival continues, I've had about 6 emails requesting review or Twitch copies of the newly released Taskforce, and the new paginated version of the Chinese translation of 21st Century Surrealism.

Finally, last night at 3am or so I developed the outline of a new album, perhaps P for Plastic, or P for Me. I'm so busy I need ten assistants and three brains.

Tuesday, July 28, 2020

Argus v014

A long day working on Argus. Quite a lot to see now:

These windows are are all functional. I had hoped to create the Event List and possibly the Sequencer today but this is so much work that it seems to be taking a day per window at most. I'll also need a Render window, I think, for which frames to save out.

Today I created the 'Costume List', which is the store for the geometry data. You can load this, although it's quite a convoluted way to do it, as only my editor can create the format, but it's really designed for simple planes which are presets. These can now be loaded in and a texture applied. I'm very close to the first actual real actor appearing in the scene. Currently there is only a test.

The day started with updating the fonts to work with the new expandable fairy system, I'm only using 11 characters, just numbers, it seems a waste of geometry to allow text to print on the main screen. Only the current frame will be shown.

This is so much work that I'm feeling overwhelmed and ill due to the stress, excitement, possibilities. I thought today that I could add an event that could trigger music too, which might be useful (although the software will output a stream of images only, not any audio). I'll work on the Sequencer tomorrow I think, and then the Event List. The big problem to solve is the one of textures, having several per object, that is the final unknown. All of the rest is worked out.

So much seems to be happening. A new online Coloured Earth festival started yesterday and I was invited to take part, I had lots of ideas for it, but have no time. Taskforce is moving on. A few friends are organising meet-ups, and and the Chinese translation of 21st Century Surrealism is proving problematical; this will be an e-book only now, but it appears that it hasn't been formatted at all.

I'm also full of music ideas. I thought that, to accompany the new electronic mix of Plastic Superman, I would remake an old tune called Opiad, which I recorded about 4 times in the late 90s but haven't touched since.

Monday, July 27, 2020

More Argus, Millisecs Per Frame, Silicone Guitar Picks

More programming here. The hard part is the distinction between 3D objects. Normally my objects have geometry that can change each animation frame, but textures remain the same, and objects are sorted by texture too, which can be used as a tool to print them in the right order. Now the animation will usually keep the same geometry but change texture each frame. They are essentially two types of animation, they could even animate independently (geometry changes, texture changes) so I'm storing both frame numbers separately. I'll keep the possibility of geometrical changes but won't immediately use it... this software is designed to change the texture-per-frame.

I'll need to load the geometry of the objects without storing that in the vertex buffers because the creation process will involve loading and toying with the 3D 'actors' before (and after) we see them moving in the scene, and this data (and the textures) can only be loaded when the 3D scene is set up and is destroyed when the 3D scene is destroyed. My current fairies (my word for design of a 3D object, a pun on sprite) are in an array, I'll need to put them in a linked list too. In a game, an array is more efficient because we know exactly how many we will use per game, but here this quantity varies on a project-by-project basis.

One problem was solved today. I needed to work out the timing. A game is normally updated 50 times a second (every 20ms), but we're animating here, so I need to update at the correct frame rate, which can vary, eg. 30 frames per second. There is a high-resolution timer in Windows but it's slow and, I think, overkill, one millisec here and there per frame is immaterial - the inaccuracies only mount up over long periods. I'd rather use my fast and neat timeGetTime() function, but this only operates in millisecs not fractions and 1000/30 (for 30 frames per sec) is 33.3333... millisecs per frame. We also have the possibility of other complex frame rates, like 29.97 frames per sec, to cope with.

So I needed a way to flip/flop the right frame, keeping track of the remainder so the frames would (here) be 33, 33, 34ms all nicely. The code is actually quite simple, it's just a matter of keeping track of the remainders.

fliptimefloat+=msperframe;
fliptimeint=(int)fliptimefloat;
fliptimefloat-=(float)fliptimeint;

fliptimefloat would keep the remainder, while fliptimeint will be the number of millisecs to wait, so when msperframe=30 then fliptimeint would equal 33, 33, 34, 33, 33, 34... as desired. Yay!

I've also had to revisit my vertex shader code (which is years out of date, I use DirectX9). Here is a snippet of the lighting calculations (with a fading radius, which I won't use):

; Light 1: Get direction to light
sub r4.xyz, c[13].xyz, r2.xyz
; LIGHT: normalise light direction and calc lighting
dp3 r3.x, r4, r4
mad r3.x, r3.x, c[13].w, c[13].w
rsq r3.x, r3.x
dp3 r4.w, r4, r4
rsq r4.w, r4.w
mul r4, r4, r4.w
; Put diffuse factor into r4.x
dp3 r4.x, r1, r4
; Limit r4.x to positive (c[0].x=0)
max r4.x, r4.x, c[0].x
mul r4.x, r4.x, r3.x
; APPLY (objectcolour is ignored): Result = (objectcolour*r4.x)*lightcolour
mul r5, r4.x, c[14]

As you can see it's rather assembler-ish. I don't mind this, I grew up coding is pure machine code, but I can't decipher most of it now. I'll be using 3 lights at most. My engine can cope with more but few animations will use more than three lights, and every extra one will slow it down for everyone.

In guitar news, I've now played every day this month to an album in my collection and have gone through all of the Electric Light Orchestra catalogue, all of the 12 Bowie Albums I have, a few Beatles albums, and the eponymous Roxy Music. I wondered if a chunky silicone pick, like a domed pastel shader, would work. It would stick to the strings a little, like fingers (that is the idea) but, being held, might be faster and easier to play than using fingers. The soft sound and feeling of fingers is so different from using a pick. I wonder how a metal dome would work.

Saturday, July 25, 2020

Argus v009

A full day's work on Argus, my animation software, today, largely with very little to show for it, lost of tidying the code, adding lots of defines that should have been in Prometheus, if I had programmed that today. Mostly working out the G.U.I.; which icons need designing, layouts of windows and creating/destroying a few necessary structures and making sure it works, which has taken many hours.

My main issue with how it works now concerns how to load objects with multiple textures; one texture per frame. All of my 3D work until now used only one texture per object, never several. Any texture animation would have been done with a strip effect, although I've rarely animated objects anyway; only in Taskforce and perhaps, Trax, I can't remember. These need to be loaded whenever entering the 3D mode, and freed when exiting it. They can't be saved in 'film files' or included in data structures, only the filenames can, so it makes everything a bit complicated, with a unique filename and filepath per frame, as well as system objects like the mouse pointer, which is also 3D. I think this is is the last remaining hurdle to solve.

Also watched Dambusters, an almost 3-hour film, and reminded how good it is; and how similar to Star Wars. The tension as the bombers take off for their mission is considerably greater than the tension before the Death Star raid.

Friday, July 24, 2020

Taskforce Launch

Taskforce launch day today, process complete, newsletter emails sent, announcements made. A few requests for review and/or stream copies. Now I must wait.

More progress on Argus, tidying up the code, and re-adding size to the 3D engine for the first time in years, but the process is making me very anxious because of the possibilities and huge complexity of the system. The next step is to create and populate the G.U.I. windows. I've worked out some sizes for these, but I must be sure before I start because changes later will be time consuming and awkward.

Thursday, July 23, 2020

Conan

Awake for much of the night with stomach pain which has grown over this day. These infernal twitches. The pain, tiredness, weakness has been too intense to focus on work, but I've pushed on with some design of the Argus G.U.I. layouts and started some preparation work for the Taskforce launch tomorrow.

Awake in the night, I listened to one of Beethoven's Late Quartets and fantasized about a version on four electric guitars, which is probably trivial compared to the actual string instruments. I played electric guitar last night along to Beethoven's 1st Symphony, which was fun. This is all good practice.

I wrote a song in the night around a guitar riff I played ages ago. Here are the words:

Face to the storm
Tied to the tangled tree
Chained to the rock
Taste of the screaming sea

Always about to fail
Always about to die
but surviving

Facing the void
Blood in the whistling wind
Crows in the sky
A future of why why why

Always the need to fight
Always about to die
but striving

I am Conan
We are Conan
All the world has become barbarian