Skip to main content.
January 30th, 2006

Lot’s to update about (matrices, widgets, RAIDs !)

Last week, snowed in Tokyo !

Recently I had an hard-disk crash. Was the main HD of the server (mostly just the OS). It was a Maxtor (ehh !).
In light of that, I went on and bought a TeraStation. It’s a NAS (Network Attached Storage). A stand-alone system that holds 1 Terabyte of data on 4 250GB hard-disks.
Cool, but, I did the mistake of using it as RAID Spanning. Only later I fully realized that RAID Spanning is for speed and nothing else: it slices files in blocks of 8KB and spreads them on all the HD’s of the RAID.. without any parity ! I just wanted the RAID to be a continguous 1 TB of storage, no striping. I figured that the important data could be backed-up independently,
Apparently that’s not possible, so now I’m going to move data out, reformat the RAID as RAID 5. With RAID 5, 1TB becomes 750GB with parity, if one HD breaks, no data is lost.

I recently, succesfully used DSharingu to do mainteninance on my sister’s computer. It worked well, although some problems arised with her wireless LAN connection (what was the cause it’s beyond me !).
I’m working on a rewrite of the GUI. Moving onto wxWidgets. I don’t like wxWidgets reliance on inheritance. It’s actually a pain in the ass. The event table thing also looks kind of lame. But it’s the best option out there and I certainly prefer wxWidgets to MFC or plain Windows GUI programming.
I’m actually just trying to get a toolbar and other things like that. Nothing too fancy, functional stuff.

At work I finally re-implemented my spherical harmonics routines. Code written for PS2 has been ported on XBox 360. VLC asm to HLSL (high level shaders language, looks very much like C, practically same as Cg. Speaking of flakiness of memory.. I actually forgot in the process to properly port some code that was doing space transformation. That was something I had problems with in the past, a problem that I spent some time trying to solve, and then I completely overlooked it recetnyl as I was porting. Basically I had to “sandwich” a matrix between object<-world and world<-object (inverse of former), but, of course, I forgot that and started having problems.
In detail, the spherical harmonics matrices of the light-map were calculated in world space. To move them into object space, it goes:

obj_space_light_mtx = object<-world_mtx * world_space_light_mtx * world<-object_mtx

It’s 2AM.. we zzzzz !!!

Posted by Davide Pasca as Programming, 3D Graphics, Diary at 2:09 AM EST

5 Comments »

January 18th, 2006

A different 3D programmer.

Luckily, I’m in a stage at work where I get again to actually design something, rather than rushing code out of the window.
I’ve continued to develop on M4D, but now I’m at the point in which M4D also has to produce some performing rendering.
M4D was meant to be some sort of scene graph. Also with code to deal with geometry more like a 3D creation software and less like a game engine. In fact, I’m convinced that I need to push the idea of creating code that helps to create 3D scenes, rather than a simple playback.. where one takes a scene created by an artist with a 3D package and attempts a faithful playback of the animation and quality of rendering.
I don’t want to create a new POV, but POV surely gives a hint to what 3D graphics can be about: coding and design can and should go along.
Nonetheless, I need to pull out some decent real-time performance, and so I’m working on a renderer interface for M4D. M4D gets to the point to generate vertex-packets and triangles. Where for a vertex-packet I mean a vertex which has all the attributes so that a triangle is defined only by three indices.
Further from that step, there is the actual geometry feed to the basic 3D API (OpenGL for PC and Direct3D for XBox 360). Vertex format, vertex streams and material selection.
M4D’s meshes, particle objects, materials and textures, have parallel objects on RendM4D (the rendering interface). This seems almost suitable for inheritance.. but not really ! Or at least, I can’t imagine it working.
I have M4D::Scene and M4D::Mesh. Now, with inheritance, I would end up with a RendM4D::Scene and RendM4D::Mesh. The problem is that, M4D::Scene and M4D::Mesh are directly related. A M4D::Scene links a bunch of M4D:Mesh…
For that reason, I went on to link renderables dynamically.

class M4D::Mesh
{
    void    *_client_objp;  // store here the pointer to RendM4D::Mesh
    …
};

class M4D::Scene
{
    void    *_client_objp;  // store here the pointer to RendM4D::Scene
    …
};

class RendM4D::Mesh
{
    M4D::Mesh *_base_meshp;
    …
};

class RendM4D::Scene
{
    M4D::Scene *_base_scenep;
    …
};

M4D::Scene and M4D::Mesh both have pointers to generic client objects (in this case the equivalent RendM4D objects). RendM4D::Scene and RendM4D::Mesh have the pointers to the original objects.

Now, a RendM4D::Scene can scan the scene tree by _base_scenep, which gives a bunch of M4D::Mesh, from which one can get the relative RendM4D:Mesh.
Seems like a bit of work, but it doesn’t get much simpler when dealing with dynamic links.

I also added callbacks for deletion and changes. For example when an M4D::Mesh has its geometry changed, it will call the OnModify() call-back routine with the given client object (the RendM4D::Mesh pointer).
In my case OnModify() points to a RendM4D method, and the client object is still the RendM4d::Mesh pointer. So that the renderable knows when source object’s geometry changes, and can update itself.
Same goes for the object deletion. A delete M4D::Mesh, will trigger an OnDelete() callback, which will call the relative RendM4D::Mesh and tell it to delete itself

I have a callback from the bed… time to sleep !

[Edit: I had forgot to specify _base_meshp and _base_scenep as pointers !]

Posted by Davide Pasca as Programming, 3D Graphics at 2:16 AM EST

5 Comments »

January 12th, 2006

Time time time !

It’s already 2AM and I must go to sleep soon !
Yesterday (or was it two days ago ?) I released the 0.2a and today the 0.3a of DSharingu.
The new version allows for remote control through the mouse. A problem arises when opening a modal dialog on the remote’s instance of DSharingu. For example, one clicks to bring the Settings dialog. Being that a standard modal dialog, the application will stop waiting for it to be dismissed.. therefore not sending screen updates. So the remote can still move the mouse (mouse input is running on a separate thread already), but can’t have visual feedback !
It’s not a major issue, but it needs to be solved. The solution is to run a separate thread for the screen-grabbing and sending system.
Screen grabbing is done with DirectDraw. That’s the only place where I use DDraw, so I don’t really need to share any of those COM objects. Data transmission however is based on an API layer of mine.. which inevitably needs to become multi-thread safe.
So far I’ve been using Win32 mutexes, however, I’ve been reading that the Critical Section method is possibly better. Performs better and it runs in user-space (doesn’t put on hold other processes, like I feared it would do).
I found a nice system, involving a couple of classes and a macro 8) on The Code Guru. It’s nothing too new, but a nice way to minimize the code modifications.

Yesterday I went to the gym, after probably 2 weeks of absence.. and I was 70.35 8) That’s not bad at all. It comes to reinforce my belief that it’s the forced daily lunch routine what really makes me fat (recently, I had several holidays).

Better go to sleep now !
zzzzzzzzzz

Posted by Davide Pasca as Programming, Diary at 2:19 AM EST

2 Comments »

January 8th, 2006

DSharingu, not-DKurabingu, keeping the brain switched on.

It’s 4PM and I just woke up…. another night spent… coding ! 8)
The plan for yesterday night was to go out partying, but people around me seem all to be getting towards the age of marriage. That and other things.. but mostly it’s all about women. It’s the women that really dictate men’s behavior !
It’s however, important to be able to take the best out of any situation, so I decided that perhaps the night was intended for coding, and so I proceeded until 8PM.
At this stage with DSharingu, I have several things to rewrite. Yesterday night I went about the Settings dialog. It was initially built using some sort of automated system to create a dialog and save settings data in a config file. I trashed most of that. I kept the file saving routines but, for the GUI, I reverted to the good old Windows Resource Editor and WM_COMMAND switch-case.
The idea of an automated dialog maker is nice, but there are just too many exceptions for the use I need to make. I don’t want to have too many dialogs. The few I have also have to be simple. Building and expanding a whole system to do all that is just overkill.
I’m pretty close to release the next version. Basic features are there and it’s probably time to go back to compression and iron down those special cases where bandwidth is an issue (the whole screen transmitted is a 280KB transfer !).

I really want to make a new release and let things go by themselves, so that I don’t have to keep answering to people that ask me “why are you doing it ? There must be already other products like this around !”. Recently I’ve been somewhat moody.. and one of these days I may come up with an answer along the lines “why are you living ? You are just another human among billions on this planet !”.
What I think pisses me off, is the fact that people have this tendency to want me to become a user. I want to be a developer at all costs. Life as a user is boring to me ! Make me write the software I want, the software I need as a user and as a learning developer. Sometimes it’s good to “reinvent the wheel”.

Now, back to the “not being able to go partying issue”: I think that what upsets me there is that I project myself in the shoes of the pussy whipped friends. I see them wasting a great deal of time doing stupid things (shopping, generally living as a couple) and then not being able to be themselves. Having to hide truths, even cheating on their girlfriends (at least until the woman gets a real grip on them). I see myself in there (cheating aside, fack lies), seduced by a girl to embark on a family life with things to do, jobs to hold onto, money to make, screaming kids, women telling you what to do and what to wear ! In this society, women are obsessed with their looks and they will project that on men. Here in Japan I see a lot of men turning faggy. Those so-called men, spend countless hours browsing fashion magazines, messing with their hair and putting shit on their faces. I worry about my looks too.. but women can turn your worries into paranoia. They spot a defect, make you notice, and then you spend a week or even a month in front of a facking mirror !!
It’s OK to be honest, but one should also try to be more supportive. If you think I have an ugly face, tell me I have nice hands.

So, when I talk to a friend, it’s OK to exchange some anecdotes about family life, but eventually I want to know what he has been coding, doing, realizing. I want to talk about productive topics, not chit-chat about mundane bullshit. I can do that with everyone.. my brain needs real stimulation !
I learned a couple of years ago to always bring either an MP3 player or a book (usually both) with me.. you never know when someone will start boring you to death. I hate people that make me waste my time. Time is the most precious thing.

Posted by Davide Pasca as Programming, Society, Diary at 5:27 PM EST

6 Comments »

January 4th, 2006

Quick update about DSharingu

dsharingu/dsharingu_06_01_04.png
It’s past 5 AM. Today I dedicated quite a bit of time to DSharingu (still old release). I finally got some interaction going. The screenshot shows the view that I have of the home server on the PC in my bedroom. I launched Firefox remotely and browsed around.
It took me some time to get to the right function.. SendInput(). Once I found out about it, it wasn’t too hard to use it. However there is still a problem: when interacting with the remote DSharingu window, the remote instance locks !
I think that it’s probably due to the fact that the main loop receives input event remote messages synchronously. So, I tried to relocate the network message input system from the synchronous main loop, into a separate thread. That should solve it, but I’m still not done. I really want to use multi-thread only for those messages that need it, the simulated input messages.
Compression needs more work. I have some interesting ideas, but right now, I want to focus on basic features… optimizations can wait.

I also modified my windowing system. I no longer simulate sub-windows (like the translucent shell frame form the previous version). Every sub-window is now an actual Windows’ child window. This saves me a lot of work… I like to do some basic wrapping, but it’s too easy to fall into the trap of wanting to write a whole sub-OS. Right now, I just need to get things done !

Thanks to my friends in Italy (Jag and Rasty !), my family is getting back to wireless Internet use. Now, more than ever, I need this remote administration thing. Once all features are up (no self-locking and keyboard input), and once things are optimized for the right bandwidth, I should be able to remotely show and fix things !

The program as it is now, will allow me to accept connections, because I have full access to network ports at home.. however, this may not work in the office, where I’ll be firewalled like my parents are.. both can call out, but neither can accept a call 8(
For cases like that one, I plan (hopefully with some help !) to convert DSharingu to work as a Skype plug-in. Skype is very flexible, making it easy to transfer data without having to worry about firewalls.

We’ll see !
zzzzzzzzzzzzzzzzz

Posted by Davide Pasca as Image-processing, Programming at 5:44 AM EST

11 Comments »

December 26th, 2005

Quick Christmas report (code code code)

I spent the whole day at home, coding ! Actually coding and preparing stuff for a release. That included working with the installer and looking into Wordpress features to make pages for static content. Basically a page for a project, separated from the blogs posts such as this one.
With those changes came also a change to the site URLs. Gone is the /?page_id=111. In it’s place there are now friendly names.
What I’m trying to release is dsharingu. The page is up, the software can’t be downloaded yet !!! It would probably be already up for download if I didn’t need to spend those extra hours to document things etc etc… but a software by itself doesn’t have much use.
Yesterday night, after a small Christmas dinner, I also worked on yet another compression scheme do be used for DSharingu. I basically put aside the HSV concept for a future better use (video-chat) and went for a simpler and faster system. The new scheme is inspired by systems such as ST3C. Also somewhat similar to BTC (Block Truncation Coding). But really, all compression schemes start to look alike after a while !
Anyhow. The basic compression is pretty much decided for the time being. Before the release however I want to modify the protocol a bit.. actually putting in place a minimal system that has a concept of protocol revision, to avoid weird crashes between different releases of the same program.

I want to hurry up, but I also have a lot to do. Tomorrow I’ll continue. I hope that in a few days I can finally release something… if anything, just to release it and see how it goes from there !

We zzzzzzzzzzz
poof

Posted by Davide Pasca as Image-processing, Programming, Diary at 2:01 AM EST

1 Comment »

December 8th, 2005

Printers, errands and coding

Today I went to Akihabara to buy a printer. Last time I bought one was a long long time ago. I was in Italy and my father bought it for me. In fact, I must have been 16 or so ! It was a Commodore 803, or something like that.
Now, I need to renew my passport, and I really hate the idea of taking one of those lame instant photo-booth pictures. So… yesterday I spent quite a bit of time trying to take a decent shot of my face, and today, I bought a printer.
Anyhow, since there doesn’t seem any decent PDA out there (to me a PDA should be more like a notebook and less like a fat media-center), I think that a printer will be useful for those times in which I want to print some PDF at home, or even a quick map to carry around when going someplace.

Tomorrow I’d like to go to the Italian embassy to renew the passport, but the embassy’s site appears to be down.. so, I have no idea of where this damned embassy is located.
Why is the site down anyway ? Someone must be on strike. In Italy there is always some strike going on. But in this case we are talking about technology (the web.. woohooo !!), so it’s obvious that there is also some other incompetence involved. After all, last time I saw the site, it surely didn’t seem like something very refined (to put it mildly).

About coding.. I’ve been trying to push forward the latest version of RemoteDest, actually now called DSharingu (like the Japanese flavored name ? 8). It’s a complete rewrite. It has come slowly, but it includes a lot of recent stuff that I’ve been doing left and right.. some application-building base code.
My main push in all this is the fact that I want to remotely admin the PCs of my family in Rome, but the provider they use, blocks all ports in input (again, great country and all). That rules out VNC, because it’s based on a server & client architecture by which who shares the PC needs to be able to accept incoming calls on a certain port. In my case, I’m making it possible for my parents to call me and share the display of their PC at the same time.
Another thing that pushes me is, of course, pride ! I’ve been working around this stuff before VNC came out (I think)… I do have something in my hands, it would be lame if I had to give up to some other software.

Speaking of VNC. I did a quick research, and it seems that its compression scheme is not very sophisticated. Apparently it now uses the ZLib and one can choose the compression level based on the ZLib compression level. If VNC’s compression scheme setting relies on the parameter of ZLib, then it means that it’s not that sophisticated.
For example, JPEG images also have a last step of entropy compression. JPEG uses Huffman encoding there, but that really is last step, while the bulk of the compression is somewhere else (transformation to frequency domain and quantization).
I think that there is a lot of room to improve image compression of a GUI display. Many clever things could be done.. and also one should normally deal with lossy compression, because speed is really the main factor when it comes to administer a remote computer.

Currently I’m applying transforming RGB to a luminance + chrominance system, that I simply call YC. It’s simpler than YCrCb, definitely similar to HSL which I’ve been playing with in the past.
One problem with working with RGB with modern displays, is that things such as CoolType and ClearType, juggle around with R, G and B a lot, making it hard to compress them individually.

For the time being I’m posting a screen-shot, although tonight I already successfully set-up a simple installation process using NSIS (great stuff).

dsharingu/dsharingu_05_12_08.png

And.. 5AM… maybe better go on with a morning of errands and go to sleep in the afternoon !

Posted by Davide Pasca as Image-processing, Programming, Diary at 5:19 AM EST

No Comments »

May 17th, 2005

Frequency domain’s dreams and normals’ tidying

Yesterday (Monday) night I dreamed that the World was reconfigured to work in frequency domain as opposed to time domain !!
This brought some changes. It all started with a centered white spot, plus some extra spots. A bit like when one visualizes an image that has been transformed with the FFT (Fast Fourier Transform).
It was mostly like seeing a cheap sci-fi movie. Not really interesting from a purely scientific point of view. Still, it was a clever dream to have in a sense 8)

I did more research about reading 3DS objects with faces being properly ordered.. and found out that I wasn’t doing anything wrong. The problem is that AutoCAD’s exported files have no sense of faces’ orientation. In order to render those objects properly, one has to render them with faces as having two sides.
That requires some extra rendering time, but also prevents from properly creating smooth vertex normals !
So, I wrote some code to fix the faces normals. The code works on the assumption that objects are closed. For each face, there must be a corresponding one that covers it. With that assumption and lots of ray-tracing activity, I can give the proper orientation to the faces. There are however a few exceptions 8(
Instead of trying to analyze the exceptions, I decided to manually fix those last few faces. The next step is to write an exporter to a common 3D object format (AC3D seems good), so that I can import the processed objects in Blender, modify the faces’ orientation by hand and then export the final objects. Hopefully by tomorrow I can finish that (yeah, right !).

More things to do: continue my mother’s website. I’ve been looking around for a simple BBS script, and it seems that only Japanese care to make simple BBS scripts. I’m planning to download one of those and adapt it to English/Italian.

Finally, I’ll also need to complete the first release of the video-chat app. Dind’t do any work in that sense. Although today I read some docs about neural networks applied to image compression. Interesting stuff, but I don’t know enough about neural networks to even start experimenting.. plus, that’s definitely a distraction, something diametrically opposed to the goal of releasing a working program 8)

Posted by Davide Pasca as Programming, 3D Graphics at 2:38 AM EDT

8 Comments »

  Next Entries »