シェーダーを活用した3Dライブ演出のアップデート ~『ラブライブ!スクールアイドルフェスティバル ALL STARS』(スクスタ)の開発事例~KLab Inc. / Tech
This document discusses updates to 3D live performance rendering in Love Live! School Idol Festival All Stars (SIFAS) using shaders. It describes how vertex shaders were used to animate butterfly wings flapping and fans waving to reduce CPU load while maintaining production efficiency. Particle systems were combined with custom vertex streams and shader modifications to extend the single butterfly implementation to multiple butterflies. GPU instancing was also proposed as an alternative solution.
シェーダーを活用した3Dライブ演出のアップデート ~『ラブライブ!スクールアイドルフェスティバル ALL STARS』(スクスタ)の開発事例~KLab Inc. / Tech
This document discusses updates to 3D live performance rendering in Love Live! School Idol Festival All Stars (SIFAS) using shaders. It describes how vertex shaders were used to animate butterfly wings flapping and fans waving to reduce CPU load while maintaining production efficiency. Particle systems were combined with custom vertex streams and shader modifications to extend the single butterfly implementation to multiple butterflies. GPU instancing was also proposed as an alternative solution.
18. 18
using UnityEngine;
using UnityEngine.UI;
public class SliderValue2Shader : MonoBehaviour {
public Material _mat;
public Slider _sli_r;
public void Slider2shader()
{
_mat.SetFloat("_r", _sli_r.value);
}
}
スライダーの値をシェーダに送る関数
先ほど作成したマテリアルとスライダーを割り当てる
スライダーを動かすたびに実行される。
シェーダ側にあらかじめ
float _r;
を用意しておくと、この関数を実行するたびにシェーダ側の _r の
値が変更される。
ココの文字列は4でC#スクリプトを作成時に付けた名前にすること。
19. 19
Material.SetFloat public void SetFloat (string propertyName, float value)
public Material _mat;
public void Float2Shader()
{
_mat.SetFloat("_aaa", 0.5f);
}
Material.SetVector public void SetVector (string propertyName, Vector4 vector);
Material.SetTexture public void SetTexture(string propertyName, Texture texture);
public Material _mat;
public void Vector2Shader()
{
_mat.SetVector("_bbb", new Vector4(0.5f, 0.9f, -0.3f, 1.0f));
}
public Material _mat;
public Texture _colorTexture;
public void Tex2Shader()
{
_mat.SetTexture("_colorTex", _colorTexture);
}
【参考】