読者です 読者をやめる 読者になる 読者になる

Gregory Igehy

Dancing at hemisphere coordinate

Simple pbs test at Unity 5.3.4f1

Scene0

  • Directional light (intensity 1.0)
  • Diffuse IBL + Specular IBL

f:id:gregory-igehy:20160429191512p:plain

Scene1

  • Diffuse IBL + Specular IBL

f:id:gregory-igehy:20160429191505p:plain

Info

  • top row : albedo = 1.0, metallic = 1.0, roughness = 0.0->1.0
  • bottom row : albedo = 0.5, metallic = 0.0, roughness = 0.0-> 1.0
  • Tone Mapping : Linear clamp

Test : WebPlayer and WebGL demo using Unity

WebPlayer

// Notes of iframe tag

<iframe src="https://googledrive.com/host/0B6u1iyKCmW7cdm5aaW5FWmkwRDQ/index.html" frameborder="0" scrolling="no" width="500" height="400"></iframe>

HTML5

// Notes of iframe tag

<iframe src="https://googledrive.com/host/0B6u1iyKCmW7cdVQ5WGhYUDRJTFk/index.html" frameborder="0" scrolling="no" width="500" height="400"></iframe>

Notes of Unity Optimization

Unity での数学計算のメモ

// 向きをローカル座標系からワールド座標系へ変換
Vector3 world_dir = Camera.main.transform.TransformDirection( local_direction );

// 特定の向きに少しずつ回転させる
Quaternion target_rot = Quaternion.LookRotation( world_dir );
transform.rotation    = Quaternion.RotateTowards( transform.rotation, target_rot, rotationSpeed * Time.deltaTime );

// 特定の向きを向かせる
Quternion quat;
quat.SetLookRotation( world_dir );

// ローカル座標系を設定
GameObject tmp       = (GameObject) Instantiate( prefab, Vector3.zero, Quaternion.Identity );
tmp.transform.parent = hoge.transform;
tmp.transform.localPosition = new Vector3( 0.0, 1.0, 0.0 );
tmp.transform.localRotation = Quaternion.Euler( 90.0f, 0.0f, 0.0f );

// 球面座標系
float horizon_angle = Mathf.Repeat( horizon_angle, 0.0f, 360.0f );
float vertical_angle = Mathf.Clamp( vertical_angle, -20.0f, 50.0f );
Quaternion look_quat = Quaternion.Euler( vertical_angle, horizon_angle, 0.0f );

// カメラの設定
Vector3 camera_offset_pos = look_quat * new Vector3( 0.0,f 0.0f, - look_dist );
Vector3 camera_pos        = look_at_pos + camera_offset_pos;
transform.LookAt( look_at_pos );

AssetPreProcessor のメモ

Upload Unity WebGL/web-player game to Google drive

Notes of character controller in Unity

// v = v0     + a   * t;
// x = v0 * t + 0.5 * a * t^2;

// Δv = a * Δt
world_velocity.y -= gravity * delta_time;

// Δx = v * Δt
characterController.Move( world_velocity * delta_time );

Unity でのシングルトン

広告を非表示にする