【Unity】万人同屏, 从入门到放弃之——自定义BatchRendererGroup合批渲染海量物体

Unity万人同屏动态避障 GPU动画 Entities Graphics高性能合批渲染插件的使用_哔哩哔哩_bilibili

由于Dots的限制太多,对于需要dlc或热更的项目来说,Dots就爱莫能助。能不能不用Entities,只用Entities Graphics呢?

当然是可以的,Entities Graphics背后使用的接口就是Batch Renderer Group; 

自定义BatchRenderGroup合批渲染, 可以参考Unity官方文档:Initializing a BatchRendererGroup object - Unity 手册

1. 创建一个BatchRenderGroup对象和Graphics Buffer:

m_BRG = new BatchRendererGroup(this.OnPerformCulling, IntPtr.Zero);

m_InstanceData = new GraphicsBuffer(GraphicsBuffer.Target.Raw,
            BufferCountForInstances(kBytesPerInstance, kNumInstances, kExtraBytes),
            sizeof(int));

2. 注册需要渲染的Mesh和对应的Material:

m_MeshID = m_BRG.RegisterMesh(mesh);
m_MaterialID = m_BRG.RegisterMaterial(material); 

3. 为所有需要渲染的目标创建矩阵数组并传入Graphics Buffer里:

 m_InstanceData.SetData(objectToWorld, 0, (int)(byteAddressObjectToWorld / kSizeOfPackedMatrix), objectToWorld.Length);
        m_InstanceData.SetData(worldToObject, 0, (int)(byteAddressWorldToObject / kSizeOfPackedMatrix), worldToObject.Length);

4. 把Graphics Buffer添加到BatchRenderGroup进行批次渲染:

m_BatchID = m_BRG.AddBatch(metadata, m_InstanceData.bufferHandle);

创建BatchRenderGroup需要指定一个OnPerformCulling,在相机Culling时自动回调,这里可以直接使用Unity手册里的示例代码:Creating draw commands - Unity 手册

这里我主要测试的使用BatchRenderGroup合批渲染的性能,使用Job System多线程并行修改矩阵数组的位置和旋转,以控制小人移动起来。

控制小人移动的Job System代码如下:

[BurstCompile]
partial struct RandomMoveJob : IJobParallelFor
{
    [ReadOnly]
    public Unity.Mathematics.Random random;
    [ReadOnly]
    public float4 randomPostionRange;
    [ReadOnly]
    public float m_DeltaTime;

    public NativeArray<Matrix4x4> matrices;
    public NativeArray<float3> targetMovePoints;
    public NativeArray<PackedMatrix> obj2WorldArr;
    public NativeArray<PackedMatrix> world2ObjArr;
    [BurstCompile]
    public void Execute(int index)
    {
        float3 curPos = matrices[index].GetPosition();
        float3 dir = targetMovePoints[index] - curPos;
        if (Unity.Mathematics.math.lengthsq(dir) < 0.4f)
        {
            var newTargetPos = targetMovePoints[index];
            newTargetPos.x = random.NextFloat(randomPostionRange.x, randomPostionRange.y);
            newTargetPos.z = random.NextFloat(randomPostionRange.z, randomPostionRange.w);
            targetMovePoints[index] = newTargetPos;
        }

        dir = math.normalizesafe(targetMovePoints[index] - curPos, Vector3.forward);
        curPos += dir * m_DeltaTime;// math.lerp(curPos, targetMovePoints[index], m_DeltaTime);

        var mat = matrices[index];
        mat.SetTRS(curPos, Quaternion.LookRotation(dir), Vector3.one);
        matrices[index] = mat;
        var item = obj2WorldArr[index];
        item.SetData(mat);
        obj2WorldArr[index] = item;

        item = world2ObjArr[index];
        item.SetData(mat.inverse);
        world2ObjArr[index] = item;
    }
}

然后在主线程Update每帧Jobs逻辑,把Jobs运算结果传入Graphics Buffer更新即可:

private void Update()
    {
        NativeArray<Matrix4x4> tempMatrices = new NativeArray<Matrix4x4>(matrices, Allocator.TempJob);
        NativeArray<float3> tempTargetPoints = new NativeArray<float3>(m_TargetPoints, Allocator.TempJob);//worldToObject
        NativeArray<PackedMatrix> tempobjectToWorldArr = new NativeArray<PackedMatrix>(matrices.Length, Allocator.TempJob);
        NativeArray<PackedMatrix> tempWorldToObjectArr = new NativeArray<PackedMatrix>(matrices.Length, Allocator.TempJob);
        random = new Unity.Mathematics.Random((uint)Time.frameCount);
        var moveJob = new RandomMoveJob
        {
            matrices = tempMatrices,
            targetMovePoints = tempTargetPoints,
            random = random,
            m_DeltaTime = Time.deltaTime * 4f,
            randomPostionRange = m_randomRange,
            obj2WorldArr = tempobjectToWorldArr,
            world2ObjArr = tempWorldToObjectArr
        };
        var moveJobHandle = moveJob.Schedule(tempMatrices.Length, 64);
        moveJobHandle.Complete();
        matrices = moveJob.matrices.ToArray();
        m_TargetPoints = moveJob.targetMovePoints.ToArray();
        m_InstanceData.SetData(moveJob.obj2WorldArr, 0, (int)(byteAddressObjectToWorld / kSizeOfPackedMatrix), objectToWorld.Length);
        m_InstanceData.SetData(moveJob.world2ObjArr, 0, (int)(byteAddressWorldToObject / kSizeOfPackedMatrix), worldToObject.Length);
        tempMatrices.Dispose();
        tempTargetPoints.Dispose();
        tempobjectToWorldArr.Dispose();
        tempWorldToObjectArr.Dispose();
    }

Okay,跑起来看看:

 瞬间惊呆了,你没看错,使用Batch Renderer Group创建一万的小人居然能跑600多帧!!! 

难道万人同屏要成了?继续加大药量,创建10万个带有移动逻辑的小人:

 10万个奔跑的3D人物,仍然有100帧以上,有23个线程并行计算移动。

看看性能分析:

 当数量级庞大时,即使Job System + Burst编译再怎么开挂,主线程也会拖后腿的。

100万的压迫感,虽然已经成PPT了:

 难道万人同屏行业难题的门槛就这么被Unity Dots打下来了??

非也,上移动端测试:

同样1万个小人,PC端能达到惊人的600帧,而Android最强骁龙8 Gen2只有10多帧,而且工作线程数才5个; 当数量3000人时,手机端帧数46帧左右,相比传统方式没有任何提升!没错,没有任何提升。

Profiler中可以看到,瓶颈依然是GPU。 而Entities Graphics内部也是通过Batch Renderer Group接口实现,由此可以推断,被吹爆的Entities在移动端因该也是"水土不服":

 结论:

目前为止,我认为使用自定义BatchRendererGroup合批是PC端万人同屏的最优解了。

但是手机端性能瓶颈任重道远。手机端放弃!

最后附上本文BatchRendererGroup测试代码:

using System;
using TMPro;
using Unity.Burst;
using Unity.Collections;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Jobs;
using Unity.Jobs.LowLevel.Unsafe;
using Unity.Mathematics;
using UnityEngine;
using UnityEngine.Rendering;

// The PackedMatrix is a convenience type that converts matrices into
// the format that Unity-provided SRP shaders expect.
struct PackedMatrix
{
    public float c0x;
    public float c0y;
    public float c0z;
    public float c1x;
    public float c1y;
    public float c1z;
    public float c2x;
    public float c2y;
    public float c2z;
    public float c3x;
    public float c3y;
    public float c3z;

    public PackedMatrix(Matrix4x4 m)
    {
        c0x = m.m00;
        c0y = m.m10;
        c0z = m.m20;
        c1x = m.m01;
        c1y = m.m11;
        c1z = m.m21;
        c2x = m.m02;
        c2y = m.m12;
        c2z = m.m22;
        c3x = m.m03;
        c3y = m.m13;
        c3z = m.m23;
    }

    public void SetData(Matrix4x4 m)
    {
        c0x = m.m00;
        c0y = m.m10;
        c0z = m.m20;
        c1x = m.m01;
        c1y = m.m11;
        c1z = m.m21;
        c2x = m.m02;
        c2y = m.m12;
        c2z = m.m22;
        c3x = m.m03;
        c3y = m.m13;
        c3z = m.m23;
    }
}
public class SimpleBRGExample : MonoBehaviour
{
    public Mesh mesh;
    public Material material;
    public TextMeshProUGUI text;
    public TextMeshProUGUI workerCountText;
    private BatchRendererGroup m_BRG;

    private GraphicsBuffer m_InstanceData;
    private BatchID m_BatchID;
    private BatchMeshID m_MeshID;
    private BatchMaterialID m_MaterialID;

    // Some helper constants to make calculations more convenient.
    private const int kSizeOfMatrix = sizeof(float) * 4 * 4;
    private const int kSizeOfPackedMatrix = sizeof(float) * 4 * 3;
    private const int kSizeOfFloat4 = sizeof(float) * 4;
    private const int kBytesPerInstance = (kSizeOfPackedMatrix * 2) + kSizeOfFloat4;
    private const int kExtraBytes = kSizeOfMatrix * 2;
    [SerializeField] private int kNumInstances = 20000;
    [SerializeField] private int m_RowCount = 200;
    private Matrix4x4[] matrices;
    private PackedMatrix[] objectToWorld;
    private PackedMatrix[] worldToObject;
    private Vector4[] colors;

    private void Start()
    {
        m_BRG = new BatchRendererGroup(this.OnPerformCulling, IntPtr.Zero);
        m_MeshID = m_BRG.RegisterMesh(mesh);
        m_MaterialID = m_BRG.RegisterMaterial(material);
        AllocateInstanceDateBuffer();
        PopulateInstanceDataBuffer();

        text.text = kNumInstances.ToString();
        random = new Unity.Mathematics.Random(1);
        m_TargetPoints = new float3[kNumInstances];
        var offset = new Vector3(m_RowCount, 0, Mathf.CeilToInt(kNumInstances / (float)m_RowCount)) * 0.5f;
        m_randomRange = new float4(-offset.x, offset.x, -offset.z, offset.z);
        for (int i = 0; i < m_TargetPoints.Length; i++)
        {
            var newTargetPos = new float3();
            newTargetPos.x = random.NextFloat(m_randomRange.x, m_randomRange.y);
            newTargetPos.z = random.NextFloat(m_randomRange.z, m_randomRange.w);
            m_TargetPoints[i] = newTargetPos;
        }
        
    }

    float3[] m_TargetPoints;
    Unity.Mathematics.Random random;
    Vector4 m_randomRange;
    private uint byteAddressObjectToWorld;
    private uint byteAddressWorldToObject;
    private uint byteAddressColor;

    private void Update()
    {
        NativeArray<Matrix4x4> tempMatrices = new NativeArray<Matrix4x4>(matrices, Allocator.TempJob);
        NativeArray<float3> tempTargetPoints = new NativeArray<float3>(m_TargetPoints, Allocator.TempJob);//worldToObject
        NativeArray<PackedMatrix> tempobjectToWorldArr = new NativeArray<PackedMatrix>(matrices.Length, Allocator.TempJob);
        NativeArray<PackedMatrix> tempWorldToObjectArr = new NativeArray<PackedMatrix>(matrices.Length, Allocator.TempJob);
        random = new Unity.Mathematics.Random((uint)Time.frameCount);
        var moveJob = new RandomMoveJob
        {
            matrices = tempMatrices,
            targetMovePoints = tempTargetPoints,
            random = random,
            m_DeltaTime = Time.deltaTime * 4f,
            randomPostionRange = m_randomRange,
            obj2WorldArr = tempobjectToWorldArr,
            world2ObjArr = tempWorldToObjectArr
        };
        var moveJobHandle = moveJob.Schedule(tempMatrices.Length, 64);
        moveJobHandle.Complete();
        matrices = moveJob.matrices.ToArray();
        m_TargetPoints = moveJob.targetMovePoints.ToArray();
        m_InstanceData.SetData(moveJob.obj2WorldArr, 0, (int)(byteAddressObjectToWorld / kSizeOfPackedMatrix), objectToWorld.Length);
        m_InstanceData.SetData(moveJob.world2ObjArr, 0, (int)(byteAddressWorldToObject / kSizeOfPackedMatrix), worldToObject.Length);
        tempMatrices.Dispose();
        tempTargetPoints.Dispose();
        tempobjectToWorldArr.Dispose();
        tempWorldToObjectArr.Dispose();

        workerCountText.text = $"JobWorkerCount:{JobsUtility.JobWorkerCount}";
    }

    private void AllocateInstanceDateBuffer()
    {
        m_InstanceData = new GraphicsBuffer(GraphicsBuffer.Target.Raw,
            BufferCountForInstances(kBytesPerInstance, kNumInstances, kExtraBytes),
            sizeof(int));
    }
    private void RefreshData()
    {
        m_InstanceData.SetData(objectToWorld, 0, (int)(byteAddressObjectToWorld / kSizeOfPackedMatrix), objectToWorld.Length);
        m_InstanceData.SetData(worldToObject, 0, (int)(byteAddressWorldToObject / kSizeOfPackedMatrix), worldToObject.Length);
    }
    private void PopulateInstanceDataBuffer()
    {
        // Place a zero matrix at the start of the instance data buffer, so loads from address 0 return zero.
        var zero = new Matrix4x4[1] { Matrix4x4.zero };

        // Create transform matrices for three example instances.
        matrices = new Matrix4x4[kNumInstances];
        // Convert the transform matrices into the packed format that shaders expects.
        objectToWorld = new PackedMatrix[kNumInstances];
        // Also create packed inverse matrices.
        worldToObject = new PackedMatrix[kNumInstances];
        // Make all instances have unique colors.
        colors = new Vector4[kNumInstances];

        var offset = new Vector3(m_RowCount, 0, Mathf.CeilToInt(kNumInstances / (float)m_RowCount)) * 0.5f;
        for (int i = 0; i < kNumInstances; i++)
        {
            matrices[i] = Matrix4x4.Translate(new Vector3(i % m_RowCount, 0, i / m_RowCount) - offset);
            objectToWorld[i] = new PackedMatrix(matrices[i]);
            worldToObject[i] = new PackedMatrix(matrices[0].inverse);
            colors[i] = UnityEngine.Random.ColorHSV();
        }

        // In this simple example, the instance data is placed into the buffer like this:
        // Offset | Description
        //      0 | 64 bytes of zeroes, so loads from address 0 return zeroes
        //     64 | 32 uninitialized bytes to make working with SetData easier, otherwise unnecessary
        //     96 | unity_ObjectToWorld, three packed float3x4 matrices
        //    240 | unity_WorldToObject, three packed float3x4 matrices
        //    384 | _BaseColor, three float4s

        // Calculates start addresses for the different instanced properties. unity_ObjectToWorld starts at 
        // address 96 instead of 64 which means 32 bits are left uninitialized. This is because the 
        // computeBufferStartIndex parameter requires the start offset to be divisible by the size of the source
        // array element type. In this case, it's the size of PackedMatrix, which is 48.
        byteAddressObjectToWorld = kSizeOfPackedMatrix * 2;
        byteAddressWorldToObject = byteAddressObjectToWorld + kSizeOfPackedMatrix * (uint)kNumInstances;
        byteAddressColor = byteAddressWorldToObject + kSizeOfPackedMatrix * (uint)kNumInstances;

        // Upload the instance data to the GraphicsBuffer so the shader can load them.
        m_InstanceData.SetData(zero, 0, 0, 1);
        m_InstanceData.SetData(objectToWorld, 0, (int)(byteAddressObjectToWorld / kSizeOfPackedMatrix), objectToWorld.Length);
        m_InstanceData.SetData(worldToObject, 0, (int)(byteAddressWorldToObject / kSizeOfPackedMatrix), worldToObject.Length);
        m_InstanceData.SetData(colors, 0, (int)(byteAddressColor / kSizeOfFloat4), colors.Length);

        // Set up metadata values to point to the instance data. Set the most significant bit 0x80000000 in each
        // which instructs the shader that the data is an array with one value per instance, indexed by the instance index.
        // Any metadata values that the shader uses and not set here will be zero. When such a value is used with
        // UNITY_ACCESS_DOTS_INSTANCED_PROP (i.e. without a default), the shader interprets the
        // 0x00000000 metadata value and loads from the start of the buffer. The start of the buffer which is
        // is a zero matrix so this sort of load is guaranteed to return zero, which is a reasonable default value.
        var metadata = new NativeArray<MetadataValue>(3, Allocator.Temp);
        metadata[0] = new MetadataValue { NameID = Shader.PropertyToID("unity_ObjectToWorld"), Value = 0x80000000 | byteAddressObjectToWorld, };
        metadata[1] = new MetadataValue { NameID = Shader.PropertyToID("unity_WorldToObject"), Value = 0x80000000 | byteAddressWorldToObject, };
        metadata[2] = new MetadataValue { NameID = Shader.PropertyToID("_BaseColor"), Value = 0x80000000 | byteAddressColor, };

        // Finally, create a batch for the instances, and make the batch use the GraphicsBuffer with the
        // instance data, as well as the metadata values that specify where the properties are. 
        m_BatchID = m_BRG.AddBatch(metadata, m_InstanceData.bufferHandle);
    }

    // Raw buffers are allocated in ints. This is a utility method that calculates
    // the required number of ints for the data.
    int BufferCountForInstances(int bytesPerInstance, int numInstances, int extraBytes = 0)
    {
        // Round byte counts to int multiples
        bytesPerInstance = (bytesPerInstance + sizeof(int) - 1) / sizeof(int) * sizeof(int);
        extraBytes = (extraBytes + sizeof(int) - 1) / sizeof(int) * sizeof(int);
        int totalBytes = bytesPerInstance * numInstances + extraBytes;
        return totalBytes / sizeof(int);
    }


    private void OnDisable()
    {
        m_BRG.Dispose();
    }

    public unsafe JobHandle OnPerformCulling(
        BatchRendererGroup rendererGroup,
        BatchCullingContext cullingContext,
        BatchCullingOutput cullingOutput,
        IntPtr userContext)
    {
        // UnsafeUtility.Malloc() requires an alignment, so use the largest integer type's alignment
        // which is a reasonable default.
        int alignment = UnsafeUtility.AlignOf<long>();

        // Acquire a pointer to the BatchCullingOutputDrawCommands struct so you can easily
        // modify it directly.
        var drawCommands = (BatchCullingOutputDrawCommands*)cullingOutput.drawCommands.GetUnsafePtr();
        // Allocate memory for the output arrays. In a more complicated implementation, you would calculate
        // the amount of memory to allocate dynamically based on what is visible.
        // This example assumes that all of the instances are visible and thus allocates
        // memory for each of them. The necessary allocations are as follows:
        // - a single draw command (which draws kNumInstances instances)
        // - a single draw range (which covers our single draw command)
        // - kNumInstances visible instance indices.
        // You must always allocate the arrays using Allocator.TempJob.
        drawCommands->drawCommands = (BatchDrawCommand*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf<BatchDrawCommand>(), alignment, Allocator.TempJob);
        drawCommands->drawRanges = (BatchDrawRange*)UnsafeUtility.Malloc(UnsafeUtility.SizeOf<BatchDrawRange>(), alignment, Allocator.TempJob);
        drawCommands->visibleInstances = (int*)UnsafeUtility.Malloc(kNumInstances * sizeof(int), alignment, Allocator.TempJob);
        drawCommands->drawCommandPickingInstanceIDs = null;

        drawCommands->drawCommandCount = 1;
        drawCommands->drawRangeCount = 1;
        drawCommands->visibleInstanceCount = kNumInstances;

        // This example doens't use depth sorting, so it leaves instanceSortingPositions as null.
        drawCommands->instanceSortingPositions = null;
        drawCommands->instanceSortingPositionFloatCount = 0;

        // Configure the single draw command to draw kNumInstances instances
        // starting from offset 0 in the array, using the batch, material and mesh
        // IDs registered in the Start() method. It doesn't set any special flags.
        drawCommands->drawCommands[0].visibleOffset = 0;
        drawCommands->drawCommands[0].visibleCount = (uint)kNumInstances;
        drawCommands->drawCommands[0].batchID = m_BatchID;
        drawCommands->drawCommands[0].materialID = m_MaterialID;
        drawCommands->drawCommands[0].meshID = m_MeshID;
        drawCommands->drawCommands[0].submeshIndex = 0;
        drawCommands->drawCommands[0].splitVisibilityMask = 0xff;
        drawCommands->drawCommands[0].flags = 0;
        drawCommands->drawCommands[0].sortingPosition = 0;

        // Configure the single draw range to cover the single draw command which
        // is at offset 0.
        drawCommands->drawRanges[0].drawCommandsBegin = 0;
        drawCommands->drawRanges[0].drawCommandsCount = 1;

        // This example doesn't care about shadows or motion vectors, so it leaves everything
        // at the default zero values, except the renderingLayerMask which it sets to all ones
        // so Unity renders the instances regardless of mask settings.
        drawCommands->drawRanges[0].filterSettings = new BatchFilterSettings { renderingLayerMask = 0xffffffff, };

        // Finally, write the actual visible instance indices to the array. In a more complicated
        // implementation, this output would depend on what is visible, but this example
        // assumes that everything is visible.
        for (int i = 0; i < kNumInstances; ++i)
            drawCommands->visibleInstances[i] = i;

        // This simple example doesn't use jobs, so it returns an empty JobHandle.
        // Performance-sensitive applications are encouraged to use Burst jobs to implement
        // culling and draw command output. In this case, this function returns a
        // handle here that completes when the Burst jobs finish.
        return new JobHandle();
    }
}
[BurstCompile]
partial struct RandomMoveJob : IJobParallelFor
{
    [ReadOnly]
    public Unity.Mathematics.Random random;
    [ReadOnly]
    public float4 randomPostionRange;
    [ReadOnly]
    public float m_DeltaTime;

    public NativeArray<Matrix4x4> matrices;
    public NativeArray<float3> targetMovePoints;
    public NativeArray<PackedMatrix> obj2WorldArr;
    public NativeArray<PackedMatrix> world2ObjArr;
    [BurstCompile]
    public void Execute(int index)
    {
        float3 curPos = matrices[index].GetPosition();
        float3 dir = targetMovePoints[index] - curPos;
        if (Unity.Mathematics.math.lengthsq(dir) < 0.4f)
        {
            var newTargetPos = targetMovePoints[index];
            newTargetPos.x = random.NextFloat(randomPostionRange.x, randomPostionRange.y);
            newTargetPos.z = random.NextFloat(randomPostionRange.z, randomPostionRange.w);
            targetMovePoints[index] = newTargetPos;
        }

        dir = math.normalizesafe(targetMovePoints[index] - curPos, Vector3.forward);
        curPos += dir * m_DeltaTime;// math.lerp(curPos, targetMovePoints[index], m_DeltaTime);

        var mat = matrices[index];
        mat.SetTRS(curPos, Quaternion.LookRotation(dir), Vector3.one);
        matrices[index] = mat;
        var item = obj2WorldArr[index];
        item.SetData(mat);
        obj2WorldArr[index] = item;

        item = world2ObjArr[index];
        item.SetData(mat.inverse);
        world2ObjArr[index] = item;
    }
}

  • 10
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
### 回答1: 《Unity 5.x从入门到精通PDF》 是一本关于学习和使用Unity游戏引擎的指南。这本书从入门级别开始,逐步引导读者掌握Unity游戏开发的核心概念和技巧,最终达到精通的水平。以下是一些内容的概述: 该书首先对Unity的基础知识进行了介绍,包括Unity的界面、场景编辑、资源管理、组件和脚本等。通过这些基础知识的学习,读者可以快速上手Unity的开发环境,并了解如何创建基本的游戏场景和对象。 接下来,该书逐步介绍了Unity游戏开发的更高级的概念和技术。这包括游戏对象的控制、动画、物理引擎的应用、碰撞检测、UI界面设计和音频管理等。在这些章节中,读者将学会如何利用Unity提供的工具和功能创建复杂、交互性强的游戏对象和场景。 此外,该书还探讨了一些高级技术和特色功能,比如人工智能、多人游戏开发、虚拟现实和增强现实等。这些章节将对读者进一步提高开发水平和应用技巧有很大的帮助。 《Unity 5.x从入门到精通PDF》结构清晰,内容具体实用,适合初学者和有经验的开发者使用。它通过理论知识和实例代码相结合的方式,帮助读者全面了解和掌握Unity游戏引擎的各种功能和技术。无论是想成为游戏开发者,还是对Unity感兴趣的人,该书都是一个很好的学习资源。 ### 回答2: 《Unity 5.x从入门到精通》是一本关于Unity游戏引擎的教程。它的目标是帮助读者从入门到掌握Unity 5.x的开发技能。 该书的内容涵盖了Unity的基础知识和高级技术,适合初学者和有一定经验的开发者。书中以简明易懂的语言介绍了Unity的基本概念、编辑器的使用方法和常见的开发场景。 《Unity 5.x从入门到精通》的内容包括但不限于以下方面:介绍Unity的界面和基本操作、游戏对象的创建和管理、场景的构建与调试、材质和着色器的使用、光照和阴影的处理、游戏物理和碰撞、动画和控制、UI设计和实现、粒子系统、多人游戏开发、移动平台适配等。 在书中,作者还提供了大量示例代码和实际案例,帮助读者理解和应用所学的知识。此外,该书还介绍了一些常用的开发工具和技巧,如版本控制、性能优化和调试技巧等。 总之,《Unity 5.x从入门到精通》是一本循序渐进、系统全面的教材,它能够帮助读者快速入门Unity的开发,并逐步掌握其高级技术,从而成为一名熟练的Unity开发者。无论是想要开发自己的游戏还是参与团队项目,这本书都能给予读者必要的知识和技能支持。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值