Entries for tag "tools", ordered from most recent. Entry count: 69.
# SVN in My Windows Made Me Angry
Today I had an unpleasant adventure with SVN. Although I'm now going to use Mercurial (with TortoiseHG client) for my home projects, as this whole distributed revision control systems looks quite promising, I wanted to checkout some SVN repository and it turned out to be much bigger problem than I expected.
The obvious solution is to install and use TortoiseSVN - great shell extension for Windows. Unfortunately it doesn't work in my 64-bit Windows 7. Setup succeeds, but then no new items appear in context menus for directories. I tried to install both 64-bit and 32-bit versions, two times, with restarting my computer. Nothing helped. I tried to disable read-only attribute for TortoiseSVN directory, give full permission to this directory for all users, maually run TSVNCache.exe (because it doesn't start automatically) and nothing helped. I also ensured shell extensions are successfully installed by using ShellExView. Google knows this problems, but not the solution.
So then I installed RapidSVN - a normal Windows SVN client. Such application seems even nicer for me than shell extension. But then another obstacle appeared: opening repository in RapidSVN failed with error message: rapidsvn Error: Error while updating filelist (Can't create tunnel: The system cannot find the file specified. ). I though: Fuuuu! After issues with new Windows version here come Linux-like issues with some command-line or config driven, small and independent programs that never smoothly work together. I knew it was probably because the repository I wanted to checkout have an URL starting with svn+ssh:// so the SVN client probably needs to create an SSH tunnel.
After some searching in Google I found a solution. I needed to download PuTTY package and set special environmental variable to point to the plink.exe program that, according to Google, work as SSH tunnel. This variable is named "SVN_SSH" and its value must be like "E:\\PuTTY\\plink.exe" - without quotes, but with these double backslashes! Here I was sure it had to come from the Linux/Unix world, noone other would come up with something like this :P
It seemed to work so I was a step further, but still I couldn't access the SVN repository. This time when checking out, an empty console appeared and freezed so the RapidSVN didn't go any further. I wanted to try some "easy" solution so I installed another windowed client - Qsvn, as well as console SVN client - SilkSVN, but it seemed to recognize and run this SSH tunnel and finally freeze in same situation. So after another Googling I've found this post, opened configuration file "C:\Users\MY_LOGIN\Application Data\Subversion\config" and inserted this line into it:
ssh = E:/PuTTY/plink.exe -l REPOSITORY_LOGIN -pw REPOSITORY_PASSWORD
It finally worked and I could access the repository, but it took me so much time that it made me really angry. I hope I'll live to see the day when there will be no such stupid problems with software. Meanwhile, now you can understand why do I always *very* carefully handle all errors in my code (check returned values, throw exceptions, write logs) - to always know exactly what, when, where and why went wrong, so no annoying things can happen like "context menu items don't show up and I don't know why" or "empty console window opens and freezes".
# Properties of Pascal Triangle
Pascal Triangle is a mathematical object that looks like triangle with numbers arranged the way like bricks in the wall. Each next row has one more number, ones on both sides and every inner number is the sum of two numbers above it. It can span infinitely.
Despite simple algorithm this triangle has some interesting properties. First, if you draw only odd numbers, you get a fractal - Sierpinski Triangle.
Second, graph of numbers in each row resembles Gaussian distribution function. The lower row you take from the triangle (containing more numbers), the more precise graph you get.
I've made these images with Octave - a free Matlab alternative. I like it and I think concepts behind this Matlab programming language can be quite useful for doing computations, but doing graphics is painfully slow. Whole seconds to draw several dozens of texts or rectangles? WTF?!
# Unreal Engine for Free
This week the news of the week was the release of the famous, probably world's best game engine free to download and uncommercial use. I'm talking about Unreal Engine in form of UDK - Unreal Development Kit.
At first glance it looks like a small revolution, but when you download (562 MB) and install (1.25 GB) the package, you will see it's actually not an SDK at all. There is no source code or even headers and libraries to code your own game in C++ using this engine. It's just the game editor and the only thing you can do besides graphics and level design is scripting gameplay mechanics in UnrealScript. Just like Game Maker, only more advanced ;)
Nevertheless I think it's important news and the editor is worth seeing. All in all Unreal Engine is a great technology used by countless commercial game developers. I've started reading UnrealScript Reference and I'm amazed by concepts of this language like object states, latent code or replication. Now I feel like making a game with the Unreal Engine, but as I'm neither good artist nor good level designer, soon I will probably go back to my own C++ code, just knowing how a good game engine should look like.
# Texture Shader for Generating Textures
There was a discussion recently on our forum (in the topic [HLSL] Przekazywanie struktury ?!?) about shader performance and execution time of texture fetches versus arithmetic operations. When we need a sophisticated function that involves many costly computations in a shader, sometimes it is better to prepare a special texture to be sampled as a lookup table for values of this function. But how to generate such texture?
Of course you can write a simple console program, create Direct3D device of type D3DDEVTYPE_NULLREF, create a texture in the D3DPOOL_SCRATCH pool, fill its pixels and finally save it to a file. But there is another solution called Texture Shaders. It's not a new shader type introduced in DirectX 10/11/... It actually exists for quite a long time and is available in D3DX for generating textures with a shader. Such shader is always executed on CPU. If you are interested, look at functions D3DXCreateTextureShader, D3DXFillTextureTX and the ID3DXTextureShader interface.
Another good news is that you can utilize Texture Shaders without coding any program in C++. All you need is AMD RenderMonkey shader IDE. To generate a texture procedurally:
Here is my example:
Interesting curiosity: there is a intrinsic function in HLSL available only in Texture Shaders - noise, which generates Perlin noise.
# About the Guy Who Made Love
Today I want to talk a bit about what's the dream of almost every passionate game developer. It seems very hard or almost impossible to achieve, but younger amateurs still hope that they will manage to do it someday. Of course I'm talking about making a 3D MMO game.
As it turned out for me today (thanks for the link KriS!), it actually IS possible. I'm talking about the game called Love written entirely by one person - Eskil Steenberg. He have coded all the software from modeling tools through network protocol and renderer until game mechanics. To see it working I recommend watching these videos. The game is powered by his engine called Quel Solaar, which is actually available for download.
I must admit I haven't been impressed so much for a long time. I suppose the amount of time and passion that had to be put into this code is enormous. Graphical style and gameplay, as well as the user interface of his tools are very unusual and surprising. And all of this is made by one guy...
I recommend watching his lecture from this year's Assembly party titled Developing the technology behind "Love". You can see many technical details and if you don't want to watch the entire one hour video, at least watch the beginning (where he talks about his "smarter way of doing things") and the ending (where he expresses his thoughts about the value of good tools).
BTW it's also nice to watch new videos from GC 2009 of the CryEngine 3. "What you see is what you play" and instant asset update (including textures) - that's how good game editor should look like :)
# Backup Script in PHP
One of my personal security procedures is daily backup of the code I'm working on to my FTP server. This process requires packing files to an archive and upload the archive to the FTP server. Most annoying part when doing it manually was always selecting aproppriate files, without all these big temporary files and directories like Debug, Release, .ncb, .suo, .user etc.
Today in the morning I've decided to automate this backup task with a script. As I like to use PHP as shell scripting language, here is my backup script in PHP: Backup.php_. It was not a suprise for me to see that PHP already have all the functionality I need, including building ZIP archive and FTP client. Some comments to my code:
To run the script, you must have PHP installed. Then you can just enter something like this into command line:
php Backup.php D:\MyGreatProject
Or you can create BAT file to support backup of your particular project:
@php D:\Backup.php D:\MyGreatProject @pause
After the script have been started, you have to enter "backup name". It is the name of the ZIP file that will be uploaded to FTP. Script recursively searches for files and subdirectories in the given project directory, filters them using functions FilterDir and FilterFile, packs them to a temporary archive file and then uploads the archive to the FTP server. All remaining parameters (temporary archive path, FTP hostname, login, password and remote directory) are hardcoded as constants.
When it comes to the script code, one of the issues was to ask user about the backup name using system console. PHP has an extension called Readline, but unfortunately it doesn't work on Windows. The solution was to use fgets function with STDIN constant:
print("Enter backup name (default: \"$sSuggestedBackupName\"): "); $sBackupName = trim(fgets(STDIN, 1024)); if (!$sBackupName) $sBackupName = $sSuggestedBackupName;
When it comes to building ZIP archive and handling FTP connection, PHP also has extensions for that and they seem to just work in my PHP without any problems. Zip extension exposes class ZipArchive and FTP extension exposes functions ftp_, like ftp_connect or ftp_put. All is documented in the official PHP documentation.
# Dithering i inny postprocessing
Dziś dalej bawiłem się w pisanie efektów postprocessingu. Szczególnie zainteresował mnie Dithering. Ta technika była stosowana do polepszania jakości obrazów w czasach, kiedy komputery dysponowały ograniczoną liczbą dostępnych kolorów. W szerszym kontekście Dithering oznacza celowe wprowadzanie szumów do sygnału celem zniwelowania nieprzyjemnego efektu powstającego w wyniku kwantyzacji do pewnej, małej liczby możliwych wartości (np. tylko kilka bitów na składowe RGB piksela czy próbkę dźwięku).
Dzisiejszy DirectX już nawet nie obsługuje palet, ale pomyślałem sobie, że napisanie takiego efektu renderowanego w czasie rzeczywistym za pomocą shaderów to będzie ciekawa część poznawania zagadnień związanych z tematem efektów pełnoekranowych i Non-Photorealistic Rendering.
Zasada działania takiego efektu jest stosunkowo prosta. Jeśli w kodzie shadera HLSL mamy dany kolor piksela Color.rgb, to możemy zmniejszyć precyzję każdego kanału do tylko 2, 3, 4 itd... możliwych wartości (g_DownsamplingFactor) za pomocą takiej operacji:
float Bias = 0.5; Color.rgb = floor(Color.rgb * g_DownsamplingFactor + Bias) / g_DownsamplingFactor;
To 0.5 służy do zaokrąglenia części ułamkowej, zamiast jej obcięcia. Jeśli teraz to przesunięcie 0.5 zastąpimy przesunięciem losowym w zakresie 0..1 (bez wartości skrajnych), to otrzymamy Dithering. Oto efekt:
# Zabawy z GIMP-em #1 - Bloom
Wiadomo, że programista to nie grafik - talentu artystycznego mieć nie musi. Ale warto umieć obsługiwać jakiś program graficzny, bo jego wykorzystanie bywa przydatne i całkiem ciekawe. Na przykład za pomocą GIMP-a możemy "statycznie" uzyskiwać efekty, które na co dzień kodujemy w czasie rzeczywistym, na GPU i za pomocą wszelkich zaawansowanych technik koderskich.
Jako przykład weźmy "słynny" efekt Bloom. Do jego wykonania posłuży darmowy GIMP. Mamy zdjęcie (Warszawa, centrum handlowe Złote Tarasy):
Duplikujemy jego warstwę (Layer / Duplicate Layer). Tą warstwę wyższą przekształcamy za pomocą krzywej (Color / Curves) tak, żeby wybrać tylko jasne obszary:
Potem tą warstwę mocno rozmywamy za pomocą Filter / Gaussian Blur:
Wreszcie przestawiamy tryb warstwy (Mode w panelu Layers) na addytywny (Addition) i Bloom gotowy - wszystko świeci! :D