Skip to content

Instantly share code, notes, and snippets.

@naojitaniguchi
naojitaniguchi / convert.bat
Created October 15, 2015 07:00
convert image sequence by image magic
convert frame*.tif -scene 1 frame%04d.png
@naojitaniguchi
naojitaniguchi / SplashImage.cs
Last active October 19, 2015 07:27
Splash screen script for Unity
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public enum Fade{ In, Out };
public class SplashImage : MonoBehaviour {
public float fadeTime = 1.0f ;
public int nextScene ;
@naojitaniguchi
naojitaniguchi / ScrollTexture.cs
Created October 20, 2015 10:18
Scroll texture in Unity
using UnityEngine;
using System.Collections;
public class ScrollTexture : MonoBehaviour {
public float scrollSpeed = 0.0004f ;
private Mesh mesh ;
// Use this for initialization
void Start () {
mesh = GetComponent<MeshFilter>().mesh ;
@naojitaniguchi
naojitaniguchi / ButtonCallback.cs
Created October 21, 2015 09:38
GUI button callback sample for Unity5
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class ButtonCallback : MonoBehaviour {
// Use this for initialization
void Start () {
Button button = this.GetComponent<Button>();
button.onClick.AddListener(onClicked);
@naojitaniguchi
naojitaniguchi / SaveRenderTextureButton.cs
Created October 21, 2015 10:50
Get Pixel data from Render Texture and save Pixel data to .png file in button call back . Unity5
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.IO;
public class SaveRenderTextureButton : MonoBehaviour {
public Camera targetCamera;
public string saveFileName;
private Texture2D targetTexture;
@naojitaniguchi
naojitaniguchi / montage.sh
Last active January 15, 2016 00:37
tiling image with alpha channel by montage(ImageMagic)
montage -background none hoge*.png -tile 2X3 out.png
using UnityEngine;
using System.Collections;
// マウスのボタンをあらわす番号がわかりにくかったので名前を付けた
enum MouseButtonDown {
MBD_LEFT = 0,
MBD_RIGHT,
MBD_MIDDLE,
};
@naojitaniguchi
naojitaniguchi / SetValueToChildren.cs
Created May 25, 2016 05:06
Set value to children under target node
using UnityEngine;
using System.Collections;
public class SetValueToChildren : MonoBehaviour {
// Use this for initialization
void Start () {
}
@naojitaniguchi
naojitaniguchi / publish.bat
Created June 2, 2016 07:54
windows batch file to publish rendered image and unity project files .
@echo off
rem publish batch file
rem set project root here
SET PROJ_ROOT=Y:\Pre2016TVED2\
rem set sequence shot cut here
SET SEQ_SHOT_CUT=seq\01unity\shot\s101\\c001
rem set unity_project here
SET UNITY_PROJ=project_01unity_s101c001
@naojitaniguchi
naojitaniguchi / MayaでSkydomeを設定してMental RayでGI
Created June 27, 2016 02:49
MayaでSkydomeを設定してMental RayでGI
1. Sphere Polygonを作る、名前をSkyDomeにしておく
2. equirectangularで画像で検索、適当にequirectangularの画像をダウンロードしておく
3. hypershadeで file[texture] ノードを作る
4. fileノードにダウンロードした画像を指定
5. hypershadeでsurfaceShaderを作る
6. SkyDomeにマテリアルを割り当てる
7. SkyDomeのスケールを調整 100とか
8. SkyDomeの背面の表示をoffにする SkyDomeShape -> RenderStatus -> Double Sided を offに
9. SkyDomeの影の設定をoffにするSkyDomeShape -> RenderStatus -> Casts Shadows, Receive Shadows を offに
10. レンダリング設定で Finall Gatherをonに Render Settings -> Quality -> Advanced Light Sampling -> Indirect Diffuse(GI) Mode で Finalgatherを選択