This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "custom/UI/Default" | |
{ | |
Properties | |
{ | |
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} | |
_Color ("Tint", Color) = (1,1,1,1) | |
[Header(Blending Factor)] | |
[Enum(UnityEngine.Rendering.BlendMode)] _SrcFactor("Src Factor", Float) = 5 // SrcAlpha | |
[Enum(UnityEngine.Rendering.BlendMode)] _DstFactor("Dst Factor", Float) = 10 // OneMinusSrcAlpha |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,82 @@ | |
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt) | |
Shader "custom/Sprites/Default" | |
{ | |
Properties | |
{ | |
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} | |
_Color ("Tint", Color) = (1,1,1,1) | |
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//// rayの定義に視野角を使うか | |
#define RAY_FOVY | |
//// アニメーションするか | |
// #define SCALE_ANIMATION | |
#define GO_ANIMATION | |
//// rotateするか | |
// #define USE_ROTATE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Menger(PVector centerPosition, float sideWidth) | |
{ | |
rect(centerPosition.x - sideWidth / 6, centerPosition.y - sideWidth / 6, | |
sideWidth/3, sideWidth/3); | |
if(sideWidth < 3) return; | |
for(int i=-1; i<2; i++) | |
{ | |
for(int j=-1; j<2; j++) | |
{ | |
if(i==0 && j==0) continue; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//// 何の距離関数を使うか | |
// #define DF_SPHERE | |
#define DF_ROUND_CUBE | |
// #define DF_CUBE | |
//// rayの定義に視野角を使うか | |
#define RAY_FOVY | |
//// repeatするか | |
// #define USE_REPEAT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 距離に応じたフォグ | |
// rLenがカメラと衝突点との距離 | |
float fogCoef = 0.03; | |
float fogAmount = 1.0 - exp(-rLen * fogCoef); | |
vec3 fogColor = vec3(0.9, 0.6, 0.7); | |
gl_FragColor = vec4(mix(color, fogColor, fogAmount), 1.0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var activeComp = app.project.activeItem; | |
function main() { | |
var markers = null; | |
if (activeComp instanceof CompItem == false) { | |
alert("コンポが選択されていません。"); | |
return; | |
} | |
if (activeComp.selectedLayers.length > 1) { | |
alert ("レイヤーを1つだけ選択するか、コンポのみ選択してください。\nレイヤーを選択していない場合はアクティブなコンポのマーカーが使われます。"); | |
return; |