
unity
文章平均质量分 58
血月笙歌
Jeremy Menethil
展开
-
[UnityShader2]顶点片段着色器实例
主要参考博客:http://blog.youkuaiyun.com/mobanchengshuang?viewmode=contents1.模型自身坐标位置与颜色的映射[csharp] view plain copyShader "Custom/RGBCube" { SubShader {转载 2017-08-24 18:56:36 · 524 阅读 · 0 评论 -
Failed to start Unity Package Manager: operation timed out.
Hi,We have found one 100% repro step for this issue. An empty hosts file is the cause. We have a fix in the way. But in the meantime, can you check the content of your hosts file. It should be locat...转载 2018-04-02 15:31:12 · 4090 阅读 · 0 评论 -
Unity3D 把Texture2D保存到文件
原链接:https://answers.unity.com/questions/245600/saving-a-png-image-to-hdd-in-standalone-build.html保存Texture2D到文件,可以是exr,jpg,png格式:import System.IO;function SaveTextureToFile( texture: Texture2D翻译 2018-02-07 12:39:28 · 12051 阅读 · 1 评论 -
Too many texture interpolators would be used for ForwardBase pass
这是由于Input中定义的材质uv变量过多,当前版本的shader model不支持造成的。将shader model改为更高的版本即可解决。比如我现在用的#pragma target 3.0不支持3个材质,改为#pragma target 4.0就行了。如果非要用#pragma target 3.0,只能通过共用uv_MainTex或者使用屏幕坐标来解决了。转载 2016-09-19 09:23:29 · 2455 阅读 · 0 评论 -
A星寻路在2.5D游戏中的实现
由于游戏还没有开发完成,在此先不放出游戏内的截图,只贴出测试截图及拐点计算方法。1.初始化所有三角形2.利用A*算法计算所有经过的三角形列表3.计算拐点拐点计算代码:using UnityEngine;using System.Collections;using System.Collections.Generic;public class TurnPointC原创 2018-01-27 11:27:06 · 2291 阅读 · 1 评论 -
Unity中用VS的代码提示失效
Unity5.6和2017+VS2017.在Unity中创建新的C#脚本后,双击打开,在VS中编辑时引用和代码提示全都失效。解决方案:创建C#脚本,不要直接双击打开,先切换到VS窗口,弹出reload后,选择reload项目或者解决方案都可以,然后再从Unity中双击打开,即可解决。 ...原创 2018-01-14 19:35:02 · 10482 阅读 · 7 评论 -
Unity3D版本控制 UnityYAMLMerge合并scene和prefab文件
Smart MergeUnity incorporates a tool called UnityYAMLMerge that can merge scene and prefab files in a semantically correct way. The tool can be accessed from the command line and is also avail转载 2017-12-27 18:24:09 · 3635 阅读 · 0 评论 -
Unity Shaderlab: Object Outlines
One of the simplest and most useful effects that isn’t already present in Unity is object outlines.Screenshot from Left 4 Dead. Image Source: http://gamedev.stackexchange.com/questions/16391/how-c转载 2017-10-13 17:55:46 · 712 阅读 · 0 评论 -
生命周期
Execution Order of Event FunctionsIn Unity scripting, there are a number of event functions that get executed in a predetermined order as a script executes. This execution order is described转载 2017-10-12 14:41:06 · 298 阅读 · 0 评论 -
Unity内置事件
Awake当前控制脚本实例被装载的时候调用。一般用于初始化整个实例使用。Start当前控制脚本第一次执行Update之前调用。Update每帧都执行一次。这是最常用的事件函数。FixedUpdate每固定帧绘制时执行一次,和update不同的是FixedUpdate是渲染帧执行,如果你的渲染效率低下的时候FixedUpdate调用次数就会跟着下降。FixedUpdate比较适用于物理引擎的计算,因转载 2017-10-12 14:27:15 · 738 阅读 · 0 评论 -
unity 替换渲染 ( Rendering with Replaced Shaders )
官方文档:file:///C:/Program%20Files/Unity/Editor/Data/Documentation/en/Manual/SL-ShaderReplacement.html圣典文档:http://www.ceeger.com/Components/SL-ShaderReplacement.html功能:先说说它能干什么。有时候实现一转载 2017-10-18 11:33:15 · 578 阅读 · 0 评论 -
关闭Anti Aliasing 的情况下单独对3D模型抗锯齿
公司的Unity 2.5D游戏,场景基本上都是2D Sprite铺成的,但主角是3D的,不开MSAA的话,3D主角锯齿特别明显,开MSAA的话帧数下降的厉害,所以尝试着对主角单独做了处理。解决方案: 修改角色的材质Shader,使模型边缘半透明,且越接近模型边缘越透明。与背景透明度混合,降低锯齿感。测试结果和 4x Multi Sampling 接近,虽然达不到 8x Multi Sampl...原创 2018-03-28 14:34:29 · 948 阅读 · 0 评论