Level Of Detail
    
            
摘要:【Level Of Detail】 LOD0离摄像机最近,LODN离摄像机最远。LOD Group组件的用法是,将此组件挂在根节点上,然后每一个LOD挂同样多的Renderer(通常是子对象)。 At this point the empty object should contain both v
        
阅读全文
摘要:【Syntax】 However,use of raw GLSL is only recommended for testing, or when you know you will only target Mac OS X or OpenGL ES 2.0 compatible mobile d...
        
阅读全文
摘要:【Uniform & Attribute & Varying】 顶点着色器的输入变量用关键字“attribute”来限定。 片段着色器的输入变量(它和顶点着色器的输出变量相对应)用关键字"varying"来限定。 uniform指定这个值从应用程序传递给着色器,并在一个特定的图元中保持为常量值...
        
阅读全文
摘要:【Vertex and fragment programs】 When you use vertex and fragment programs (the so called "programmable pipeline"), most of the hardcoded functionality...
        
阅读全文
摘要:【泛型代码中的默认关键字】 在泛型类和泛型方法中产生的一个问题是,在预先未知以下情况时,如何将默认值分配给参数化类型 T:T 是引用类型还是值类型。如果 T 为值类型,则它是数值还是结构。 给定参数化类型 T 的一个变量 t,只有当 T 为引用类型时,语句 t = null 才有效;只有当 T ...
        
阅读全文
摘要:【向量投影】 给定一个向量u和v,求u在v上的投影向量,如下图。 假设u在v上的投影向量是u’,且向量u和v的夹角为theta。一个向量有两个属性,大小和方向,我们先确定u’的大小(即长度,或者模),从u的末端做v的垂线,那么d就是u’的长度。而u’和v的方向是相同的,v的方向v/|v|也就是u’的
        
阅读全文
摘要:【Gouraud Shading】 Gouraud Shading (高洛德着色/高氏着色) 这种着色的效果要好得多,也是在游戏中使用最广泛的一种着色方式。它可对3D模型各顶点的颜色进行平滑、融合处理,将每个多边形上的每个点赋以一组色调值,同时将多边形着上较为顺滑的渐变色,使其外观具有更强烈的实...
        
阅读全文
摘要:【Flat Shading】 Per-vertex渲染技术是针对每个顶点进行渲染计算,然后把计算得到的颜色值和这个顶点关联起来。然后在多边形的面上进行颜色插值以后的平滑的渲染效果。这也叫做Gouraud Shading。在早起的OpenGL版本中,它是默认的渲染技术。 有的时候我们需要达到遮掩过...
        
阅读全文
摘要:【Rendering with Replaced Shaders】 It works like this: the camera renders the scene as it normally would. the objects still use their materials, but t...
        
阅读全文
摘要:1、voidRender();Description Render the camera manually.This will render the camera. It will use the camera's clear flags, target texture and all other...
        
阅读全文
摘要:【Render Texture】 Render Texturesare special types ofTexturesthat are created and updated at runtime. To use them, you first create a new Render Textu...
        
阅读全文
摘要:【Vertex Lit】 Vertex Lit path generally renders each object in one pass, with lighting from all lights calculated at object vertices. It's the fastes...
        
阅读全文
摘要:【lightmapping】 Window -> Lightmapping,即可打开Lightmaping窗口。 生成lightmap的GameObject的对象必须将Lightmap Static钩上。此举告诉Beast,此GameObject可以被Baked。 Make sure ...
        
阅读全文
摘要:【Stencil】 The stencil buffer can be used as a general purpose per pixel mask for saving or discarding pixels. The stencil buffer is usually an 8 bit...
        
阅读全文
摘要:【Fog】 Fog parameters are controlled with Fog command. Fogging blends the color of the generated pixels down towards a constant color based on dist...
        
阅读全文
摘要:【Blending】 Blending is used to make transparent objects. When graphics are rendered, after all shaders have executed and all textures have been applie
        
阅读全文
摘要:【Alpha Testing】 The alpha test is a last chance to reject a pixel from being written to the screen. After the final output color has been calculat...
        
阅读全文
摘要:【Culling & Depth Testing】 Culling is an optimization that does not render polygons facing away from the viewer. All polygons have a front and a back ...
        
阅读全文
摘要:【Pass】 The Pass block causes the geometry of an object to be rendered once. Pass相当于如下的OpenGL调用序列: 1) glXXX -> ... glXXX -> glDrawElement* , 这是Pass1 2)
        
阅读全文
摘要:【glTexGen】 Rather than having to explicitly provide a texture coordinate for each vertex, we can use texture coordinate generation (texgen) functions...
        
阅读全文
摘要:【UsePass】 The UsePass command uses named passes from another shader.[Syntax] UsePass"Shader/Name" Inserts all passes with a given name from a given...
        
阅读全文
摘要:【Texture Combiner】 After the basic vertex lighting has been calculated, textures are applied. In ShaderLab this is done usingSetTexturecommand. SetT...
        
阅读全文
摘要:【使用Windows绘图合成多张图】 1、点击图片右键选择打开方式→选择画图工具打开图片。 2、这时图片可以改变外框大小,将外框尽量弄大些。 3、点击编辑选中下拉菜单中的粘贴来源,选择需要增加进来的图片。 4、将合成好的图片保存。参考:http://wenku.baidu.com/link?...
        
阅读全文
摘要:【Color, Material, Lighting】 The material and lighting parameters are used to control the built-in vertex lighting. Vertex lighting is the standard Di...
        
阅读全文
摘要:【UV mapping】 UV mappingis the3D modelingprocess of making a 2D image representation of a 3D model's surface. This process projects atexture maponto ...
        
阅读全文
摘要:【Shaders】1、Vertex-Lit,顶点光照着色器。 Vertex-Litis one of the simplest shaders.All lights shining on it are rendered in a single pass and calculated at vert...
        
阅读全文
摘要:【ShaderLab】 Shader is the root command of a shader file. Each file must define one (and only one) Shader. It specifies how any objects whose material 
        
阅读全文
摘要:【可空类型】 Nullable types are instances of theSystem.Nullablestruct.ANullablecan be assigned the valuestruefalse, ornull.The ability to assignnullto nume...
        
阅读全文
摘要:【Interface Property】 Properties can be declared on aninterface (C# Reference). 按如下形式实现interfac来避免冲突。 在没有interface前缀的情况下,编译器不会报错,2个interface引用同一...
        
阅读全文
摘要:【GC类】 GC是一个静态类。 垃圾回收器跟踪并回收托管内存中分配的对象。垃圾回收器定期执行垃圾回收以回收分配给没有有效引用的对象的内存。当使用可用内存不能满足内存请求时,垃圾回收会自动进行。或者,应用程序可以使用Collect方法强制进行垃圾回收。 垃圾回收器不识别非托管代码中对对象的引...
        
阅读全文
摘要:【GetHashCode】 GetHashCode方法的默认实现不保证针对不同的对象返回唯一值。而且,.NET Framework 不保证GetHashCode方法的默认实现以及它所返回的值在不同版本的 .NET Framework 中是相同的。因此,在进行哈希运算时,该方法的默认实现不得用作唯一...
        
阅读全文
摘要:【DPI】 鼠标的DPI是每英寸点数,也就是鼠标每移动一英寸指针在屏幕上移动的点数。比如400DPI的鼠标,他在移动一英寸的时候,屏幕上的指针可以移动400个点。精度其实DPI这种概念还不能更加准确唯一的表示鼠标的精度。比如,每英寸点数中的“点”,在屏幕上并不是不变的。他受到分辨率等因素的影响,所...
        
阅读全文
摘要:【C# Equals】1、Object.Equals() The type of comparison between the current instance and theobjparameter depends on whether the current instance is a ref...
        
阅读全文
摘要:【C# ValueTypes】1、哪些类型是ValueType?The value types consist of two main categories:StructsEnumerationsStructs fall into these categories:Numeric typesInte...
        
阅读全文
摘要:【boxing & unboxing】 Boxing is the process of converting avalue typeto the typeobjector to any interface type implemented by this value type.When the ...
        
阅读全文
摘要:【params】 By using theparamskeyword, you can specify amethod parameterthat takes a variable number of arguments. param是c#中的变长参数。 You can send a comm...
        
阅读全文
摘要:【隐式类型局部变量】 可以赋予局部变量推断“类型”var而不是显式类型。var关键字指示编译器根据初始化语句右侧的表达式推断变量的类型。推断类型可以是内置类型、匿名类型、用户定义类型或 .NET Framework 类库中定义的类型。 // i is compiled as an intvar ...
        
阅读全文
摘要:【C#匿名类型 - Anonymous Types】 Anonymous types provide a convenient way to encapsulate a set of read-only properties into a single object without having ...
        
阅读全文
摘要:【C#中实例Singleton】1、经典方案:using System; public class Singleton { private static Singleton instance; private Singleton() {} public static Singlet...
        
阅读全文
摘要:【Unity Pitfall 汇总】1、 当脚本被绑定到一个对象时,一个类对象即会被创建,此意味着此类构造函数会被调用。所以在构造函数中不要调用任何运行时才创建的类。相应的初始化方代码应该移至Start方法中。2、需使用UNITY_EDITOR宏来避免在编辑器中调用构造函数。 3、Start()的...
        
阅读全文
摘要:【Unity快捷键】一、Project Browser: 1、Ctrl/Cmd + F :Focus search field 2、Backspace:Jump to parent folder (Win, Two columns) 3、Tab:Shift focus between firs...
        
阅读全文
摘要:【System.Object】1、所有类均继承自System.Object,无论自定义类有无显式继承于System.Object。2、Object的GetType()实例方法用于获取一个类的类型对象System.Type。通过System.Type对象的Name方法,可以获取一个类的类名。 G...
        
阅读全文
摘要:【ExecuteInEditMode】 当我们为MonoBehavior定义了[ExecuteInEditMode]后,我们需要关心Awake和Start在编辑器中的执行状况。 1、当该MonoBehavior在编辑器中被赋于给GameObject的时候,Awake, Start 将被执行。 ...
        
阅读全文
摘要:【preview放大镜】 preview有放大镜功能,放`键即可(键盘左上角,1左边的键)。
        
阅读全文
摘要:【判断当前Selection是否为prefab】PrefabUtility.GetPrefabParent(target) == null && PrefabUtility.GetPrefabObject(target) != null参考:file://localhost/Applications...
        
阅读全文
摘要:【AddComponentMenu】 The AddComponentMenu attribute allows you to place a script anywhere in the "Component" menu. AddComponentMenu用于方便地添加方法。参考:file...
        
阅读全文
摘要:【MenuItem属性】 The MenuItem attribute allows you to add menu items to the main menu.The MenuItem attribute turns any static function into a menu comman...
        
阅读全文
摘要:【render组件】 Render继承于Component. It contians general functionality for all renderers. A renderer is what makes an object appear on the screen. For any...
        
阅读全文
摘要:【Resources】 The Resources class allows you to find and access Objects including assets. Resouces类允许你寻找和访问Objects与Assets。 In the editor, Resources.F...
        
阅读全文
摘要:【不要在遍历子结点时修改parent】 在用for/foreach遍历子结点时,如果在这过程中有改变子结点的parent,会导致不可预料的结果。我所遇到的问题是,在此种情况下,并非所有的子结点都能遍历到。如果硬要循环中修改child.transform.parent,则使用索引,从childCou...
        
阅读全文
摘要:【Transform & Physics】1、Space。Unity定义了Space枚举值,此值如下: 通常通过Space.World、Space.Self来区别一个Vector是按世界坐标系作用还是按本地坐标系作用。参考:file:///D:/Program%20Files%20(x86)/...
        
阅读全文
摘要:【C# Common Keyword II】1、as运算符用于在兼容的引用类型之间执行某些类型的转换。 class csrefKeywordsOperators { class Base { public override string ToSt...
        
阅读全文