Unity3d 內建世界變數

Spiritring發表於2014-01-03
// The following built-in uniforms (except _LightColor0) 
// are also defined in "UnityCG.cginc", 
// i.e. one could #include "UnityCG.cginc" 
uniform float4 _Time, _SinTime, _CosTime; // time values
uniform float4 _ProjectionParams;
// x = 1 or -1 (-1 if projection is flipped)
// y = near plane; z = far plane; w = 1/far plane
uniform float4 _ScreenParams; 
// x = width; y = height; z = 1 + 1/width; w = 1 + 1/height
uniform float4 unity_Scale; // w = 1/scale; see _World2Object
uniform float3 _WorldSpaceCameraPos;
uniform float4x4 _Object2World; // model matrix
uniform float4x4 _World2Object; // inverse model matrix 
// (all but the bottom-right element have to be scaled 
// with unity_Scale.w if scaling is important) 
uniform float4 _LightPositionRange; // xyz = pos, w = 1/range
uniform float4 _WorldSpaceLightPos0; 
// position or direction of light source
uniform float4 _LightColor0; // color of light source 

相關文章