Purpose of implementation.

  • Fully support to mobile devices such as opengl-es 2.x to 3.x.
  • Under limited of instruction counts 180.
  • Under limited texture fetching counts 6.
  • 完全支持移动设备,例如opengl-es 2.x至3.x.
  • 指令数限制下为180。
  • 在有限的纹理抓取下计数为6。

The game I’m developing now implements a point light that doesn’t work at all in the rendering core.

In order to achieve the permeation effect, the LUT of the Ramp method was used to express the depth of ice chunks inherently, and the Glitz phenomenon caused by scattering of ice or snow surface was implemented to give the user a visually interesting feeling.

目前正在开发的游戏在rendering core里Point light完全不能启用。



选择简单的方法在GetMainLightShadowParams() 函数中定义,在特定shader中放置关键字时,可以降低阴影浓度以进行处理。

In addition, the shadow density is weaker than normal objects because it is usually a transparent material of ice. In general, the shadow intensity of directional light is mostly 1, and all other objects are affected.I chose a simple method and defined it inside the GetMainLightShadowParams () function so that if I put keywords inside a specific shader, it handles it by lowering the shadow density.

In-dependency snow shader

Development of ice effect that can be calculated sufficiently with mobile hardware performance. This is mainly used for developing dungeon battle scenes.
Dungeon combat scenes are loaded independently and remove special effects related to weather changes or other environmental changes like other open scenes.
The overall performance was measured and the effect was expressed boldly.


Material Inspector of Unity3D.
//Parralex thickness shader here to start.
				float2 uv = input.uv.xy * float2( 1,1 ) + float2( 0,0 );
				float2 uv_BottomDepthMap = input.uv.xy * _BottomDepthMap_ST.xy +;

				float3 tanToWorld0 = float3( WorldSpaceTangent.x, WorldSpaceBiTangent.x, WorldSpaceNormal.x );
				float3 tanToWorld1 = float3( WorldSpaceTangent.y, WorldSpaceBiTangent.y, WorldSpaceNormal.y );
				float3 tanToWorld2 = float3( WorldSpaceTangent.z, WorldSpaceBiTangent.z, WorldSpaceNormal.z );
				float3 ViewDirTS =  tanToWorld0 * WorldSpaceViewDirection.x + tanToWorld1 * WorldSpaceViewDirection.y  + tanToWorld2 * WorldSpaceViewDirection.z;
				ViewDirTS = normalize(ViewDirTS); //Parallex ice ground viewDir according to tangent
				float4 mask_Var = tex2D(_Mask , uv);
				float2 plx_bottom = ( ( mask_Var.b - 1 ) * ( ViewDirTS.xy / ViewDirTS.z ) * OutterDepthScale ) + uv;
				float2 uv_MiddleDepthMap = input.uv.xy * _MiddleDepthMap_ST.xy +;
				float2 plx_middle = ( ( mask_Var.g - 1 ) * ( ViewDirTS.xy / ViewDirTS.z ) * _MiddleDepthScale ) + uv;
				float4 combinedMiddleBottomAlbedo = lerp( ( tex2D( _BottomMap, plx_bottom ) * _BottomDark ) , ( tex2D( _MiddleMap, plx_middle ) * _MidDark ) , tex2D( _Mask, plx_middle ).r);
				float4 albedoCombined = lerp( combinedMiddleBottomAlbedo , half4(0,0,0,1) , mask_Var.r);
				float2 uv_normalTop = input.uv.xy * _normalTop_ST.xy +;
				float2 uv_RoughnessMap = input.uv.xy * _RoughnessMap_ST.xy +;
				float4 roughness_Var = tex2D( _RoughnessMap, uv_RoughnessMap );
				float3 normalCombined = lerp( float3(0,0,1) , UnpackNormalScale( tex2D( _normalTop, uv_normalTop ), 1.0f ) , ( mask_Var.g * roughness_Var ).rgb);

Categories: shader

Tagged as: , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s