2010年3月28日日曜日

S21HTでAndroidする

先週の話になるが、
そろそろAndroid携帯(XPERIA X10)を購入しようかと
考え、その前に、S21HTを解約するつもりで
解約書を書き、chipにも切れ込みした。
その日に、S21HTでAndroidが動くらしいとのページを見つけた。
今日、いろいろと検索してみると
情報がいろいろとあったので参考にしながら
インストール設定してみた。


【手順】
1.PCで、http://www.microsoft.com/downloads /details.aspx?displaylang=ja&FamilyID=9E641C34-6F7F-404D-A04B-DC09F8141141
か らsetup.msi(ActiveSync 4.5)
をダウンロードしインストールする。(既にインストールしてある場合はする必要はない)




2.PCで、http://connect-utb.com/index.php?option=com_rokdownloads&view=file&Itemid=68&id=53:android-1
からAndroid-1.6-22-11-09-CUTB.zipをダウンロードし展開。




3.解凍したAndroid-1.6-22-11-09-CUTBフォルダーをS21HTの内部ストレージにコピー。



4.Android-1.6-22-11-09-CUTBフォルダー以下の全てのファイルを内部ストレージのルートにコピー。



5.S21HTの内部ストレージにあるSTARTUP.TXTをSTARTUP.ORG.TXTにリネームする。



6.S21HTの内部ストレージ\startup-configs内のdiam100.TXTをルートにコピーして、STARTUP.TXTにリネーム。



7.STARTUP.TXTにMACアドレスを追加する。

【STARTUP.TXT】
set RAMSIZE 0x08000000
set MTYPE 1805
set KERNEL zImage
set initrd initrd.gz
#
# The following kernel parameters are useful
# ppp.username               - The username used to connect to the network when dialing #777
# ppp.password               - The password used to connect to the network when dialing #777
# msm_sdcc.msmsdcc_fmax      - The maximum frequency (in Hz) used by the SD controller
# pm.sleep_mode              - The mode used when the phone is off
#                              0=Power Collapse Suspend, 1=Power Collapse, 2=Apps Sleep,
#                              3=Slow Clock and Wait for Interrupt 4=Wait for Interrupt
#                              Default is 3, use 0 for best power savings
# board-htcvogue.panel_type  - Panel type used to power the panel off and on
#                              0=Don't power off the panel (Default)
#                              1=Hitachi 2=Topoly 3=Samsung
# mddi.width                 - width of the scaled display
# mddi.height                - height of the scaled display (these should be multiples of 16 for the camera to work I think)
set cmdline "msmts_calib=115.105.863.911 msmvkeyb_toggle=off mddi.width=320 mddi.height=480 lcd.density=240 ppp.apn=movistar.es ppp.username=MOVISTAR ppp.password=MOVISTAR wifi.mac=12:34:56:78:90:ab no_console_suspend"
#set cmdline "no_console_suspend"
# fbcon=rotate:1
# console=ttyMSM0"
boot




8."内部デバイス"の"ルート"にあるharet.exeを実行。



ざっと動作させてみた状況としては、

電話:可能
無線LAN:可能。
カメラ :いまのところ不可
日本語:可(androidストアにあるsimejiをインストールすることで可能になった。)
ブラウジング:可能
Google Map:可能(ただしGPS取得はできてないようだ)
S21HTでAndroidアプリデバッグ:可能(確認するのに一番、時間がかかった。)








■Androidアプリデバッグさせるには、以下のようにしてPC側にドライバーを入れる。

PCドライバーの更新


デバイスの認識は、?になっているが、一応認識はされている


Android端末の設定は、とりあえず省略





設定、確認、その他いろいろで、丸一日費やしてしまったが、
とりあえずデバック機としても使えそうだということがわかった。

2010年3月27日土曜日

OpenGLによるグラフィックス描画

AndoroidでOpenGLによるグラフィックス描画


・OpenGLで画像を描画する際には、サーフェイスと呼ばれる、専用のメモリ領域を確保する必要がある。

・描画手順
1.描画用バッファ(サーフェイス)のクリア
2.サーフェイスへの画像の描画
3.サーフェイス内容から画面への描画




【AndroidManifest.xml】
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.naozary.gl.test"
      android:versionCode="1"
      android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".Test_GLSurfaceView01"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    <uses-sdk android:minSdkVersion="3" />
</manifest>




【Test_GLSurfaceView01.java】
package com.naozary.gl.test;

import android.app.Activity;
import android.os.Bundle;
import android.opengl.GLSurfaceView;
import android.opengl.GLU;
import android.view.Window;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;

import android.util.Log;


/**
 * Activity, Rendererを継承したクラス
 */
public class Test_GLSurfaceView01 extends Activity implements GLSurfaceView.Renderer
{
    // GLSurfaceView
    private GLSurfaceView gLSurfaceView;

    // 三角形ポリゴン
    private TestPolygon01 trianglePolygon;

    /**
     * @Override
     * アクティビティ生成時に呼ばれる
     */
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        Log.d(this.getClass().getName() ,"enter " + new Throwable().getStackTrace()[0].getMethodName() + "()");
        // Log.d("Test_GLSurfaceView01" ,"*** enter onCreate ***");
      
        // タイトルバーを消す
        requestWindowFeature( Window.FEATURE_NO_TITLE );

        // GLSurfaceView を生成
        gLSurfaceView = new GLSurfaceView(this);
        // レンダラーを生成してセット
        gLSurfaceView.setRenderer(this);

        // レイアウトのリソース参照は渡さず、直接Viewオブジェクトを渡す
        //setContentView(R.layout.main);
        setContentView(gLSurfaceView);

        // ポリゴンの初期化
        trianglePolygon = new TestPolygon01();
      
        // Log.d("Test_GLSurfaceView01" ,"*** exit onCreate ***");
        Log.d(this.getClass().getName() ,"exit " + new Throwable().getStackTrace()[0].getMethodName() + "()");
        // Log.d(this.getClass().getName() ,Thread.currentThread().getStackTrace()[0].getMethodName());
        // Log.d(this.getClass().getName() ,Thread.currentThread().getStackTrace()[1].getMethodName());
  
    }

    /**
     * @Override
     * 描画のために毎フレーム呼び出されるイベント
     */
    public void onDrawFrame(GL10 gl)
    {
        Log.d(this.getClass().getName() ,"enter " + new Throwable().getStackTrace()[0].getMethodName() + "()");
        // 描画用バッファをクリア
        gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);


        // カメラ位置をセット
        GLU.gluLookAt(
                gl,
                0.0f, 0.0f, 3.0f,    // カメラ位置xyz
                0.0f, 0.0f, 0.0f,    // カメラの注視する点xyz
                0.0f, 1.0f, 0.0f     // カメラ視点上方向を表すベクトルxyz
        );

        // 頂点配列を使うことを宣言
        gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
        // 色情報配列を使うことを宣言
        gl.glEnableClientState(GL10.GL_COLOR_ARRAY);

        // 2Dテクスチャを無効に
        gl.glDisable(GL10.GL_TEXTURE_2D);

        // モデルビュー行列を指定
        gl.glMatrixMode(GL10.GL_MODELVIEW);
        // 現在選択されている行列(モデルビュー行列)に、単位行列をセット
        gl.glLoadIdentity();

        // ポリゴンの描画メソッドを呼ぶ
        trianglePolygon.draw(gl);
        Log.d(this.getClass().getName() ,"exit " + new Throwable().getStackTrace()[0].getMethodName() + "()");
    }

    /**
     * @Override
     * サーフェイスのサイズ変更時に呼ばれる
     * @param gl
     * @param width 変更後の幅
     * @param height 変更後の高さ
     */
    public void onSurfaceChanged(GL10 gl, int width, int height)
    {
        Log.d(this.getClass().getName() ,"enter " + new Throwable().getStackTrace()[0].getMethodName() + "()");
        // ビューポートをサイズに合わせてセットしなおす
        gl.glViewport(0, 0, width, height);

        // アスペクトレート
        float ratio = (float) width / height;

        // 射影行列を選択
        gl.glMatrixMode(GL10.GL_PROJECTION);
        // 現在選択されている行列(射影行列)に、単位行列をセット
        gl.glLoadIdentity();
        // 透視投影用の錐台のパラメータをセット
        gl.glFrustumf(-ratio, ratio, -1.0f, 1.0f, 1.0f, 10.0f);
        Log.d(this.getClass().getName() ,"exit " + new Throwable().getStackTrace()[0].getMethodName() + "()");
    }

    /**
     * @Override
     * サーフェイスが生成される際・または再生成される際に呼ばれる
     */
    public void onSurfaceCreated(GL10 gl, EGLConfig config)
    {
        Log.d(this.getClass().getName() ,"enter " + new Throwable().getStackTrace()[0].getMethodName() + "()");
        // ディザを無効化
        gl.glDisable(GL10.GL_DITHER);
        // カラーとテクスチャ座標の補間精度を、最も効率的なものに指定
        gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_FASTEST);

        // バッファ初期化時のカラー情報をセット
        gl.glClearColor(0,0,0,1);

        // 片面表示を有効に
        gl.glEnable(GL10.GL_CULL_FACE);
        // カリング設定をCCWに
        gl.glFrontFace(GL10.GL_CCW);

        // 深度テストを有効に
        gl.glEnable(GL10.GL_DEPTH_TEST);
        // スムースシェーディングにセット
        gl.glShadeModel(GL10.GL_SMOOTH);
        Log.d(this.getClass().getName() ,"exit " + new Throwable().getStackTrace()[0].getMethodName() + "()");
    }

    /**
     * @Override
     * ポーズ状態からの復旧時や、アクティビティ生成時などに呼ばれる
     */
    protected void onResume()
    {
        Log.d(this.getClass().getName() ,"enter " + new Throwable().getStackTrace()[0].getMethodName() + "()");
        super.onResume();
        gLSurfaceView.onResume();
        Log.d(this.getClass().getName() ,"exit " + new Throwable().getStackTrace()[0].getMethodName() + "()");
    }

    /**
     * @Override
     * アクティビティ一時停止時や、終了時に呼ばれる
     */
    protected void onPause()
    {
        Log.d(this.getClass().getName() ,"enter " + new Throwable().getStackTrace()[0].getMethodName() + "()");
        super.onPause();
        gLSurfaceView.onPause();
        Log.d(this.getClass().getName() ,"exit " + new Throwable().getStackTrace()[0].getMethodName() + "()");
    }
}

【TestPolygon01.java】
package com.naozary.gl.test;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
import javax.microedition.khronos.opengles.GL10;

import android.util.Log;

/**
 * 三角形ポリゴンのクラス
 */
public class TestPolygon01
{
    // 頂点座標バッファ
    private IntBuffer vertexBuffer;
    // 色情報バッファ
    private IntBuffer colorBuffer;

    public TestPolygon01()
    {
        Log.d(this.getClass().getName() ,"enter " + new Throwable().getStackTrace()[0].getMethodName() + "()");
      
        // 固定小数点値で1.0
        int one = 0x10000;

        // 頂点座標
        int vertices[] = {
                -one, one, 0,
                -one, -one, 0,
                one, -one, 0
        };

        // 頂点カラー
        int colors[] = {
                one, 0, 0, one,
                0, one, 0, one,
                0, 0, one, one
            };

        // ネイティブヒープ(ガベージコレクタが働かない領域)にバッファを作成
        // サイズは、verticesの要素数×4バイト(int型なので)
        ByteBuffer vbb = ByteBuffer.allocateDirect(vertices.length * 4);
        vbb.order(ByteOrder.nativeOrder());
        // 作成したバッファをセットし、バッファに頂点情報を書き込む
        vertexBuffer = vbb.asIntBuffer();
        vertexBuffer.put(vertices);
        vertexBuffer.position(0);

        ByteBuffer cbb = ByteBuffer.allocateDirect(colors.length*4);
        cbb.order(ByteOrder.nativeOrder());
        colorBuffer = cbb.asIntBuffer();
        colorBuffer.put(colors);
        colorBuffer.position(0);
      
        Log.d(this.getClass().getName() ,"exit " + new Throwable().getStackTrace()[0].getMethodName() + "()");
    }

    /**
     * @Override
     * 描画
     */
    public void draw(GL10 gl)
    {
        Log.d(this.getClass().getName() ,"enter " + new Throwable().getStackTrace()[0].getMethodName() + "()");

        gl.glVertexPointer(3, GL10.GL_FIXED, 0, vertexBuffer);
        gl.glColorPointer(4, GL10.GL_FIXED, 0, colorBuffer);
        // 描画
        gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 3);
      
        Log.d(this.getClass().getName() ,"exit " + new Throwable().getStackTrace()[0].getMethodName() + "()");
    }
}



【表示結果】





■ログ(呼び出しタイミング)
03-10 11:41:18.910: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): enter onCreate()
03-10 11:41:19.060: DEBUG/com.naozary.gl.test.TestPolygon01(732): enter <init>()
03-10 11:41:19.111: INFO/jdwp(732): received file descriptor 24 from ADB
03-10 11:41:19.170: ERROR/GLLogger(732): couldn't load <libhgl.so> library (Cannot find library)
03-10 11:41:19.190: DEBUG/com.naozary.gl.test.TestPolygon01(732): exit <init>()
03-10 11:41:19.200: WARN/System.err(732): Can't dispatch DDM chunk 46454154: no handler defined
03-10 11:41:19.209: WARN/System.err(732): Can't dispatch DDM chunk 4d505251: no handler defined
03-10 11:41:19.231: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): exit onCreate()
03-10 11:41:19.260: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): enter onResume()
03-10 11:41:19.289: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): exit onResume()
03-10 11:41:19.610: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): enter onSurfaceCreated()
03-10 11:41:19.651: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): exit onSurfaceCreated()
03-10 11:41:19.720: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): enter onSurfaceChanged()
03-10 11:41:19.730: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): exit onSurfaceChanged()
03-10 11:41:19.740: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): enter onDrawFrame()
03-10 11:41:19.781: DEBUG/com.naozary.gl.test.TestPolygon01(732): enter draw()
03-10 11:41:19.790: INFO/ARMAssembler(732): generated scanline__00000097:03010144_00000000_00000000 [ 20 ipp] (73 ins) at [0x195140:0x195264] in 8937169 ns
03-10 11:41:19.800: DEBUG/com.naozary.gl.test.TestPolygon01(732): exit draw()
03-10 11:41:19.800: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): exit onDrawFrame()
03-10 11:41:19.800: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): enter onDrawFrame()
03-10 11:41:19.820: DEBUG/com.naozary.gl.test.TestPolygon01(732): enter draw()
03-10 11:41:19.820: DEBUG/com.naozary.gl.test.TestPolygon01(732): exit draw()
03-10 11:41:19.820: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): exit onDrawFrame()
03-10 11:41:19.820: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): enter onDrawFrame()
03-10 11:41:19.830: DEBUG/com.naozary.gl.test.TestPolygon01(732): enter draw()
03-10 11:41:19.830: DEBUG/com.naozary.gl.test.TestPolygon01(732): exit draw()
03-10 11:41:19.830: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): exit onDrawFrame()
03-10 11:41:19.839: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): enter onDrawFrame()
03-10 11:41:19.839: DEBUG/com.naozary.gl.test.TestPolygon01(732): enter draw()
03-10 11:41:19.839: DEBUG/com.naozary.gl.test.TestPolygon01(732): exit draw()
03-10 11:41:19.839: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): exit onDrawFrame()

・繰り返し


03-10 11:41:32.201: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): enter onDrawFrame()
03-10 11:41:32.230: DEBUG/com.naozary.gl.test.TestPolygon01(732): enter draw()
03-10 11:41:32.240: DEBUG/com.naozary.gl.test.TestPolygon01(732): exit draw()
03-10 11:41:32.250: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): exit onDrawFrame()
03-10 11:41:32.259: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): enter onDrawFrame()
03-10 11:41:32.272: DEBUG/com.naozary.gl.test.TestPolygon01(732): enter draw()
03-10 11:41:32.350: DEBUG/com.naozary.gl.test.TestPolygon01(732): exit draw()
03-10 11:41:32.370: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): exit onDrawFrame()
03-10 11:41:32.401: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): enter onDrawFrame()
03-10 11:41:32.411: DEBUG/com.naozary.gl.test.TestPolygon01(732): enter draw()
03-10 11:41:32.420: DEBUG/com.naozary.gl.test.TestPolygon01(732): exit draw()
03-10 11:41:32.420: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): exit onDrawFrame()
03-10 11:41:32.430: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): enter onDrawFrame()
03-10 11:41:32.430: DEBUG/com.naozary.gl.test.TestPolygon01(732): enter draw()
03-10 11:41:32.490: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): enter onPause()
03-10 11:41:32.500: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): exit onPause()
03-10 11:41:32.521: DEBUG/com.naozary.gl.test.TestPolygon01(732): exit draw()
03-10 11:41:32.531: DEBUG/com.naozary.gl.test.Test_GLSurfaceView01(732): exit onDrawFrame()
03-10 11:41:43.160: DEBUG/dalvikvm(732): GC freed 4641 objects / 212952 bytes in 232ms






■メモ
1.頂点座標を以下のようにしてみた。(Test_TestPolygon01.javaのコンストラクタ)

        // 頂点座標
        int vertices[] = {
                -one * 2, one * 2, 0,
                -one, -one, 0,
                one, -one, 0
        };


【表示結果】



2.頂点座標を以下のようにしてみた。(Test_TestPolygon01.javaのコンストラクタ)

        // 頂点座標
        int vertices[] = {
                -one * 2, one * 2, 0,
                -one, -one, 0,
                one, -one, 0
        };


【表示結果】



3.頂点座標を以下のようにしてみた。(Test_TestPolygon01.javaのコンストラクタ)

        // 頂点座標
        int vertices[] = {
                -one, one, 0,
                -one, -one, 0,
                one * 2 , -one * 2, 0
        };


【表示結果】







4.頂点カラーを以下のようにしてみた。(Test_TestPolygon01.javaのコンストラクタ)


        // 頂点カラー
        int colors[] = {
                one, one, 0, one,            // RGBのRとGに1を指定
                0, one, 0, one,
                0, 0, one, one
            };


【表示結果】





5.頂点カラーを以下のようにしてみた。(Test_TestPolygon01.javaのコンストラクタ)


        // 頂点カラー
        int colors[] = {
                one, one, one, one,            // RGBのR、G、Bに1を指定(白色になる)
                0, one, 0, one,
                0, 0, one, one
            };


【表示結果】



6.カメラ位置をを以下のようにしてみた。(Test_GLSurfaceView01.javaのonDrawFrameメソッド)


        // カメラ位置をセット
        GLU.gluLookAt(
                gl,
                0.0f, 0.0f, 6.0f,    // カメラ位置xyz
                0.0f, 0.0f, 0.0f,    // カメラの注視する点xyz
                0.0f, 1.0f, 0.0f    // カメラ視点上方向を表すベクトルxyz
        );


【表示結果】




6.カメラ位置をを以下のようにしてみた。(Test_GLSurfaceView01.javaのonDrawFrameメソッド)


        // カメラ位置をセット
        GLU.gluLookAt(
                gl,
                0.0f, 0.0f, 1.0f,    // カメラ位置xyz
                0.0f, 0.0f, 0.0f,    // カメラの注視する点xyz
                0.0f, 1.0f, 0.0f    // カメラ視点上方向を表すベクトルxyz
        );


【表示結果】










■その他の気になるところのメモ

        // 固定小数点値で1.0
        int one = 0x10000;

の部分が気になっていた。

そこで、
int部分の下位2バイトが小数部を示すと仮定して考えてみた。



小数の二進数表現
0.1000 1/2 = 0.5
0.0100 1/(2*2) = 0.25
0.0010 1/(2*2*2) = 0.125
0.0001 1/(2*2*2*2) = 0.0625


0x5555 = (0101 0101 0101 0101)2

=\frac{1}{2^{2} }  + \frac{1}{2^{4} } +   \frac{1}{2^{6} } +   \frac{1}{2^{8} } +  \frac{1}{2^{10} } +  \frac{1}{2^{12} } + \frac{1}{2^{14} } +    \frac{1}{2^{16} }

=\frac{1}{4 }  + \frac{1}{16 } +   \frac{1}{64 } +   \frac{1}{256 } +  \frac{1}{1024 } +  \frac{1}{4096 } + \frac{1}{16384 } +    \frac{1}{65536 }

=\frac{1}{4 }  + \frac{1}{16 } +   \frac{1}{64 } +   \frac{1}{256 } +  \frac{1}{1024 } +  \frac{1}{4096 } + \frac{1}{16384 } +    \frac{1}{65536 }

=0.25 + 0.0625 + 0.015625 + 0.00390625 +とここまでやったが急に面倒くさくなってきたのでプログラムで結果をだすことにした。 -Naozary Unknown 10/03/12 0:10



import com.naozary.test.nio.test01;
public class calcpoint {
    public static void main(String[] args){
        int s = 1;
        // System.out.println("s = " + (2 << 1));
        float    r = 0;
        StringBuffer sb = new StringBuffer();
        for(int i=0;i<=7;i++){
            s = (s * 4);
// System.out.println("1/s = " + (1/(float)s));
            r += 1 / (float)s;
            if(i!=0)sb.append(" + ");
            sb.append("1/" + s);
        }
        sb.append(" = ");
//        System.out.println("r = " + r);
        sb.append(r);
        System.out.println(sb.toString());       
    }
}

結果
1/4 + 1/16 + 1/64 + 1/256 + 1/1024 + 1/4096 + 1/16384 + 1/65536 = 0.33332825


よって、0x5555 = 0.3333



とりあえず、int部分の下位2バイトが小数部を示すと考えてよいようだ。

OpenGL ES シェーダ記述言語

OpenGL ES シェーダ記述言語


■言語の特徴
構文はC言語に似ている。

■型

スカラー
    float
    int
    bool


浮動少数点型ベクトル
    float
    vec2
    vec3
    vec4

整数型ベクトル
    int
    ivec2
    ivec3
    ivec4

ブール型ベクトル
    bool
    bvec2
    bvec2
    bvec4

行列
    mat2
    mat3
    mat4



■関数
修飾子

    in        関数内で参照される。値変更なし

    inout     関数内で参照される。値変更あり

    out       関数内で参照されない。値変更あり       



■uniform変数
uniform変数は、アプリケーションからOpenGL ESのAPIを介してシェダに渡される読み込み専用の値が格納された変数
名前空間が頂点シェーダとフラグメントシェーダの両方にまたがる。通常ハードウェアの中にある定数領域と呼ばれる
場所に格納される。


■attribute変数
attribute変数は頂点シェーダだけ利用可能。頂点ごとに指定されるデータ。attribute変数通常、位置、法線、テクスチャ座標、色などのデータを格納する。

■varying変数
頂点シェーダの出力であり、かつ、フラグメントシェーダへの入力を格納する。
基本的には、各頂点シェーダはフラグメントシェーダに渡す必要のあるデータを1つ以上の
varying変数に出力する。varying変数の宣言は、頂点シェーダとフラグメントシェーダの
両方で行います。

■パッキング(uniform変数varying変数)
あとで記述-Naozary  10/03/25 16:45

OpenGL ES サンプルソース[Hello_Triangle.c]

OpenGL ES2.0プログラミングガイドに記述されているソース

【実行】



【Hello_Triangle.c】
//
// Book:      OpenGL(R) ES 2.0 Programming Guide
// Authors:   Aaftab Munshi, Dan Ginsburg, Dave Shreiner
// ISBN-10:   0321502795
// ISBN-13:   9780321502797
// Publisher: Addison-Wesley Professional
// URLs:      http://safari.informit.com/9780321563835
//            http://www.opengles-book.com
//

// Hello_Triangle.c
//
//    This is a simple example that draws a single triangle with
//    a minimal vertex/fragment shader.  The purpose of this
//    example is to demonstrate the basic concepts of
//    OpenGL ES 2.0 rendering.
#include <stdlib.h>
#include "esUtil.h"

typedef struct
{
   // Handle to a program object
   GLuint programObject;

} UserData;

///
// Create a shader object, load the shader source, and
// compile the shader.
//
GLuint LoadShader ( GLenum type, const char *shaderSrc )
{
   GLuint shader;
   GLint compiled;
 
   // Create the shader object
   shader = glCreateShader ( type );    // シェーダオブジェクトの作成を行う
                                        // typeには、GL_VERTEX_SHADERかGL_FRAGMENT_SHADERのいずれかを指定する
                                        // GL_VERTEX_SHADERの場合、頂点シェーダが作成される。
                                        // GL_FRAGMENT_SHADERの場合、フラグメントシェーダが作成される。
   if ( shader == 0 )
       return 0;

   // Load the shader source
   glShaderSource (                        // シェーダソースコードをロードする。
       shader,                            // シェーダオブジェクトへのハンドル
       1,                                // シェーダのソース文字列数
       &shaderSrc,                        // シェーダのソース
       NULL                                // それぞれ対応するシェーダソース文字列のサイズを指定する。NULL指定の場合、各文字列はNULLで終了していると仮定する。
    );      
 
   // Compile the shader
   glCompileShader ( shader );            // シェーダのコンパイルを行う。(実装されているOpenGL ESがコンパイル機能がある場合)
                                        // ※バイナリーフォーマットは完全にベンダーに一任されている

   // Check the compile status
   glGetShaderiv ( shader, GL_COMPILE_STATUS, &compiled );        // 正常にコンパイルされたかの情報を取得する

   if ( !compiled )
   {
      GLint infoLen = 0;

      glGetShaderiv ( shader, GL_INFO_LOG_LENGTH, &infoLen );        //
    
      if ( infoLen > 1 )
      {
         char* infoLog = malloc (sizeof(char) * infoLen );

         glGetShaderInfoLog ( shader, infoLen, NULL, infoLog );            // infoログを取り出す
         esLogMessage ( "Error compiling shader:\n%s\n", infoLog );          
       
         free ( infoLog );
      }

      glDeleteShader ( shader );        // シェーダオブジェクトを削除を行う
                                        // すぐに削除されるわけではなく、どのプログラムオブジェクトにも
                                        // アタッチされなくなった時に使用しているメモリが解放される。



      return 0;
   }

   return shader;

}

///
// Initialize the shader and program object
//
int Init ( ESContext *esContext )
{
   UserData *userData = esContext->userData;
   GLbyte vShaderStr[] =                        // 頂点シェーダ
      "attribute vec4 vPosition;    \n"
      "void main()                          \n"
      "{                                        \n"
      "   gl_Position = vPosition;  \n"
      "}                                    \n";
 
   GLbyte fShaderStr[] =                        // フラグメントシェーダ
      "precision mediump float;\n"\
      "void main()                                  \n"
      "{                                            \n"
      "  gl_FragColor = vec4 ( 1.0, 0.0, 0.0, 1.0 );\n"
      "}                                            \n";

   GLuint vertexShader;
   GLuint fragmentShader;
   GLuint programObject;
   GLint linked;

   // Load the vertex/fragment shaders
   vertexShader = LoadShader ( GL_VERTEX_SHADER, vShaderStr );
   fragmentShader = LoadShader ( GL_FRAGMENT_SHADER, fShaderStr );

   // Create the program object
   programObject = glCreateProgram ( );                    // プログラムオブジェクトを作成する
 
   if ( programObject == 0 )
      return 0;

   glAttachShader ( programObject, vertexShader );        // シェーダオブジェクト(頂点シェーダ)をアタッチする
   glAttachShader ( programObject, fragmentShader );    // シェーダオブジェクト(フラグメントシェーダ)をアタッチする

   // Bind vPosition to attribute 0 
   glBindAttribLocation (
       programObject,    // プログラムオブジェクトの名前
       0,                // 頂点属性のインデックス
       "vPosition"        // attribute変数の名前
    );

   // Link the program
   glLinkProgram ( programObject );                                // リンクする。(ハードウェア命令が生成される。)

   // Check the link status
   glGetProgramiv ( programObject, GL_LINK_STATUS, &linked );    // 正常にリンクされたかの情報を取得する

   if ( !linked )
   {
      GLint infoLen = 0;

      glGetProgramiv ( programObject, GL_INFO_LOG_LENGTH, &infoLen );
    
      if ( infoLen > 1 )
      {
         char* infoLog = malloc (sizeof(char) * infoLen );

         glGetProgramInfoLog ( programObject, infoLen, NULL, infoLog );
         esLogMessage ( "Error linking program:\n%s\n", infoLog );          
       
         free ( infoLog );
      }

      glDeleteProgram ( programObject );                        // プログラムオブジェクトを削除する
      return FALSE;
   }

   // Store the program object
   userData->programObject = programObject;

   glClearColor ( 0.0f, 0.0f, 0.0f, 0.0f );
   return TRUE;
}

///
// Draw a triangle using the shader pair created in Init()
//
void Draw ( ESContext *esContext )
{
   UserData *userData = esContext->userData;
   GLfloat vVertices[] = {  0.0f,  0.5f, 0.0f,
                           -0.5f, -0.5f, 0.0f,
                            0.5f, -0.5f, 0.0f };
    
   // Set the viewport
   glViewport ( 0, 0, esContext->width, esContext->height );
 
   // Clear the color buffer
   glClear ( GL_COLOR_BUFFER_BIT );

   // Use the program object
   glUseProgram ( userData->programObject );

   // Load the vertex data
   glVertexAttribPointer (    // 頂点データをロードする
            0,                // 頂点属性のインデックス(0~最大の頂点属性数-1まで)
            3,                // 頂点配列内で指定される成分の数。1~4でなければならない。
            GL_FLOAT,        // データフォーマット
            GL_FALSE,        // 浮動少数点データ型以外のものが、浮動少数点に変換された時に、正規化するかどうかを指定する
            0,                // strideが0の場合、すべての頂点の属性データは連続して格納されます。
            vVertices        // 頂点属性データを保持するバッファへのポインタ
    );

   glEnableVertexAttribArray ( 0 );

   glDrawArrays ( GL_TRIANGLES, 0, 3 );

   eglSwapBuffers ( esContext->eglDisplay, esContext->eglSurface );
}


int main ( int argc, char *argv[] )
{
   ESContext esContext;
   UserData  userData;

   esInitContext ( &esContext );
   esContext.userData = &userData;

   esCreateWindow ( &esContext, "Hello Triangle", 320, 240, ES_WINDOW_RGB );
 
   if ( !Init ( &esContext ) )
      return 0;

   esRegisterDrawFunc ( &esContext, Draw );
 
   esMainLoop ( &esContext );
}

Android簡単サンプル【パス描画】

【ソース】
package com.naozary.android.example.simple;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.os.Bundle;
import android.view.View;

public class simple extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // setContentView(R.layout.main);
        setContentView(new GraphicsTestView(this));

    }
}

class GraphicsTestView extends View {
    public GraphicsTestView(Context context) {
        super(context);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        Paint paint = new Paint();
        paint.setColor(
                Color.argb(
                        0xff,        // 透明度
                        0,            // Red
                        0xff,        // Green
                        0            // Blue
                )
        );
        paint.setStyle(Paint.Style.STROKE);
      
        Path path = new Path();
      
        // 三角形を作成する
        path.moveTo(40,120);        // Cuurent Pointを指定
        path.lineTo(90, 20);        // 絶対位置で直線を追加
        path.lineTo(140,120);        // 絶対位置で直線を追加
        path.close();
      
        // 四角形を作成する
        path.moveTo(160,20);        // Cuurent Pointを指定
        path.rLineTo(0, 100);        // 相対移動で線を追加
        path.rLineTo(100,0);        // 相対移動で線を追加
        path.rLineTo(0,-100);        // 相対移動で線を追加
        path.close();
      
      
        // ベジェ曲線(3次ベジェ曲線)を作成する
        path.moveTo(20,200);      
        path.rCubicTo(
                30,    // The x-coordinate of the 1st control point on a cubic curve
                -50,        // The y-coordinate of the 1st control point on a cubic curve
                200,        // The x-coordinate of the 2nd control point on a cubic curve
                -50,    // The y-coordinate of the 2nd control point on a cubic curve
                250,    // The x-coordinate of the end point on a cubic curve
                0        // The y-coordinate of the end point on a cubic curve
        );
        path.close();
      
      
      

       
        path.moveTo(10,250);
        path.rCubicTo(50, -40, 150, 40, 250, 0);
     


        path.moveTo(10,300);
        path.rCubicTo(100, -60, 150, 60, 250, 0);

      
        path.moveTo(10,380);
        path.rCubicTo(100, -60, 150, -60, 250, 0);
      
      
        canvas.drawPath(path, paint);

      
    }
}

【実行結果】

Android簡単サンプル【弧描画】

【ソース】
package com.naozary.android.example.simple;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.os.Bundle;
import android.view.View;

public class simple extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // setContentView(R.layout.main);
        setContentView(new GraphicsTestView(this));

    }
}

class GraphicsTestView extends View {
    public GraphicsTestView(Context context) {
        super(context);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        Paint paint = new Paint();
        paint.setColor(
                Color.argb(
                        255,        // 透明度
                        255,        // Red
                        255,        // Green
                        0            // Blue
                )
        );

        paint.setAntiAlias(true);
        RectF oval1 = new RectF(120.0f, 20.0f, 160.0f, 60.0f);
        canvas.drawArc(oval1, 0, 30, true, paint);
      
        RectF oval2 = new RectF(120.0f, 80.0f, 160.0f, 120.0f);
        canvas.drawArc(oval2, 0, 90, true, paint);
      
        RectF oval3 = new RectF(120.0f, 140.0f, 160.0f, 180.0f);
        canvas.drawArc(oval3, 0, 180, true, paint);
      
        RectF oval4 = new RectF(120.0f, 200.0f, 160.0f, 240.0f);
        canvas.drawArc(oval4, 0, 270, true, paint);

        RectF oval5 = new RectF(120.0f, 260.0f, 160.0f, 300.0f);
        canvas.drawArc(oval5, 90, 270, true, paint);

        RectF oval6 = new RectF(120.0f, 320.0f, 160.0f, 360.0f);
        canvas.drawArc(oval6, 90, 270, false, paint);
      
    }
}

【実行結果】

その他Androidメモ

その他Androidメモ(その都度、適当に記述)


・ログをEclipseで見るには
    Eclipse の「Window」メニュー > 「Show View」 > 「Other」 > 「Android」「LogCat」


Android APIs.
http://developer.android.com/reference/packages.html

Android簡単サンプル【楕円描画】

【ソース】
package com.naozary.android.example.simple;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.os.Bundle;
import android.view.View;

public class simple extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // setContentView(R.layout.main);
        setContentView(new GraphicsTestView(this));

    }
}

class GraphicsTestView extends View {
    public GraphicsTestView(Context context) {
        super(context);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        Paint paint = new Paint();
        paint.setColor(
                Color.argb(
                        255,        // 透明度
                        255,        // Red
                        255,        // Green
                        0            // Blue
                )
        );

        paint.setAntiAlias(true);          
        RectF ovalF = new RectF(  
                120.5f,        // The X coordinate of the left side of the rectagle
                80.5f,        // The Y coordinate of the top of the rectangle
                160.5f,        // The X coordinate of the right side of the rectagle
                120.5f        // The Y coordinate of the bottom of the rectangle
        );
        canvas.drawOval(ovalF, paint);    // 楕円描画

      
        ovalF = new RectF(      
                120.5f,
                150.5f,
                160.5f,
                220.5f
        );
        canvas.drawOval(ovalF, paint);    // 楕円描画
      
    }
}


【実行結果】

Android簡単サンプル【円描画】

【ソース】
package com.naozary.android.example.simple;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.View;

public class simple extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // setContentView(R.layout.main);
        setContentView(new GraphicsTestView(this));

    }
}

class GraphicsTestView extends View {
    public GraphicsTestView(Context context) {
        super(context);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        Paint paint = new Paint();
        paint.setColor(
                Color.argb(
                        255,        // 透明度
                        255,        // Red
                        255,        // Green
                        0            // Blue
                )
        );
      
        canvas.drawCircle(
                120.5f,    // The x-coordinate of the center of the cirle to be drawn
                100.5f,    // The y-coordinate of the center of the cirle to be drawn
                40.0f,    // The radius of the cirle to be drawn
                paint
        );
      
        paint.setAntiAlias(true);  
        canvas.drawCircle(
                120.5f,    // The x-coordinate of the center of the cirle to be drawn
                200.5f,    // The y-coordinate of the center of the cirle to be drawn
                40.0f,    // The radius of the cirle to be drawn
                paint
        );
    }
}


【実行結果】

Android簡単サンプル【矩形描画】

【ソース】
package com.naozary.android.example.simple;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Paint.Style;
import android.os.Bundle;
import android.view.View;

public class simple extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // setContentView(R.layout.main);
        setContentView(new GraphicsTestView(this));

    }
}

class GraphicsTestView extends View {
    public GraphicsTestView(Context context) {
        super(context);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        Paint paint = new Paint();
        paint.setColor(
                Color.argb(
                        255,        // 透明度
                        255,        // Red
                        255,        // Green
                        255            // Blue
                )
        );
      
        Rect rect = new Rect(120, 50, 140, 70);
        canvas.drawRect(rect, paint);

      
        paint.setColor(Color.argb(0xff,0,0,0xff));
      
        RectF rectF = new RectF(150.5f, 80.5f, 190.5f, 120.5f);
        canvas.drawRect(rectF, paint);
      
        paint.setColor(Color.argb(0xff,0xff,0,0));
        paint.setStyle(Style.STROKE);
        canvas.drawRect(100, 150, 150, 200, paint);
      

        paint.setColor(Color.argb(0xff,0,0xff,0));
        paint.setStyle(Style.FILL );
        canvas.drawRect(100, 220, 130, 250, paint);
      
      
    }
}


【実行結果】

Android簡単サンプル【線描画】

【ソース】
package com.naozary.android.example.simple;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.View;

public class simple extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // setContentView(R.layout.main);
        setContentView(new GraphicsTestView(this));

    }
}

class GraphicsTestView extends View {
    public GraphicsTestView(Context context) {
        super(context);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        Paint paint = new Paint();
        paint.setColor(
                Color.argb(
                        255,        // 透明度
                        255,        // Red
                        255,        // Green
                        255            // Blue
                )
        );
        canvas.drawLine(0, 0, 30, 30, paint);
      
        float[] pts     = {    // 点のデータ
                60,    60,        // 1番目の線-始点X,y              
                60,    80,        // 1番目の線-終点X,y
                60 ,80,        // 2番目の線-始点X,y
                100,80,        // 2番目の線-終点X,y
                100 ,80,    // 3番目の線-始点X,y
                100,100        // 3番目の線-終点X,y
        };
        canvas.drawLines(pts, paint);
      
    }
}

【実行結果】

Android簡単サンプル【文字描画】

【ソース】
package com.naozary.android.example.simple;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.View;

public class simple extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // setContentView(R.layout.main);
        setContentView(new GraphicsTestView(this));

    }
}

class GraphicsTestView extends View {
    public GraphicsTestView(Context context) {
        super(context);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        Paint paint = new Paint();
        paint.setColor(
                Color.argb(
                        255,        // 透明度
                        255,        // Red
                        255,        // Green
                        255            // Blue
                )
        );
        paint.setTextSize(18);
        canvas.drawText("こんにちはアンドロイドさん!",0,30,paint);
    }
}



【実行結果】

Android簡単サンプル【点描画】

【ソース】
package com.naozary.android.example.simple;

import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.View;

public class simple extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // setContentView(R.layout.main);
        setContentView(new GraphicsTestView(this));

    }
}

class GraphicsTestView extends View {
    public GraphicsTestView(Context context) {
        super(context);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        Paint paint = new Paint();
        paint.setColor(
                Color.argb(
                        255,        // 透明度
                        255,        // Red
                        0,            // Green
                        0            // Blue
                )
        );
      
        canvas.drawPoint(    // 点を描画
                50,            // X座標
                50,            // Y座標
                paint
        );
      

        paint.setColor(    Color.argb(255,0,255,0));
        float[] pts     = {        // 点のデータ
                60,                // 1番目の点-X座標
                60,                // 1番目の点-Y座標
                70,                // 2番目の点-X座標
                70 ,            // 2番目の点-X座標
                80 ,            // 3番目の点-X座標
                80 ,            // 3番目の点-X座標
                90 ,            // 4番目の点-X座標
                90                // 4番目の点-X座標
        };
        canvas.drawPoints(pts, paint);        // 複数の点を描画できる
      
    }
}

【実行結果】

2010年3月24日水曜日

OpenGL ESプログラミング1【PCでの環境設定】

設定

1.とりあえず以下に記述されている手順を行った。
Place the following files from AMD's OpenGL ES 2.0 Emulator in
in this folder (http://developer.amd.com/gpu/opengl/Pages/default.aspx):

* libEGL.lib
* libGLESv2.lib

Alternatively, use the libEGL.lib and libGLESv2.lib from Imagination Technologies
OpenGL ES 2.0 SDK.

For the OpenKODE sample in Chapter 15, place the following file from Acrodea's
OpenKODE Implementation here (http://www.acrodea.co.jp/en/openkode/):

* libKD.lib


2.次に、

AMD\OpenGL ES 2.0 Emulator v1.4\bin\libEGL.dll
AMD\OpenGL ES 2.0 Emulator v1.4\bin\llibGLESv2.dll

をOpenGL_ES_Programming_Guide_v1.0.2\Binにコピーした。






参考
ダウンロード先:http://www.opengles-book.com


Windows - Prerequisites

In order to be able to build and run the code samples, you will need:
  • Microsoft Windows XP or Windows Vista
  • An OpenGL 2.0-capable Graphics Card
  • Microsoft Visual Studio 2005 or Microsoft Visual Studio 2008 (you can also use the free Express Edition available from Microsoft at http://www.microsoft.com/express/download/).
You will need to download and install the following:
  1. In order to build and run the code samples, you will need AMD's OpenGL ES 2.0 Emulator which can be downloaded from http://developer.amd.com/gpu/opengl/Pages/default.aspx.
  2. In order to view the RenderMonkey example workspaces, you will need to download and install RenderMonkey v1.81. This tool can be downloaded from AMD Developer Central at http://developer.amd.com/gpu/rendermonkey/Pages/default.aspx.
  3. In order to build and run the OpenKODE sample in Chapter 15, you will need Acrodea's OpenKODE 1.0 Implementation for Windows.  This can be downloaded from http://www.acrodea.co.jp/en/openkode/ (NOTE: if you do not care to build/run the OpenKODE sample in Chapter 15, you can skip this step).






■AMD’s OpenGL ES 2.0 Emulator
http://developer.amd.com/gpu/opengl/Pages/default.aspx




Overview
AMD’s OpenGL ES 2.0 Emulator is designed to emulate functionality that will be exposed by future mobile AMD hardware. The purpose of this emulator is to aid developers in their design of OpenGL ES 2.0 games and applications. The emulator allows developers to get a head start designing their graphics code before hardware supporting OpenGL ES 2.0 is available, and even after this hardware becomes available developing on a PC is often advantageous due to superior developer and debugging tools.
What's New
Version 1.4
  • Fix for MakeBinaryShader.exe not support lines more than 256 characters.
Version 1.3
  • Fix for local users running the tool without admin privileges.
Version 1.2
The OpenGL ES Emulator Control Panel enables control of many emulator options including:
  • Modifying the screen size
  • Modifying the available GPU memory
  • Performance throttling
  • Sending debugging output to files
  • Viewing debugging output on the screen
Features and Prerequisites
The emulator has three major features:
  • Support for core OpenGL ES 2.0 functionality
  • Support for many important OpenGL ES 2.0 extensions
  • Support for EGL 1.3
Prerequisites
Check the following before running the emulator:
  • Recommended hardware is ATI Radeon X1300 or higher. ATI Radeon 9500 is the minimum required hardware. Equivalent hardware from other vendors may work, but it is not tested.
  • If you are running ATI graphics hardware you should install the latest Catalyst drivers from AMD Support & Drivers.
  • Microsoft Visual Studio 2005
Download
Reset My View

File NameLaunch DateOSBitnessDescription
ESEmulator.2009-04-28-v1.4.APRIL_2009_RELEASE.msi (15.3MB)04/29/2009Windows® BothAids developers in their design of OpenGL ES 2.0 games and applications.





■RenderMonkey™ Toolsuite
http://developer.amd.com/gpu/rendermonkey/Pages/default.aspx
Skip Navigation Links



Overview
RenderMonkey is a rich shader development environment for both programmers and artists which facilitates the collaborative creation of real-time shader effects.

»For Programmers
»For Artists
»Downloads & Resources
For Programmers

RenderMonkey Image
  • RenderMonkey contains a full featured shader editor, allowing for rapid prototyping of shaders. The integrated shader compiler and preview window provide immediate visual feedback for the effect under development - ensuring that errors in programming are identified early in the development process.
  • Incorporates a number of features to aid in shader debugging and optimization.
  • The RenderMonkey SDK supports the creation of custom importers and exporters, allowing tight integration of RenderMonkey into your current workflow
  • Support for Microsoft's DirectX .FX format ensures interoperability with all major DCC packages.

For Artists

RenderMonkey  Image
  • The artist specific workspace view and artist editor allows much of the programming complexity of shaders to be hidden from artists
  • Shader parameters can be adjusted using familiar widgets.
  • The integrated preview window provides immediate visual feedback on any changes.
  • RenderMonkey is tightly coupled with artists existing texture and modelling tools.
RenderMonkey includes full support for the latest DirectX® (9.1), OpenGL® (2.0), and OpenGL ES® (2.0) shading languages. RenderMonkey also includes a large number of sample effects which are freely available to be used and customized for your applications.

Downloads & Resources



Reset My View

File NameLaunch DateOSBitnessDescription
RenderMonkey™ 1.82 (94.6MB)12/18/2008Windows®BothRenderMonkey is a rich shader development environment for both programmers and artists which facilitates the collaborative creation of real-time shader effects.



OpenKODE
http://www.acrodea.co.jp/

END USER LICENSE AGREEMENT

THIS LICENSE AGREEMENT (THE "AGREEMENT") GRANTS YOU (AN ENTITY OR PERSON) A LICENSE TO USE THE LICENSED SOFTWARE AND DOCUMENTATION AS SPECIFIED BELOW. READ THIS AGREEMENT CAREFULLY BEFORE INSTALLING OR USING THE LICENSED SOFTWARE. BY INSTALLING AND/OR USING THE LICENSED SOFTWARE, YOU AGREE TO BE BOUND TO THE TERMS AND CONDITIONS STATED BELOW. IF YOU DO NOT AGREE TO ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT, PROMPTLY DESTROY OR RETURN THE LICENSEDSOFTWARE AND ACCOMPANYING DOCUMENTATION TO ACRODEA INC., OR THE DISTRIBUTOR YOU RECEIVED THE LICENSED SOFTWARE FROM.
OpenKODE 1.0 (here in after called "OpenKODE") LICENSE AGREEMENT
1. SOFTWARE. As used in this Agreement, the term "Licensed Software" means collectively: (i) the object code and data form of the software referred to as "OpenKODE", (ii) the installation package of OpenKODE and(iii) the documentation related thereto.
2. LICENSE GRANT. Acrodea Inc. grants you a non-exclusive, non-transferable license to use the Licensed Software. For this limited purpose you may one or more of the following: (i) copy the installation package of the Licensed Software onto the hard disk or other permanent storage media of one computer and install from the installation package the Licensed Software into the memory of the device ("Device") you obtained the installation package for, e.g. Microsoft Windows Computer, for purposes of executing the program; (ii) install the installation package of the Licensed Software from storage card to Device for purposes of executing the program; and/or (iii) use a preinstalled version of Licensed Software.
3. LIMITATIONS ON USE. You may not copy, distribute, or make derivative works of the Licensed Software except as follows:
(a) you may install the Licensed Software using the provided installer into the Device;
(b) you may install the documentation of the Licensed Software into the Device;
(c) you must include all the files that were included in the installationpackage with the copies that you make of the Licensed Software;
(d) you may take a backup copy of the Licensed Software.
You may remove the Licensed Software from the Device only by uninstallingor otherwise wholly removing the Licensed Software.
4. OTHER RESTRICTIONS. The Licensed Software and all rights, without limitation including proprietary rights therein, are owned by Acrodea Inc. and are protected by laws of Japan and international treaty provisions. With respect tothe Licensed Software, you may not: (i) copy the Licensed Software except as permitted above. Any other copies you make of the Licensed Software are in violation of this Agreement; (ii) sublicense, rent, lease grant a security interest in, or otherwise transfer rights to the Licensed Software; (iii) modify, translate, reverse engineer, decompile, or disassemble the Licensed Software programsprovided to you in object code format; (iv) remove or alter any trademark, logo, copyright or other proprietary notices, legends, symbols or labels in the Licensed Software, or in the copies you have made of the Licensed Software. Notwithstanding the foregoing, nothing in this Agreement shall be construed as limiting your rights to use OpenKODE.
5. TERMINATION. This Agreement is effective from the first date you install the Licensed Software. You may terminate this Agreement at any time by destroying the Licensed Software, all backup copies and all related materials provided by Acrodea Inc. or distributors. Your licensing rights automatically and immediately terminate without notice if you fail to comply with any provision herein.
6. NO WARRANTY. YOU ACKNOWLEDGE AND AGREE THAT THE LICENSED SOFTWARE FEATURES INCLUDED IN THE LICENSED SOFTWARE ARE PROVIDED TO YOU ON AN "AS IS" BASIS, WITHOUT ANY WARRANTY OF ANY KIND, INCLUDING WITHOUT LIMITATION THE WARRANTIES THAT THE LICENSED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LICENSED SOFTWARE IS BORNE BY YOU.
7. NO OTHER OBLIGATIONS. This Agreement creates no obligations on the part of Acrodea Inc. or its distributors other than as specifically set forth herein. Specifically, and without limitation, this Agreement creates no training, maintenance or service obligations on the part of Acrodea Inc. or its sublicensors or distributors.
8. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, TORT, CONTRACT, OR OTHERWISE, SHALL ACRODEA INC. OR ITS SUBLICENSORS, SUPPLIERS OR DISTRIBUTORS BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY DAMAGES OF ANY KIND ARISING OUT OF THE USE OR INABILITY TO USE THE LICENSED SOFTWARE OR ANYDATA SUPPLIED THEREWITH OR OTHERWISE OUT OF THIS AGREEMENT, REGARDLESS OF WHETHER THEY ARE DIRECT, INDIRECT, SPECIAL, INCIDENTIAL, OR CONSEQUENTIAL DAMAGES OF ANY KIND INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGESOR LOSSES. IN NO EVENT WILL ACRODEA INC. BE LIABLE FOR ANY DAMAGES, EVEN IF ACRODEA INC. IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY THIRD PARTY. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM ACRODEA INC<80><99>S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION.
9. ATTORNEY FEES. In the event Acrodea Inc. is required to initiate legalproceedings to enforce any provision of this Agreement or you initiate any legal proceedings relating to this Agreement, the prevailing party shall be entitled to recover all reasonable attorneys' fees from the other party.
10. NOTICES. All notices of the Licensed Software and Documentation should be delivered to: Acrodea Inc. 18F, Nakameguro GT Tower, 2-1-1 Kamimeguro, Meguro-ku, Tokyo, 153-0051 Japan.
11. MISCELLANEOUS. This Agreement shall be governed by the laws of Japan excluding the rules of conflicts of laws of the Japanese legislation. If any provision of this Agreement is held to be void, invalid, unenforceable or illegal,the other provisions shall continue in full force and effect.
I agree to the above END-USER LICENSE AGREEMENT (EULA)




[参考書籍]
OpenGL ES 2.0プログラミングガイド