资源简介

《Unity3D ShaderLab开发实战详解》源代码

资源截图

代码片段和文件信息

using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
public class Deferred_GUI : MonoBehaviour {

public GUISkin skin;
public Rect[] rects;
public string[] labels;
public Rect[] rects2;
public Light[] dirs;
public Rect[] rects3;
Rect[] rects4;
Rect[] rects5;
Rect[] rects6;
public Light[] points;

// Use this for initialization
void Start () {
rects4=new Rect[7];
rects5=new Rect[7];
rects6=new Rect[7];
for(int i=0;i<7;i++)
{
rects4[i]=rects3[i];
rects5[i]=rects3[i];
rects6[i]=rects3[i];
rects4[i].y+=30;
rects5[i].y+=60;
rects6[i].y+=90;
}
}

// Update is called once per frame
void Update () {

}
void OnGUI()
{
GUI.skin=skin;
for(int i=0;i {
GUI.Label(rects[i]labels[i]);
}

GUI.Label(rects2[0]“Path: “+Camera.main.renderingPath+““);
if(GUI.Button(rects2[1]“VertexLit“)){Camera.main.renderingPath=RenderingPath.VertexLit;}
if(GUI.Button(rects2[2]“Forward“)){Camera.main.renderingPath=RenderingPath.Forward;}
if(GUI.Button(rects2[3]“Deferred“)){Camera.main.renderingPath=RenderingPath.DeferredLighting;}

if(GUI.Button(rects2[4]“Dir1:Enable“)){dirs[0].enabled=true;}
if(GUI.Button(rects2[5]“Disable“)){dirs[0].enabled=false;}
if(GUI.Button(rects2[6]“Pixel“)){dirs[0].renderMode=LightRenderMode.ForcePixel;}
if(GUI.Button(rects2[7]“Vertex“)){dirs[0].renderMode=LightRenderMode.ForceVertex;}
GUI.Label(rects2[8]“Direction Light 1:  “+dirs[0].enabled+“   “+dirs[0].renderMode);

if(GUI.Button(rects2[9]“Dir2:Enable“)){dirs[1].enabled=true;}
if(GUI.Button(rects2[10]“Disable“)){dirs[1].enabled=false;}
if(GUI.Button(rects2[11]“Pixel“)){dirs[1].renderMode=LightRenderMode.ForcePixel;}
if(GUI.Button(rects2[12]“Vertex“)){dirs[1].renderMode=LightRenderMode.ForceVertex;}
GUI.Label(rects2[13]“Direction Light 2:  “+dirs[1].enabled+“   “+dirs[1].renderMode);

GUI.Label(rects3[0]points[0].enabled+“  “+points[0].renderMode+“  “+points[0].type+“ :Yellow L“);
if(GUI.Button(rects3[1]“Enable“)){points[0].enabled=true;}
if(GUI.Button(rects3[2]“Disable“)){points[0].enabled=false;}
if(GUI.Button(rects3[3]“Pixel“)){points[0].renderMode=LightRenderMode.ForcePixel;}
if(GUI.Button(rects3[4]“Vertex“)){points[0].renderMode=LightRenderMode.ForceVertex;}
if(GUI.Button(rects3[5]“Point“)){points[0].type=LightType.Point;}
if(GUI.Button(rects3[6]“Direc“)){points[0].type=LightType.Directional;}

GUI.Label(rects4[0]points[1].enabled+“  “+points[1].renderMode+“  “+points[1].type+“ :Green L“);
if(GUI.Button(rects4[1]“Enable“)){points[1].enabled=true;}
if(GUI.Button(rects4[2]“Disable“)){points[1].enabled=false;}
if(GUI.Button(rects4[3]“Pixel“)){points[1].renderMode=LightRenderMode.ForcePixel;}
if(GUI.Button(rects4[4]“Vertex“)){points[1].renderMode=LightRenderMode.ForceVertex;}
if(GUI.Button(rects4[5]“Point“)){points[1].type=LightType.Point;}
if(GUI.Bu

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      72293  2013-05-24 11:48  ShaderLab源程序\Assembly-CSharp-Editor-vs.csproj

     文件      72399  2013-05-24 11:48  ShaderLab源程序\Assembly-CSharp-Editor.csproj

     文件     121789  2013-05-19 13:20  ShaderLab源程序\Assembly-CSharp-Editor.pidb

     文件      65979  2013-08-25 11:28  ShaderLab源程序\Assembly-CSharp-firstpass-vs.csproj

     文件      65979  2013-08-25 11:28  ShaderLab源程序\Assembly-CSharp-firstpass.csproj

     文件     147497  2013-05-19 13:20  ShaderLab源程序\Assembly-CSharp-firstpass.pidb

     文件      68181  2013-08-25 11:41  ShaderLab源程序\Assembly-CSharp-vs.csproj

     文件      68181  2013-08-25 11:41  ShaderLab源程序\Assembly-CSharp.csproj

     文件     314258  2013-05-19 13:20  ShaderLab源程序\Assembly-CSharp.pidb

     文件      66013  2013-08-25 11:28  ShaderLab源程序\Assembly-Unityscript-Editor-firstpass-vs.unityproj

     文件     136969  2013-05-19 13:20  ShaderLab源程序\Assembly-Unityscript-Editor-firstpass.pidb

     文件      66066  2013-08-25 11:28  ShaderLab源程序\Assembly-Unityscript-Editor-firstpass.unityproj

     文件      66632  2013-08-25 11:28  ShaderLab源程序\Assembly-Unityscript-firstpass-vs.unityproj

     文件     180845  2013-05-19 13:20  ShaderLab源程序\Assembly-Unityscript-firstpass.pidb

     文件      66632  2013-08-25 11:28  ShaderLab源程序\Assembly-Unityscript-firstpass.unityproj

     文件      60514  2013-02-17 16:26  ShaderLab源程序\Assembly-Unityscript-vs.unityproj

     文件      96476  2013-02-08 13:45  ShaderLab源程序\Assembly-Unityscript.pidb

     文件      60567  2013-02-17 16:26  ShaderLab源程序\Assembly-Unityscript.unityproj

     文件       4190  2012-12-23 16:51  ShaderLab源程序\Assets\Lighting\Deferred\Deferred_GUI.cs

     文件      42616  2012-12-23 17:30  ShaderLab源程序\Assets\Lighting\Deferred\Lab_1\Lab_1.unity

     文件       4188  2012-12-23 17:06  ShaderLab源程序\Assets\Lighting\Deferred\Lab_1\_Shader\Deferred 1.mat

     文件        552  2012-12-23 16:50  ShaderLab源程序\Assets\Lighting\Deferred\Lab_1\_Shader\Deferred 1.shader

     文件       4188  2012-12-23 17:11  ShaderLab源程序\Assets\Lighting\Deferred\Lab_1\_Shader\Deferred 2.mat

     文件       1033  2012-12-23 17:11  ShaderLab源程序\Assets\Lighting\Deferred\Lab_1\_Shader\Deferred 2.shader

     文件       4188  2012-12-23 17:11  ShaderLab源程序\Assets\Lighting\Deferred\Lab_1\_Shader\Deferred 3.mat

     文件       1035  2012-12-23 17:11  ShaderLab源程序\Assets\Lighting\Deferred\Lab_1\_Shader\Deferred 3.shader

     文件       4188  2012-12-23 17:12  ShaderLab源程序\Assets\Lighting\Deferred\Lab_1\_Shader\Deferred 4.mat

     文件       1496  2012-12-23 17:13  ShaderLab源程序\Assets\Lighting\Deferred\Lab_1\_Shader\Deferred 4.shader

     文件       4156  2012-12-18 15:18  ShaderLab源程序\Assets\Lighting\DigitalColor\DigitalColor.0.2.mat

     文件        488  2012-12-18 15:14  ShaderLab源程序\Assets\Lighting\DigitalColor\DigitalColor.0.2.shader

............此处省略4905个文件信息

评论

共有 条评论