2020年5月6日星期三

thumbnail

How to load binary data in Unity3D

The first step is to save your binary data file with the ".bytes" extension. Unity will treat this file as a TextAsset. As a TextAsset the file can be included when you build your AssetBundle. Once you have downloaded the AssetBundle in your application and loaded the TextAsset object, you can use the .bytes property of the TextAsset to retrieve your binary data.
thumbnail

Unity Physicals Rigidbody with multiple colliders

adding colliders changes the center of mass and rotation behaviour of a rigidbody. To set those manualy to the center of the object use:
void Start()
{
    rigidbody = GetComponent();
    rigidbody.centerOfMass = Vector3.zero;
    rigidbody.inertiaTensorRotation = new Quaternion(0, 0, 0, 1);
}
thumbnail

Unity-iPhone has Conflicting Provisioning Settings in XCode

1.Select the top level node called Unity-iPhone in the left tree view (the one with the blue item).

2.Select Automatically manage signing

3.Select your team (now the error message should appear)

4.Go to Build setting in the tab

5.Find the Group called "signing" in the structured table

6.Change the values from "iPhone Developer" to "iOS Developer"

7.Switch back to general (the error message should now disappear)

Your project should compile now and should be runnable on your iPad or iPhone. 
thumbnail

Unity Crash for small compressed texture on some Android device

I created a full white texture with 4x4 size. Unity requires that compressed texture size should be at least 4x4. This will cause some artifact on some Android device, and the frame rate was very slow. 

Later I tried to make true color for this small texture. This time no artifact and no frame rate slow problem. 

I think the texture compression is hardware bind. Althought Unity provide some compression methods, not all of them could be supported well by various of devices. 

Different devices may have different requirement even for the same compression. The most safe way is use true color for them. 
thumbnail

Unity3D Graphics Shader Optimization Tips

During the last few months, I have been working on the Graphics and shader optimization work. 
Good FPS is the balance between art and technocal. A good designed level  and game play should take account the potional performance issue. After the optimization work on the high level was done, we could deep into the lower level, and do some invistigation of shader part.
Here are some tips that you could try:
1) Don’t reinvent the wheel, use instrinsic functions; Some one would like to write his own ‘dot’ function, this is not allowed;
2) Use the most appropriate data types in calculations (float, float2, float3 and float4);
3) Get rid of typecasting when it’s not need. Such as convert float3 to float4, float to float4, fixed to half, half to float…
4) Instead of integers rely on floats for math;
5) When indexing into arrays of constants use integers instead of floats;
6) Combine scalar constants into full vectors, pack array elements into full constant vectors;
7) For conditional compilation use boolean constants declared as static;
8) Whennever possible vectorize code by joining similar operations together;
9) Do not use expensive functions, such as  log, exp, pow, sin, cos;
10) Well arrange the variable calculations among application objects, per vertex and per fragment. Per fragment is the most expensive, per vertex is less expensive, and per object is cheap;
11) Get rid of clip as possible, some one will suggest use alpha blend to replace alpah test;
12) Remove branch statements. Some powerful device will support branch well, like K1 device uber-shader;
13) Reduce the bandwith that pass from vertex shader to fragment shader;
14) Use constant variables when you could make sure what those value is:
15) Be careful on the precision such as float, half, fixed. Use theme properly, and get rid of typecast whenever possible.
thumbnail

APOCALYPSE RUNNER

In the game you are fleeing from the impending huge wave. You have to use every opportunity to not become a victim. Run along the rocky platforms, overcome obstacles, collect bonuses, earn points and compare them with the points of other players.

- Atmospheric setting
- Addictive gameplay
- Simple control
- Built-in online-record table

绝地逃亡是一款休闲类街机游戏,在游戏中你要从即将到来的巨浪中逃离。你要利用一切机会,不然就会变成牺牲品。沿着岩石一直跑下去,克服障碍,收集奖金,赚取积分,并与其他玩家的分数进行比较。

- 大气环境
- 易容上瘾的游戏
- 简单的操控
- 内置在线积分记录

2020年4月26日星期日

thumbnail

DEATH PIPE 3D

Based on the last version as what "ENDLESS RUN 3D" done, "Death Pipe X" came out. The core play mode was kept, but this time some new features are introduced:
- four level provided, with different scene and obstacles and difficulty that you could experience;
- two kinds of coins that you could collect during your fly trip; You could use them trade for some useful props and unlock higher levels;
- one simple store was provided so that you could trade for some props;
- three props provided: moving obstacles out of the pipe;slowing the game time and restore playing from where your crashing.
- And so on, you could enjoy and found them in the game.