List of built-in shader variables set by legacy pipelines

float4 _Time;
float4 _SinTime;
float4 _CosTime;
float4 unity_DeltaTime;
float3 _WorldSpaceCameraPos;
float4 _ProjectionParams;
float4 _ScreenParams;
float4 _ZBufferParams;
float4 unity_OrthoParams;
float4 unity_CameraWorldClipPlanes[6];
float4 hlslcc_mtx4x4unity_CameraProjection[4];
float4 hlslcc_mtx4x4unity_CameraInvProjection[4];
float4 hlslcc_mtx4x4unity_WorldToCamera[4];
float4 hlslcc_mtx4x4unity_CameraToWorld[4];
float4 _WorldSpaceLightPos0;
float4 _LightPositionRange;
float4 _LightProjectionParams;
float4 unity_4LightPosX0;
float4 unity_4LightPosY0;
float4 unity_4LightPosZ0;
float4 unity_4LightAtten0;
float4 unity_LightColor[8];
float4 unity_LightPosition[8];
float4 unity_LightAtten[8];
float4 unity_SpotDirection[8];
float4 unity_SHAr;
float4 unity_SHAg;
float4 unity_SHAb;
float4 unity_SHBr;
float4 unity_SHBg;
float4 unity_SHBb;
float4 unity_SHC;
float4 unity_OcclusionMaskSelector;
float4 unity_ProbesOcclusion;
float3 unity_LightColor0;
float3 unity_LightColor1;
float3 unity_LightColor2;
float3 unity_LightColor3;
float4 unity_ShadowSplitSpheres[4];
float4 unity_ShadowSplitSqRadii;
float4 unity_LightShadowBias;
float4 _LightSplitsNear;
float4 _LightSplitsFar;
float4 hlslcc_mtx4x4unity_WorldToShadow[16];
float4 _LightShadowData;
float4 unity_ShadowFadeCenterAndType;
float4 hlslcc_mtx4x4unity_ObjectToWorld[4];
float4 hlslcc_mtx4x4unity_WorldToObject[4];
float4 unity_LODFade;
float4 unity_WorldTransformParams;
float4 hlslcc_mtx4x4glstate_matrix_transpose_modelview0[4];
float4 glstate_lightmodel_ambient;
float4 unity_AmbientSky;
float4 unity_AmbientEquator;
float4 unity_AmbientGround;
float4 unity_IndirectSpecColor;
float4 hlslcc_mtx4x4glstate_matrix_projection[4];
float4 hlslcc_mtx4x4unity_MatrixV[4];
float4 hlslcc_mtx4x4unity_MatrixInvV[4];
float4 hlslcc_mtx4x4unity_MatrixVP[4];
int unity_StereoEyeIndex;
float4 unity_ShadowColor;
float4 unity_FogColor;
float4 unity_FogParams;
float4 unity_LightmapST;
float4 unity_DynamicLightmapST;
float4 unity_SpecCube0_BoxMax;
float4 unity_SpecCube0_BoxMin;
float4 unity_SpecCube0_ProbePosition;
float4 unity_SpecCube0_HDR;
float4 unity_SpecCube1_BoxMax;
float4 unity_SpecCube1_BoxMin;
float4 unity_SpecCube1_ProbePosition;
float4 unity_SpecCube1_HDR;
float4 unity_ProbeVolumeParams;
float4 hlslcc_mtx4x4unity_ProbeVolumeWorldToObject[4];
float3 unity_ProbeVolumeSizeInv;
float3 unity_ProbeVolumeMin;

[Custom SRP] How to use Unity features?

May-14-2018 gif

Screen Shot 2018-06-02 at 22.16.24

SRPFlowScreen Shot 2018-05-12 at 18.52.43

(My playground pipeline)

Here lists out exact what codes enable the Unity feature when making our custom SRP.

*Note that my codes may not be perfectly optimised, but the concept itself won’t change.
*Hope the information is accurate enough. I’ll keep them updated.

Indicators:
icon_script In pipeline code
icon_shader In shader code
✅ Doesn’t need to specifically care about it in codes. Write the codes as usual.

Continue reading “[Custom SRP] How to use Unity features?”

StungaLab – 21³ Cubic Animation Tech Note

Me and a few of my friends (StungaLab) decided to create this animation from last year and I’m responsible for all Unity things – setup / shaders / tools / plug-ins etc. I didn’t help a lot as I have my full-time job in UK so most of the work are actually done by the 2 amazing 3D artists Felix Yin-Zhen Chu and Shadow Chi-Ho Wong, also 2D part by Carol Tsz-Ching Ng. It is the first time for us all to put ourselves into such a big production — target at high quality, massive amounts of assets, and short time-frame, (esp. ) lack of knowledge of using Unity (they are almost the first time Unity user). The final animation really surprised me.

I only have mobile game development experience in the past so there was no way for me to grab so many plug-ins and use so many expensive graphics features in any projects. So I had no idea how to correctly set things up for a project like this. Glad that I work in Unity and the knowledge I gained supported me a good start.

Note: Not everything shown in this blog are being used. But they are the stuff I worked on so I hope to keep them here as a log.

Continue reading “StungaLab – 21³ Cubic Animation Tech Note”