您的位置:首页 > 其它

Color, Material, Lighting

2014-07-23 09:50 267 查看
Color, Material, Lighting

  The material and lighting parameters are used to control the built-in vertex lighting. Vertex lighting is the standard Direct3D/OpenGL lighting model that is computed for each vertex.

  material & parameters 参数用于控制vertex lighting。

  Lighting on turns it on. Lighting is affected by Material block, ColorMaterial and SeparateSpecular commands.

  Lighting on 命令开启顶点光照。Lighting受Material、ColorMaterial、SeparateSpecular命令的影响。

  Per-pixel lights are usually implemented with custom vertex/fragment programs and don't use vertex lighting. For these you don't use any of the commands described here, instead you define your own vertex and fragment programs where you do all lighting, texturing and anything else yourself.

  Per-pixel 光照通过通过vertex/fragment 程序来实现,它们不使用顶点光照。Per-pixel光照不使用上述的任何命令,你需要定义自己的vertex & fragment 程序,在那里你要做lighting、texturing等所有的事。

  

Shader "VertexLit" {
Properties {
_Color ("Main Color", Color) = (1,1,1,0)
_SpecColor ("Spec Color", Color) = (1,1,1,1)
_Emission ("Emmisive Color", Color) = (0,0,0,0)
_Shininess ("Shininess", Range (0.01, 1)) = 0.7
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Pass {
Material {
Diffuse [_Color]
Ambient [_Color]
Shininess [_Shininess]
Specular [_SpecColor]
Emission [_Emission]
}
Lighting On
SeparateSpecular On
SetTexture [_MainTex] {
Combine texture * primary DOUBLE, texture * primary
}
}
}
}


View Code

参考:file://localhost/Applications/Unity/Unity.app/Contents/Documentation/Documentation/Components/SL-Material.html

  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: