资源简介
shadow map范例,对应解释文档参考 http://blog.csdn.net/ronintao/article/details/51649664
代码片段和文件信息
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using ShadowMap;
public class BasicShadowMap : MonoBehaviour
{
public Gameobject sceneAABB;
public FrustumType frustumType;
// For Render
public RenderTexture depthShadowMap;
public Shader depthCaptureShader;
// Use this for initialization
void Start()
{
Camera lightCamera = CreateCamera.Execute(gameobject depthShadowMap);
Camera viewCamera = Camera.main;
if (frustumType == FrustumType.FIT_TO_SCENE)
{
SetFitToScene(lightCamera);
} else
{
SetFitToView(lightCamera viewCamera);
}
CaptureDepth depthCapturer = lightCamera.gameobject.AddComponent();
depthCapturer.SetCaptureShader(depthCaptureShader);
SetProjectionMatrix.Execute(lightCamera);
}
private void SetFitToScene(Camera lightCamera)
{
List sceneBoundVertexs = BoundVertexsDetector.GetSceneBoundVertexs(sceneAABB);
SetLightCameraFrustum.SetFitToScene(lightCamera gameobject sceneBoundVertexs);
}
private void SetFitToView(Camera lightCamera Camera viewCamera)
{
List sceneBoundVertexs = BoundVertexsDetector.GetSceneBoundVertexs(sceneAABB);
List viewBoundVertexs = BoundVertexsDetector.GetPerspectiveCameraFrustumVertexs(viewCamera);
SetLightCameraFrustum.SetFitToView(lightCamera gameobject sceneBoundVertexs viewBoundVertexs);
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-07-07 11:08 ShadowMap\
目录 0 2016-07-05 10:42 ShadowMap\.vs\
目录 0 2016-07-05 10:42 ShadowMap\.vs\ShadowMap\
目录 0 2016-07-05 10:44 ShadowMap\.vs\ShadowMap\v14\
文件 77824 2016-07-06 17:02 ShadowMap\.vs\ShadowMap\v14\.suo
目录 0 2016-07-05 18:28 ShadowMap\Assets\
目录 0 2016-07-05 18:26 ShadowMap\Assets\00 Ref Scene\
文件 192 2016-07-05 18:25 ShadowMap\Assets\00 Ref Scene.me
文件 16952 2016-07-05 18:26 ShadowMap\Assets\00 Ref Scene\unity ref.unity
文件 175 2016-07-05 18:26 ShadowMap\Assets\00 Ref Scene\unity ref.unity.me
目录 0 2016-07-06 16:00 ShadowMap\Assets\01 Basic ShadowMap\
文件 192 2016-07-05 10:37 ShadowMap\Assets\01 Basic ShadowMap.me
文件 18928 2016-07-05 14:20 ShadowMap\Assets\01 Basic ShadowMap\01 Basic ShadowMap.unity
文件 175 2016-07-05 15:34 ShadowMap\Assets\01 Basic ShadowMap\01 Basic ShadowMap.unity.me
文件 1593 2016-07-05 14:50 ShadowMap\Assets\01 Basic ShadowMap\BasicShadowMap.cs
文件 263 2016-07-05 10:41 ShadowMap\Assets\01 Basic ShadowMap\BasicShadowMap.cs.me
文件 503 2016-07-06 16:00 ShadowMap\Assets\01 Basic ShadowMap\CaptureDepth.cs
文件 263 2016-07-05 14:09 ShadowMap\Assets\01 Basic ShadowMap\CaptureDepth.cs.me
文件 210 2016-07-05 10:59 ShadowMap\Assets\01 Basic ShadowMap\FrustumType.cs
文件 263 2016-07-05 11:01 ShadowMap\Assets\01 Basic ShadowMap\FrustumType.cs.me
目录 0 2016-07-06 16:00 ShadowMap\Assets\01 Basic ShadowMap\Helper\
文件 192 2016-07-05 10:41 ShadowMap\Assets\01 Basic ShadowMap\Helper.me
文件 1965 2016-07-06 14:27 ShadowMap\Assets\01 Basic ShadowMap\Helper\BoundVertexsDetector.cs
文件 263 2016-07-05 11:07 ShadowMap\Assets\01 Basic ShadowMap\Helper\BoundVertexsDetector.cs.me
文件 839 2016-07-05 14:45 ShadowMap\Assets\01 Basic ShadowMap\Helper\CreateCamera.cs
文件 263 2016-07-05 10:54 ShadowMap\Assets\01 Basic ShadowMap\Helper\CreateCamera.cs.me
文件 1774 2016-07-06 16:00 ShadowMap\Assets\01 Basic ShadowMap\Helper\SetLightCameraFrustum.cs
文件 263 2016-07-05 11:36 ShadowMap\Assets\01 Basic ShadowMap\Helper\SetLightCameraFrustum.cs.me
文件 842 2016-07-06 15:30 ShadowMap\Assets\01 Basic ShadowMap\Helper\SetProjectionMatrix.cs
文件 263 2016-07-05 14:50 ShadowMap\Assets\01 Basic ShadowMap\Helper\SetProjectionMatrix.cs.me
文件 4892 2016-07-05 15:06 ShadowMap\Assets\01 Basic ShadowMap\Scene.mat
............此处省略1673个文件信息
相关资源
- Entitas.rar
- sheely.unitypackage
- unity太空飞船小游戏的制作
- Zdanmaku.unitypackage
- Jiggly Bubble 1.31.unitypackage
- 转盘实现demo
- Odin Inspector Source Code 2.1.4.unitypackage
- vs2017安装包community
- Basic Weapon System.unitypackage122875
- Multi-Touch Piano Complete Audio Keyboard
- Odin - Inspector and Serializer 2.1.4.unitypac
- unity-protobuf3
- unity物体边缘高亮插件
- Unity应用MVC模式
- Unity 2018 Artificial Intelligence Cookbook 2n
- Primitives.unitypackage unity的各种形状的模
- Unity 雷达效果实现
- unity3d战争迷雾插件
- VRTK - SteamVR Unity Toolkit.unitypackageV2.2.
- KGFDebug_v.1.2
- unity连连看
- Unity3D 对普通手柄的支持
- Unity刷脸人脸识别
- unity5x 开发VR游戏插件oculus插件
- Unity像素画风塔防游戏源码
- Unity好用的UI插件 New UI Widgets1.9.3,2
- 2DDynamicLightsandShadows-2DDLPROv1.4.3.unityp
- unity语音识别总结
- Unity NGUI常用字体图集
- BRNN.unitypackage
评论
共有 条评论