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 »
Today I picked up some work about walkchurch.
My goal continues to be to calculate only indirect global lighting. Basically I want to calculate some fancy ambient lighting to be added to normal dynamic direct lighting + stencil-volume shadows.
As I wrote before, indirect lighting, light that comes reflected by a secondary surface (like the Moon), has a rather low spatial frequency. The shadows that it casts aren’t sharp. It’s mostly about distributing a tint. For example, in a room with a red wall and a white floor, a light hits the red wall, making it “bleed” into the floor that will become reddish (this is more important than it seems !).
To calculate indirect lighting, I’m still going to do some sort of radiosity. Tesselation doesn’t matter as much, but still a decent level of subdivision is needed. I currently subdivide large triangles recursively. I split in half the longest edge, then see if any of the resulting two triangles need to be split again about their new longest edge.
Tesselating like this is very simple and also consistent, meaning that it doesn’t create any new T junctions.
Normally when one tesselates, should take care of not creating too many vertices. Ideally one should cut an edge using only one new vertex for two triangles share that edge.
I did some research about this. Some structure called half-edge seems to make it easier to deal with edges.. however it seemed to be more trouble than what is worth. So, I decided to split triangles individually, creating many duplicated vertices and eventually remove the duplicate vertices in a second pass. It’s just simpler this way, at least for the time being !
In order to create a first radiosity hit, I’m going to render the scene from the light source point of view with triangle IDs.
walkchurch/triangle_ids.png Then I’ll read back the frame-buffer and see which triangles are receiving the light. Color them with the light color and proceed onto the goal, to calculate the indirect lighting.
Again with the red wall and white floor. The red wall gets the light energy, while the floor gets the energy that bounces from the wall (namely light frequency mostly in the red spectrum (that’s the meaning of something being red !)).
Along with the triangle ID rendering, I implemented the object ID rendering. Useful to detect which objects are visible by the light source (will be useful later when calculating shadow volumes). In the picture, the scene is seen from the light source, red objects are hidden:
walkchurch/desk_hidden_objects.png
I did a test with the triangle IDs. I find out which triangles are hit by the light. Color them gray (could be any color) and render again the scene form again from the same light source point of view. They have to be all gray and they are indeed (except a few pixels by some weird artifacts). As I expected, when I render the scene at an higher resolution, triangles that weren’t previously visible, suddenly become visible (marked in red):
| walkchurch/visible_polys_11.png
|
walkchurch/visible_polys_zoom.png |
The reason is that the triangle ID test is performed off-screen at 512×512, and some tiny triangles aren’t rendered at all. When I render at higher resolution, some of those will become large enough to be visible.
This would be ugly if I were trying to make direct lighting with that system. However, indirect lighting of diffuse surfaces is a low frequency issue, and I expect to be hardly noticeable if a few small triangles don’t bounce back their portion of light.
Lezze zzzzz on this !
Posted by Davide Pasca as 3D Graphics at 1:17 AM EST
6 Comments »
Recently I took a break from the book The Road To Reality, after reading a chapter about tensor algebra using some sort of diagrammatic notation (looks like hieroglyphics !!). I’m around page 250 and for the good last part of what I read, I felt pretty lost. It’s a bit like when I get one of those Japanese comics and I understand a word every 10: frustrating !
I’m strongly convinced that it’s not possible to really learn something out of math or programming, without actually putting things in practice, without exercises. One can’t go form the Plato to tensors in 250 pages without proper exercises.
So, a couple of weeks ago, I silently went back to the book store in Shinjuku and looked for an English book a little more specific to math study. There I bought Introductory Mathematical Analysis. I’m very happy with it ! It starts really from the basics, explains things in detail, gives formulas and a good dose of exercises.
Currently, I take about 20-30 minutes everyday at lunch break to do the exercises. I’m at the start, where I mostly need to refresh algebra rules and go about the exercises. Trying to become fluent in manipulating powers. I normally should know the power rules, but I never really did enough exercises (powers of 2 aside ;).
Knowing things in theory, again, means really nothing to me.. if one day I need to solve a problem at work, and I get stuck on some equation because I don’t have the confidence to solve some passes automatically.
To be useful, knowledge, should be readily accessible. It’s important to be able to think things through every time, but it’s also important to assimilate some things, in order to focus on more complex issues. That’s my final goal. I want to progressively move onto things that I understand fully because I have a solid background. I don’t want to have to swift through hundreds of pages of a book that tells me “don’t worry if you don’t understand this, and this and this”. Fack that ! I worry !!
Now, changing subject… yesterday (Sunday), my friend Marco invited me to his apartment to do something that we planned to do for some time. We are both fans of spaghetti Western movies (especially those by Sergio Leone). I once mentioned the fact that my uncle, when younger, used to sometimes watch those movies while eating beans with a wooden spoon.. they way they do it in the movies !! ..It sounded like something we had to try and so we did, yesterday 8)
I used the cell’s camera to take a few shots (bear with the quality !). I took the best shots and created an album in the gallery. I tried to be clever and I called it: The Good, The Bad and The Hungry.
Enjoy 8)
P.S. I’m going ahead and answer the most pressing question: my flatulence situation did not really change that much.. the same can’t be said for the host, which had a few good ones. Luckily he has been kind enough to either change room or warn me with a safe margin of time.
Posted by Davide Pasca as Diary at 1:33 AM EST
6 Comments »
xbox360_xmas_2005/D1000004.JPG
Working for a relatively small company has its down sides. I remember in Squaresoft, we’d go to the E3, get cool unique stuff that Final Fantasy fans would envy !
However, one still deals with bigger business which, in turn, can lead to some fun 8)
Without any previous notice, yesterday I was invited to the XBox 360 Christmas party at the XBox 360 Lounge. Some sort of X-Headquarter in the Aoyama area in Tokyo. The party was private, free drinks, free fancy cold-buffet foods (looked too complex for me to try to eat), Santa-dressed waitresses and a short speech.
At one point some dancers appeared from behind a glass on a higher floor of the lounge and suddenly we were in the middle of a performance. I probably spent most of the time trying to understand how to work the new camera-phone. It was a daunting task.. to try get a decent shot of dancing girls in a dark environment under shining spotlights, people’s heads everywhere. Still, I could take a couple of decent shots (lots of noise on the images.. some day I will try devise a filter for that !).
Unfortunately the pictures don’t show one funny highlight. At one point dominatrix dancers took two guys from the public, put them on-stage. One was “forced” on his knees, the other I don’t remember. People were sort of amassing towards the stage at that point and it was hard to keep track of things ehehehe
Microsoft entertainment department in Japan has always gotten at least one thing right: the girls ! Unlike the US, Japan (like many other non-puritan countries) is a lot more open to the idea of associating entertainment and women. One may say that women become objects at that point. Perhaps, but those girls performing must also be considered as professional dancers that like to take care of their bodies and put them on a display. How the public decides to watch them, it’s a different matter.
Anyhow.. enjoy the pics ;)
Posted by Davide Pasca as Diary at 8:15 PM EST
7 Comments »
Today I went back to work ! There is already something to fix, but luckily, not a terrible pressure.
I also went to the gym after having missed it a few times recently, as I was enjoying my vacation. I now weight 70.75, which is 5 grams more than where I’m supposed to be in 3 days …but I didn’t go to the bathroom for the day !
Not having had to go to work helped to lose weight. I was so busy with other things, and because I had no schedule, I wasn’t compelled to have a damn whole lunch every day while having plenty of time to sleep. Indeed (for what is worth it) I recently read from ansa.it that some research says that lack of sleep and weight gain go together.
The other day I tried to improve the compression for dsharingu. As usual, sub-sampling the chromatic components spatially (one pixel every 4). However that turned out like a complete mess. ClearType & co. is a problem, as expected. It’s like noise that needs to be filtered out, or will turn nasty when compressing. Also my naive YC format didn’t really scale well with spatial sub-sampling.
I eventually turned to HSV (Hue Saturation Value), which is another name for HSI (Hue Saturation Intensity), but which was originally called HWB (Hue Whiteness Brightness).
I actually wasted a lot of time trying to find out more about HWB, before realizing that was nothing but HSV !
One problem with this HSV (or whatever one calls it), is that it’s not explained in a very intuitive way. Or perhaps I’m just dumb ! Anyway, I eventually figured out the magic about it:
For RGB->HSV, find the maximum and minimum of the given R, G and B, values. Use the maximum value for V. Saturation and a third value (that I call T here) are coefficients to use to find the other two values. If, for example V is for R, then S and T are used to find G and B.
When going from TSV->RGB, if R was the max, it could be:
R = V
G = V * (1 - S * T)
B = V * (1 - S * (1 - T))
This is what I called TSV and it’s not very useful because it still needs some information to specify which value was the max and which was the min ! If for example, G was the max, then:
G = V
B = V * (1 - S * T)
R = V * (1 - S * (1 - T))
This information needs to be stored. Let’s say in a variable called P (as permutation or palette). Every value of P corresponds to a combination: RGB, GBR, BGR, … there are 6 of them. All possible combinations of 3 values are 3! (3 * 2 * 1).
Now we have a new, complete, color format called PTSV. This is pretty much HSV. In fact, P and T can also be unified in one variable:
(H,S,V) = ((P+T),S,V)
This works because T = [0,1) (or, from 0 to 0.999999~) and P = { 0, 1, 2, 3, 4, 5 }
Thus, the integer part of H tells me the permutation and the fractional part is T.
P = trunc( H )
T = H - trunc( H )
if H = 4.51, then
P = 4
T = 4.51 - 4 = 0.51
..it’s a bit messy. I prefer to think in terms of PTSV.
I must say that, to be accurate, the actual H should be an angle, therefore T should be interpolated angularly and not linearly !
However, speed is one of my major goals. Also, if one really wants to get fancy, it would probably be more elegant to throw in the complex plane to describe the color format. Not sure if it has been done, but I’m clearly no the one that will try do that.. at least for the time being !
zzzzzzzzzz !!!!!!!
Edit: Sad !!! I shouldn’t have rushed to explain something I don’t really know..
I meant to come up just with the P and T separation thing, but I went to explain a little too much, into the realm of bullshit.
Actually, with the previous explanation, it was easier to understand the concept of storing a main component and two coefficients, but that was a bit too fictional when compared to the actual HSV.
Should be better now !
Posted by Davide Pasca as Image-processing, Diary at 2:31 AM EST
6 Comments »
This is probably already obvious, but it came to my mind only the other day: Apple computers moving to Intel chips is the smartest move.
I figure that my computer-illiterate family would be much better off with a Mac, yet, software traps everyone !
My sister has to use AutoCAD for her studies. A cool new program comes out and it’s most likely to be running for Windows. As a developer, PC gives more opportunities… but most users are probably better off with the Macintosh.
Currently one can install and run some versions of Windows, using some emulator. However that’s also a CPU emulator. Something that sensibly degrades performance (forget using AutoCAD !).
On an Intel-based Mac, in order to run Wintel applications, emulators will simply have to implement the virtual machine functionalities, without the burden of emulating a modern CPU. This is something that VMware and Virtual PC are already doing, and I’m betting that at least VMware is already a Mac-Intel developer…
Posted by Davide Pasca as Uncategorized at 6:05 PM EST
5 Comments »
The three things in the topic are completely unrelated.. other than the fact that all more or less happened in the same day to me 8P
Thursday night I went with a friend (Sergio) to watch Paul van Dyk performing. He’s currently the number 1 DJ in the World and I think that the deserves it. Surely more than Tiesto, which doesn’t seem like he’s released much in a while (and has been no.1 for a few years already). Compared to Armin van Buuren, PVD’s performance was definitely better. Armin is great with his weekly A State of Trance Internet radio program, but during the performance, he tended to fill in spaces with a bit too much techno for my taste (boom boom boom boom).. while clearly the cool thing about trance is the good mix of melody and ambient-like-whatever-feeling.
Curiously Mr.Van Dyk had friday scheduled to perform in China. Spending the night out wasn’t much of a problem for me (still in vacation), but my friend had to work the next day. Actually I was also to wake up early the next day, so we both left relatively early (3-3:30 AM).
I wanted to take pictures, but my digital camera is kind of big (not an ultra-compact) and my cell-phone camera half-broken. So, I decided to go forward and buy a new cell-phone ! I went a shop near my home.. that took courage, because I had to switch service, and generally talk to the clerk/owner in Japanese. It all went smoothly, the owner was really kind, however, because I didn’t go a a specific big DoCoMo (the carrier) center, it turned out that I could only pick up the phone the next day 8(
I ended up going to the club with the old (and facking big) cell-phone.. I tried to take a few pics, but the camera quality worsened to an unusable level. What a shame.
Back home, slept, and woke up today (Friday). Early, because I had to go to the Italian embassy (a bit of a mission to find the location, since the web-site recently moved). I didn’t mind to wake up early as it was yet another sunny day. At the embassy.. I felt a bit of Italy again. The clerk was smoking a cigarette all the time, although, as far as I know, even in Italy now that isn’t allowed.
It takes a bit of effort to adapt from the super-polite Japanese manners to the less sophisticated Italian ones. But one can’t really complain.. as long as the clerk uses a polite language and smiles at you at the end, one can’t really complain about the general feeling.. although form my point of view, people that work with the public should strive for maximum politeness !
Done at the embassy, I spent some time shopping. I went to GAP in Shibuya and also checked the new Apple store right in front of GAP (I really don’t like the feeling of entering an Apple store though !). Then I went to the Segafredo cafe (where the only voice one could her was one of some AMERICAN GUY, THEY GENERALLY SEEM TO TALK VERY LOUD FOR NO SPECIAL REASOOOONNN !!! ..There was also an Italian guy giving language lessons in the same cafe. He was was not as loud, but I could still distinctly hear him).
Then, finally, in the evening I went to pick up my cell-phone. And… it’s great !! (English and official site, and some extra shots, mine is white). First of all it’s a lot smaller than the brick I had before. The old one has some nice design, but was a weird result. Quickly rushed out in the market with an hires (320×240) display but low-res fonts. The new one is smaller, lighter, using some sort of 3G. Much faster with the Internet, I can finally send and receive attached pictures with no major problems (hoping to be able to exchange pics with family in Italy). The screen is large, 400×240, the interface is simpler, it has 2 cameras, a frontal one mostly for video-chat (dunno if I’ll ever use that) and the one on the back that has auto-focus and can take shots up to 3.9 MPixel ! Also comes with an Acrobat Reader.. !!! Great, but, seems rather limited as it coudln’t display the first 3D research paper I tried 8(
Still, I’m quite happy, if anything because now I have a decent camera, and it’s easy to use. I’m just not sure how much my bandwidth bill is going to turn out.
Tomorrow I’ll have to buy a memory card to store more pics and possibly MP3s and videos (but will I really need that ?).
And… no coding today !! Errands, write a (simple) diary in Japanese, then write here.. time flies. Sad.
Posted by Davide Pasca as Society, Diary, Japan at 5:39 AM EST
6 Comments »
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 »
Given the fact that I worked so hard on the last project, including working through a company vacation week in August, I’ve now been given two weeks of vacation.
I could have rushed back to Italy, but that’s not much of a vacation (plus my passport is expired and I need to renew it).
My vacation should be here in Tokyo, where I normally live most of my life in an office. So, now, I’m free for two weeks. I wake up when I want, I go out shopping, go to the gym, in a cafe, buy new books, write some code, study Japanese, enjoy the sunlight that is so scarce in winter.
Time is running fast. I’m not sure what to make of it. I’ve always disliked the idea of vacations as much as I don’t like to celebrate my birthday. Some things should not be rare. Work is great, makes people move forward, it’s filled with experiences.. I guess, or is that just an illusion that people give to themselves to go through yet another day of work ?
For what I remember of the USA, the modern American dream is really about “having your own business”. It sounds lazy, but also sounds good. I mean, the idea of “working in the comfort of your own home”, etc etc.
It’s not impossible, it just takes a lot of effort, among other things.
I feel trapped ! I the past 10 years I sometimes took long breaks from work (transition periods). I know what it means not to work and, to me, it’s really not such a bad thing. When I don’t work, I still have so many things that I want to learn about, so many projects that I want to develop, perhaps because I’m not rich. If I were rich, I’d be surrounded by temptations and I’d probably forget that I have a brain.
Yeah, maybe ! But one can’t live forever making excuses for not trying to do something. I can keep repeating to myself that I’m blessed because I need to work and I have a nice job. But, how can I be sure that richness would really rot my brain ?
Money isn’t a problem for me, time is ! Given that I need to sleep 7-8 hours per night, given that I normally spend another 9-10 hours between work hours, commute, shower, shaving, etc etc. It seems to me that there is very little time to ..see the sunlight !
I’m not a boy anymore. What I’m supposed to do is to settle, make 1-2 kids and almost completely renounce to my personal life. But I’ve always been against the common expectations, and I won’t give up now !
I’m in a great position to live a decent life.. but still, it sucks ! It’s not supposed to be this way, this is not satisfactory and I need to react. I don’t want to cherish two miserable weeks of vacation, nor three, nor one month.
Posted by Davide Pasca as Society, Diary at 3:19 AM EST
9 Comments »