Tuesday, May 15, 2012

blender game engine and unity 3D

Blender and unity 3D are 2 game engines I am playing with. It is unfair to compare these two as one is open source and the other is commercial. I just wanna talk about how I feel.

BGE is great and handy. It is very intuitive. There is not any problem to develop a game with BGE. There is a quite wonderful game on it, http://www.yofrankie.org/. With gamekit, ,https://code.google.com/p/gamekit/, you can export your blender game to android and iphone. I have tested. It works. Audio on android is not supported yet. Maybe, iphone either. The whole pipeline is clear here. Modeling + game logic = game. The only concern is performance. Correct me if I am wrong. I feel BGE is not optimized enough. I felt a little laggy while playing mono example from gamekit on my i5 laptop, and more laggy on my moto xoom. I would like remain blender as mainly a modeling and animation tool.

unity 3D is a more professional game engine. Everything is ready for game dev. In terms of UI, I do not think there could any major pros or cons. Both BGE and unity and do good job. Like different programming language, it depends on which is more convenient for u. I guess unity 3D is more optimized on performance as an commercial software which is pricing thousand dollars on its pro version. The angrybot example can run smoothly on my phones and tablet.

In stead of comparing them, I would like to combine them. I use blender for modeling as I am used to blender way while publish games with unity 3D because of its performance and cross-platform.

ICS is not working perfect on my evo3d so far

Stock kernel is not working, causing boot loop. The only working kernel is AnthraX-htcleak-rls1. However it is buggy. 3D is broken, and it drains battery. I just switch back to mean GB.

4ext touch recovery does work on s-on. It will pend boot section and flash it next reboot.

Friday, May 11, 2012

flash any roms with s-on

I have 1.5 hboot s-on on my evo 3d cdma.

(It is said that 4ext can flash with s-on, but I did have it at that time. Will try it later.)

I just flash with recovery-clockwork-touch-5.8.0.2-shooter.img in my boot section.

1. fastboot flash boot recovery-clockwork-touch-5.8.0.2-shooter.img
2. reboot
3. You should in recovery mode now. Flash any rom/patch/kernel from your sdcard, before you reboot.
4. reboot
5. enjoy

Note: It is only one time job. After step 4, your boot section is locked again because s-on.

I tested Mean rom and Newts One S ICS roms with AnthraX-htcleak-rls1 kernel. Now I am on Mean. Everything is fine so far.

Monday, May 7, 2012

gamekit blender windows file path

It seems that blender uses relative path under windows (win7 in my case) for external files such as image texture. Then gamekit engine will fail to find those files. Make those paths absolute will solve the problem.

blender gamekit gcc4.7

OIS in gamekit is not compiling with gcc 4.7.  "write" is not declared.
Add #include <unistd.h> where write is called.

blender 2.63 stereo game engine

blender stereo works fine under win7 without any problems so far. However, under linux (arch in my case) side-by-side stereo or similar cases will fail with "X11 glXQueryVersion() failes, verify working openGL system! initial window could not find GLX extension, exit!"

I patch intern/ghost/intern/GHOST_WindowX11.cpp anyway. It might cause other problems, but side-by-side stereo works for me so far.

PS: patch file

Only in blender-2.63: build
diff -rup blender-2.63/intern/ghost/intern/GHOST_WindowX11.cpp patched/intern/ghost/intern/GHOST_WindowX11.cpp
--- blender-2.63/intern/ghost/intern/GHOST_WindowX11.cpp    2012-04-26 16:41:12.000000000 -0400
+++ patched/intern/ghost/intern/GHOST_WindowX11.cpp    2012-05-07 16:16:50.000000000 -0400
@@ -209,8 +209,8 @@ GHOST_WindowX11(
     for (samples = m_numOfAASamples; samples >= 0; samples--) {
         i = 0; /* Reusing attributes array, so reset counter */

-        if(m_stereoVisual)
-            attributes[i++] = GLX_STEREO;
+        //if(m_stereoVisual)
+        //    attributes[i++] = GLX_STEREO;

         attributes[i++] = GLX_RGBA;
         attributes[i++] = GLX_DOUBLEBUFFER;

Wednesday, May 2, 2012

reverse video clip with ffmpeg

Dump all video frames

$ ffmpeg -i input.mkv -an -qscale 1 %06d.jpg

Dump audio

$ ffmpeg -i input.mkv -vn -ac 2 audio.wav

Reverse audio

$ sox -V audio.wav backwards.wav reverse

Cat video frames in reverse order to FFmpeg as input

$ cat $(ls -rv *jpg) | ffmpeg -f image2pipe -vcodec mjpeg -r 25 -i - -i backwards.wav -vcodec libx264 -vpre slow -crf 20 -threads 0 -acodec flac output.mkv

Use mencoder to deinterlace PAL dv and double the frame rate from 25 to 50, then pipe to FFmpeg.

$ mencoder input.dv -of rawvideo -ofps 50 -ovc raw -vf yadif=3,format=i420 -nosound

If there is no audio, this command works for me.
cat $(ls -rv *jpg) | ffmpeg -f image2pipe -vcodec mjpeg -i - -vcodec mpeg4 -sameq -r 24 output.avi