Posts

Showing posts from 2011

LLVM introduction

LLVM introduction
View more presentations from Jim Huang

Getting Started with the LLVM Systemhttp://llvm.org/docs/GettingStarted.html  

Getting Started: Building and Running Clanghttp://clang.llvm.org/get_started.html

Google: Native Client Getting Started

Image

Google: Native Client

Support the x86-32, x86-64 and ARM instruction sets.

NaCl started as a downloadable NPAPI plugin for multiple browsers, including Firefox, Safari, Opera and Chrome and was designed to transparently load and run other NPAPI plugins compiled as nexes.

http://www.chromium.org/nativeclient/getting-started/getting-started-background-and-basics

Download sdk: https://developers.google.com/native-client/sdk/download

Native Client: A Sandbox for Portable, Untrusted x86 Native Code:
http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/zh-TW//pubs/archive/34913.pdf

Problem of Titanium sdk install Android SDK

Image
Install Android SDK to Titanium in windows you may occur some problem:
Could not loacate the android sdk titantium
Add empty folder "android-7" into "$ANDROID_SDK/platforms/", copy your android sdk folder's content into "android-7". ( for ex: "android-13" to "android-7" ) [ERROR] Required jarsigner not found [ERROR] Required javac not found [ERROR] Required java not found [ERROR] One or more required files not found - please check your JAVA_HOME environment variable JAVA_HOME = C:\Program Files\Java\jdk1.7.0_01But JDK is needed 1.6, reinstall JDK 1.6 and set JAVA_HOME = C:\Program Files\Java\jdk1.6.0_29

Optimizing Graphics Performance on iOS/Android

iOS:
遵守可視的vertex數目限制:40K - iPhone 3GS以後的新裝置(with SGX GPU)10K - 較舊款的裝置(with MBX GPU) 如果可能要採用lighing shader,vertex lit會是比較好的選擇盡可能share material,減少不同material的數目非會移動的物件,指定為靜態物件會帶來最佳化使用PVRTC格式或是16bit textures盡量使用single pass pass的效果盡可能降低shader floating point的精確度減少使用複雜的shader指令在pixel shader-pow, sin, cos盡量避免使用pixel lighting,頂多一盞(推薦方向光為主)不要使用動態光源當非必要時 -- 使用lightmap會比較好在pixel shader貼圖使用越少越好避免用alpha-testing,用alpha-blending取代非必要時不要使用fog盡可能使用Occlusion culling以達到節省draw call次數。 使用skyboxes來模擬遠方景物。 Android: 如果可能要採用lighing shader,vertex lit會是比較好的選擇盡可能share material,減少不同material的數目非會移動的物件,指定為靜態物件會帶來最佳化使用ETC1 格式或是16bit textures使用mipmaps 盡量使用single pass pass的效果盡可能降低shader floating point的精確度減少使用複雜的shader指令在pixel shader-pow, sin, cos盡量避免使用pixel lighting,頂多一盞(推薦方向光為主)不要使用動態光源當非必要時 -- 使用lightmap會比較好在pixel shader貼圖使用越少越好避免用alpha-testing,用alpha-blending取代非必要時不要使用fog盡可能使用Occlusion culling以達到節省draw call次數。 使用skyboxes來模擬遠方景物。Reference:http://unity3d.com/support/documentation/Manual/Optimizing%20Graphics%20Perform…

Adobe AIR on mobile platform

Today I port my Flash Player version 3D engine to Adobe AIR, in order to support Android/iOS platform. Because my engine has been done on the PC/Web, so we can't aware performance penalty easily, now I forward to mobile platform, they have limit resource. We need to more optimize our engine. Because iOS version has been convert AS3 to native code, so I believe and found game loop and render loop are not the critical part. The GPU processing part is the issue.

We have done several things, I list them on the bottom: ( improving the fps from 4 to 26 )
Resize our texture size, smaller is better. Reduce redundant shader instruction, especially pixel part. We remove the fog and alpha-test part ( for supporting alpha-test, we use 'kil' - it's very evil )Disable lighting and shadow map.Currently, event-listener is not the issue. Continuing we want to try disable mipmap, it may help us improve current performance. OpenGL ES Programming Guide for iOS:http://developer.apple.com/li…

id Software releases Doom 3 source code

Visual authoring of HTML5 user interfaces - in the browser!

Maqetta is an open source project that provides WYSIWYG visual authoring of HTML5 user interfaces. The Maqetta application itself is authored in HTML, and therefore runs in the browser without requiring additional plugins or downloads.

http://maqetta.org/

shadow map self shadowing artifact

Detection Mobile device browser: User Agent Sniffing

http://hsinyu00.wordpress.com/2011/04/05/mobile-web-user-agent-sniffing/

Use javaScript detect the keywords of User Agent Sniffing

Quake 3 porting on Andorid

This is a port of Quake3 to Android.
http://code.google.com/p/kwaak3/

如何計算一個目錄下的所有檔案的總行數

Google I/O 2011: WebGL Techniques and Performance

Image
The math library I'm using TLD or 3D library
File at 3Dlibrary.googlecode.com
WebGL math benchmarks
WebGL based on OpenGL ES 2.0 with zero extention

world *viewProj mtx

reduce draw call --- use one large buffer

limits
64,000 polygons per draw call
index primitive 16bit

particle library on WebGL wiki
(This one which is more stand alone
https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/demos/google/particles/index.html
And this one which is integrated with the TDL library
http://code.google.com/p/webglsamples/source/browse/tdl/particles.js)

(Library presented in the video is named ThreeD Library. You can find it on googlecode.
You can use ThreeJS which is much, much easier, and then there is SparksJS for particles in ThreeJS.  Thanks, Mackovy )

limits
3D textures not be support. spread it out
into a 2D texture

Post Processing
WebGL2D.js

never call gl.get anything while render


// don't touch render buffer while rendering
gl.framebufferRenderbuffer()//bad
gl.fram…

Google I/O 2011: Building Game Development Tools with App Engine, GWT, and WebGL

Image

Starling Framework - The GPU powered 2D Flash API

Some articles about AS3 optimization

狂怒煉獄(RAGE) - id 精神傳承 Making of Legacy

Image

Flash 11 即將推出,支援GPU硬體加速功能

Macros for Build Commands and Properties in MVS

gameRendering website

Mega Texture

JNI keyboard hook

If you want your JNI program process with your native dll's keyboard I/O, you must implement keyboard hook function.

http://www.jotschi.de/?p=90
http://www.codingforums.com/showthread.php?t=147913

Using JAWT implements Web3D

Image
JAWT ( Java Abstract Window Toolkit )
    Java use it to define the different OS's create window layer, we get this window's handle by JAWT. In this approach we can draw 3D objects presented on the window's handle, which is by GPU acceleration.


JNI ( Java Native Interface )
   Java can upload native program's library ( etc: *.dll ). Call the native function defined in this linked library.



STEPS:
Design your java code to be Applet style, You can adopt eclipse SWT(standard widget toolkit) to support JAWT canvas easier.Define the native interface in your *.java file. Like this:
  // native entry point for Painting
    public native void paintOpenGL();

    // native entry point for enabling OpenGL calls.
    public native void initializeOpenGL();

    // native entry point for disabling OpenGL calls.
    public native void cleanupOpenGL();
Load library in the java:
System.loadLibrary("openglAWT");Compare your java code
javac to generate .class files.
javah to generate …

World to View matrix from Z up right-hand to Y up left-hand

position.x = (-1) * rightVector.dotProduct( orgin );
position.y = (-1) * lookVector.dotProduct( orgin );
position.z = (-1) * upVector.dotProduct( orgin );

_viewMtx.identity();

var data:Vector. = _rotateMtx.rawData;

// inverse mtx, and then Z up Y-Z plane to Y up Z-Y plane.
_viewMtx.copyRawDataFrom(
                Vector.(
                    [    data[0], data[8],  data[4], 0.0,
                        data[1], data[9],  data[5], 0.0,
                        data[2], data[10],  data[6], 0.0,
                        position.x, position.z,  position.y, 1.0 ] )
            );

Using JNI embed OGRE3D in webpage

Virtualization

Flash "Molehill" vs Shockwave 3D

HTML5 canvas demo

Connect to AWS-EC2 Windows OS server and Linux OS server

Image
Access to windows server, all you do are like to use the Remote Desktop Protocol (RDP).
First you need to start the EC2 instance, then get Windows password and EC2 IP. Execute the RDP and type your IP and username, select "warn me" certification. Click the connect btn.




If you use Linux version OS, you must use SSH protocol, generate private key from key pair. you can following this article. http://blog.soft.idv.tw/?p=824

[Flash Player 11] CPU vs GPU with Molehill

Image

Configuration of Amazon EC2

快速安裝 Amazon EC2 LAMP 環境 (EC2 Console)
http://blog.wu-boy.com/2011/05/%E5%BF%AB%E9%80%9F%E5%AE%89%E8%A3%9D-amazon-ec2-lamp-%E7%92%B0%E5%A2%83-ec2-console/什麼是雲端服務?阿正老師教你免費玩Amazon EC2雲端主機!(上篇)
http://blog.soft.idv.tw/?p=823阿正老師教你免費玩Amazon EC2雲端主機(下篇):主機實戰篇
http://blog.soft.idv.tw/?p=824Create a Security Group
http://support.rightscale.com/03-Tutorials/02-AWS/02-Website_Edition/2._Deployment_Setup/1._Create_a_Security_Group
How to Connect to Amazon AWS EC2 Server from Windows Desktop.
http://techgurulive.com/2011/03/07/how-to-connect-to-amazon-aws-ec2-server-from-windows-desktop/

Java - Writing the Server Side of a Socket

FGS 2011: Making A Game With Molehill: Zombie Tycoon

Compare among Java Servlet, Applet, CGI, and JSP

Java Servlet与Applet、CGI、JSP的比较http://developer.51cto.com/art/200907/133695.htm

MapKit in iOS app

Image
iPhone app實作練習-地圖apphttp://blog.eddie.com.tw/2010/11/26/create-map-application-with-mapkit-framework/

iPhone app實作練習-幫你的地圖app加上大頭針
http://blog.eddie.com.tw/2010/12/20/add-annotation-to-the-map/

Using iPhone SDK MapKit Framework - A tutorial
http://mithin.in/2009/06/22/using-iphone-sdk-mapkit-framework-a-tutorial
[iPhone程式]iPhone開發心得04-Mapkit之使用MKMapView實作Google Maphttp://blog.finalevil.com/2009/05/iphoneiphone04-mapkitmkmapviewgoogle.html
Map Kit Framework 的簡單應用 http://pro.ctlok.com/2010/07/map-kit-framework-tutorial.html
如何抓取google map中的經緯度資料:
add it to your browser's URL
javascript:void(prompt('',gApplication.getMap().getCenter()));
http://vovo2000.com/phpbb2/viewtopic-33505.html

Map Reduce

MR. JAMIE:看網路與創投

WebGL – More WebGL Security Flaws

WebGL – More WebGL Security Flaws:
http://www.contextis.com/resources/blog/webgl2/

今天突然好想再繼續唸書

今天去跟公司合作的大學研究室參訪,聽完了教授的簡報,當下覺得回到了當初研究所報告論文的時光,當時我的研究題目也是有參考這位教授的題目...一點一點將研究成果給達到。今天聽完教授簡報後,發覺我當初很多演算法的細節根本沒有搞很懂,我相信當初的我已經盡我所能去理解了,但看到該教授指導學生的方式,我真的覺得我沒有努力嘗試進入更好的教育環境是那時的錯誤...能夠將自己在意的事情給釐清,真的是一件很幸福的事...

ActionScript 3.0程式最佳化

ActionScript 3.0程式最佳化(一)以及Vector資料類型簡介
http://uh.9ria.com/space-6264-do-blog-id-2233.htmlActionScript 3.0程式最佳化(二)
http://uh.9ria.com/space-6264-do-blog-id-2234.html

The difference of dedicated server and cloud computing

Using Interfaces in C++

Method 1.
#include "objbase.h"  //~~~!! for interface identifier
#include "stdio.h"


interface IAnimal
{
    virtual void Forward() = 0;
    virtual void Eat() = 0;
};

class CBird : public IAnimal
{
virtual  void Forward()
    {
        printf( "walk 3 steps \n" );
    };
virtual void Eat()
    {
        printf( "eat 5 rice \n" );
    };
};


void main()
{  
    IAnimal *pAnm = NULL;
    CBird bird;

    pAnm = &bird;
    pAnm->Forward();
  }

In this method, you need to #include "objbase.h". And write pure virtual func. in the interface class.

Method 2. In VS7 Microsoft has judged __interface introduction in c++ compiler( macOS c++  support?...)  In the msdn  __interface definition:
Can inherit from zero or more base interfaces.Cannot inherit from a base class.Can only contain public, pure virtual methods.Cannot contain constructors, destructors, or operators.Cannot contain static methods.Cannot contain data members; properties are allowed.Th…

Cloud computing

xcode precompiler header

In your xcode proj. You can see a other sources group. there is a xxx_Prefix.PCH. In this *.PCH, If you write the cpp code, you should add
#if defined __cplusplus
#include "MUtils.h"
#endif


Then the precompiler header function would be worked.

Reference: http://www.facebook.com/note.php?note_id=220473491312585
http://forum.soft32.com/mac/Xcode-precompiled-header-files-problem-ftopict47632.html

Titanium Appcelerator vs. PhoneGap vs. Adobe Air

C++ template in Objective C++

Vector3D.h template(class Type)
class cMVector3D
{
public:
    Type x;
    Type y;
    Type z;

public:
    //--------------------------------
    // @breif: Constructor
    //--------------------------------
    cMVector3D(): x(0), y(0), z(0) {};

    //--------------------------------
    // @breif: Destructor
    //--------------------------------
    ~cMVector3D() {};
};



main.mm--- if your program is objective c  hybrid with c++, you need to rename your file ext. from *.m to *.mm.

#import "MVector3D.h"

int main(int argc, char *argv[]) {

    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

    cMVector3D(float)  testV;~~~template success

    int retVal = UIApplicationMain(argc, argv, nil, nil);
    [pool release];
    return retVal;


Reference: http://hi.baidu.com/184367426/blog/item/4324263a5ac76e2f71cf6c7c.html

Google style guide

OpenGL ES Programming Guide for iOS

Fractal Lab

Image
Fractal Lab is a WebGL based web application for rendering 2D and 3D fractal in real-time
http://www.creativeapplications.net/webapp/fractal-lab-webapp/

Chrome web app and first web app

Image
Chrome web store let you can publish your app and charge it.

Overview: 
http://code.google.com/intl/zh-TW/chrome/webstore/docs/index.html#charging
Build option: 
http://code.google.com/intl/zh-TW/chrome/webstore/articles/launching.html
HTML5 - HTML5, CSS, JavaScriptNative Client - C/C++ code in the sandbox, with Native Client SDKAdobe Flash - depend on flash plug-inA mix - mix these technologies
The first web app:
Make a manifest.json
  write ---
 {
  "name": "Ellison's WebApp",
  "description": "First App on the chrome web.",
  "version": "1.0",
  "app": {
    "urls": [
        "http://coderellison.blogspot.com/"
    ],
  "launch": {
    "web_url": "http://coderellison.blogspot.com/"
    }
  },
   "icons": {
     "128": "logo.png"
   }
}
 Prepare a icon---