标题: Unity的shader,帮助手册(一) [打印本页] 作者: 会飞的鱼 时间: 2011-12-19 17:18 标题: Unity的shader,帮助手册(一) 英文帮助手册中的一节,不知哪位老兄翻译的,转与此处与大家分享!
Unity Manual > Advanced > Shaders > Shaders: Getting started
This tutorial will teach you how you can create your own shaders and make you game look a lot better!
此教程将指引你如何建立自己的Shaders,让你的游戏场景看起来更好
Unity is equipped with a powerful shading and material language called ShaderLab. In style it is similar to CgFX and Direct3D Effects languages - it describes everything needed to display a Material, not just plain vertex/pixel shaders.
Unity配备了强大的阴影和材料的语言工具称为ShaderLab,以程式语言来看,它类似于CgFX和Direct3D的语法,它不只纪录基本的端点或者映像点(vertex/pixel)资讯,也描述了材质所必要的一切资讯。
Shaders describe properties that are exposed in Unity's Material Inspector and multiple shader implementations (SubShaders) targeted at different graphics hardware capabilities, each describing complete graphics hardware rendering state, fixed function pipeline setup or vertex/fragment programs to use. Vertex and fragment programs are written in high-level Cg programming language or low-level shader assembly.
在unity材质检视器中可以看到Shaders的性质及多重shader(SubShaders)的描述,针对不同图形硬件,每个描述也都完整的说明了图形硬件的彩现状态,fixed function pipeline如何设定、vertex/ fragment programs如何作用。 Vertex and fragment程序可以使用高阶Cg程式语言或低阶shader组合。
In this tutorial we describe how to write shaders in ShaderLab using both fixed function and programmable pipelines. We assume that the reader has a basic understanding of OpenGL or Direct3D render states, fixed function and programmable pipelines and has some knowledge of Cg, HLSL or GLSL programming languages. Some shader tutorials and documentation can be found on NVIDIA and AMD developer sites.
在这个教程中,我们将描述如何使用fixed function与programmable pipelines两种方式于ShaderLab中撰写shaders,我们假设读者拥有基本的OpenGL或Direct3D彩现概念,并对cg有fixed function与programmable pipelines的常识,HLSL或GLSL编程语言技术,一些Shader教程与参考文件可于NVIDIA以及AMD的开发站上取得
Getting started
To create a new shader, either choose Assets->Create->Shader from the menubar, or duplicate an existing shader, and work from that. The new shader can be edited by double-clicking it in the Project View.