资源简介
一款实现汽车轮转动的游戏,含资源和源码,是很好的参考例子,由于上传只能在20M,所以,删除了一段视频!
代码片段和文件信息
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
[AddComponentMenu(“Image Effects/Blur“)]
public class BlurEffect : MonoBehaviour
{
/// Blur iterations - larger number means more blur.
public int iterations = 3;
/// Blur spread for each iteration. Lower values
/// give better looking blur but require more iterations to
/// get large blurs. Value is usually between 0.5 and 1.0.
public float blurSpread = 0.6f;
// --------------------------------------------------------
// The blur iteration shader.
// Basically it just takes 4 texture samples and averages them.
// By applying it repeatedly and spreading out sample locations
// we get a Gaussian blur approximation.
private static string blurMatString =
@“Shader ““BlurConeTap““ {
SubShader {
Pass {
ZTest Always Cull Off ZWrite Off Fog { Mode Off }
SetTexture [__RenderTex] {constantColor (0000.25) combine texture * constant alpha}
SetTexture [__RenderTex] {constantColor (0000.25) combine texture * constant + previous}
SetTexture [__RenderTex] {constantColor (0000.25) combine texture * constant + previous}
SetTexture [__RenderTex] {constantColor (0000.25) combine texture * constant + previous}
}
}
Fallback off
}“;
static Material m_Material = null;
protected static Material material {
get {
if (m_Material == null) {
m_Material = new Material( blurMatString );
m_Material.hideFlags = HideFlags.HideAndDontSave;
m_Material.shader.hideFlags = HideFlags.HideAndDontSave;
}
return m_Material;
}
}
protected void OnDisable() {
if( m_Material ) {
DestroyImmediate( m_Material.shader );
DestroyImmediate( m_Material );
}
}
// --------------------------------------------------------
protected void Start()
{
// Disable if we don‘t support image effects
if (!SystemInfo.supportsImageEffects) {
enabled = false;
return;
}
// Disable if the shader can‘t run on the users graphics card
if (!material.shader.isSupported) {
enabled = false;
return;
}
}
// Performs one blur iteration.
public void FourTapCone (RenderTexture source RenderTexture dest int iteration)
{
RenderTexture.active = dest;
source.SetGlobalShaderProperty (“__RenderTex“);
float offsetX = (.5F+iteration*blurSpread) / (float)source.width;
float offsetY = (.5F+iteration*blurSpread) / (float)source.height;
GL.PushMatrix ();
GL.LoadOrtho ();
for (int i = 0; i < material.passCount; i++) {
material.SetPass (i);
Render4TapQuad( dest offsetX offsetY );
}
GL.PopMatrix ();
}
// Downsamples the texture to a quarter resolution.
private void DownSample4x (RenderTexture source RenderTexture dest)
{
RenderTexture.active = dest;
source.SetGlobalShaderProperty (“__RenderTex“);
float offsetX = 1.0f / (float)source.width;
float offsetY = 1.0f / (float)source.height;
GL.PushMatrix ();
GL.LoadOrtho ();
for (int i = 0; i < material.passCount; i++)
{
material.Set
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6146208 2009-08-26 16:36 Honda\Assets\Honda.fbx
I.A.... 33039 2009-08-26 16:47 Honda\Assets\Honda.unity
I.A.... 3654 2009-08-26 16:45 Honda\Assets\Materials\honda-lambert1.mat
I.A.... 2474134 2009-08-26 16:45 Honda\Assets\New Terrain.asset
I.A.... 4104 2008-07-02 20:16 Honda\Assets\Pro Standard Assets\Glass Refraction\FX-Refractive.mat
I.A.... 3001 2009-01-19 21:46 Honda\Assets\Pro Standard Assets\Glass Refraction\Glass-Stained-BumpDistort.shader
I.A.... 748 2009-01-19 21:46 Honda\Assets\Pro Standard Assets\Glass Refraction\Glass-Stained-BumpSpecDistort.shader
I.A.... 377814 2008-07-02 20:16 Honda\Assets\Pro Standard Assets\Glass Refraction\glass.tif
I.A.... 636536 2008-07-02 20:16 Honda\Assets\Pro Standard Assets\Glass Refraction\glassbump.tif
I.A.... 4819 2009-01-19 21:46 Honda\Assets\Pro Standard Assets\Image ba
I.A.... 77 2008-07-02 20:16 Honda\Assets\Pro Standard Assets\Image ba
I.A.... 621 2009-02-09 19:25 Honda\Assets\Pro Standard Assets\Image ba
I.A.... 2782 2009-01-19 21:46 Honda\Assets\Pro Standard Assets\Image ba
I.A.... 2001 2009-01-19 21:46 Honda\Assets\Pro Standard Assets\Image ba
I.A.... 1098 2009-01-19 21:46 Honda\Assets\Pro Standard Assets\Image ba
I.A.... 5909 2009-02-09 19:25 Honda\Assets\Pro Standard Assets\Image ba
I.A.... 592 2009-01-19 21:46 Honda\Assets\Pro Standard Assets\Image ba
I.A.... 1454 2009-01-19 21:46 Honda\Assets\Pro Standard Assets\Image ba
I.A.... 478 2009-02-09 19:25 Honda\Assets\Pro Standard Assets\Image ba
I.A.... 1199 2009-01-19 21:46 Honda\Assets\Pro Standard Assets\Image ba
I.A.... 8209 2009-02-09 19:26 Honda\Assets\Pro Standard Assets\Image ba
I.A.... 2257 2009-01-19 21:46 Honda\Assets\Pro Standard Assets\Image ba
I.A.... 77 2008-07-02 20:16 Honda\Assets\Pro Standard Assets\Image ba
I.A.... 475 2009-02-09 19:26 Honda\Assets\Pro Standard Assets\Image ba
I.A.... 730 2009-01-19 21:46 Honda\Assets\Pro Standard Assets\Image ba
I.A.... 889 2009-02-09 20:04 Honda\Assets\Pro Standard Assets\Image ba
I.A.... 5846 2009-01-19 21:46 Honda\Assets\Pro Standard Assets\Image ba
I.A.... 1879 2009-02-09 19:27 Honda\Assets\Pro Standard Assets\Image ba
I.A.... 459 2009-01-19 21:46 Honda\Assets\Pro Standard Assets\Image ba
I.A.... 4114 2009-02-09 19:27 Honda\Assets\Pro Standard Assets\Image ba
............此处省略727个文件信息
相关资源
- 任天堂游戏编程探密.PDF
- NonCoverPolygon.rar
- u3d疯狂击球小游戏
- Easy Touch 5 5.0.18 最新版
- 微信飞机大战unity3D项目
- unity3d超漂亮的动态天空盒 风吹树动效
- UniSky插件
- Unity中文组件手册chm版
- unity3d尝试地理定位AR失败
- OpenGL游戏程序设计+源码
- 消除游戏源码商用
- cocos creator 6个小游戏合集
- Vivado贪吃蛇游戏键盘+VGA
- Unity-JumpJump-master.zip
- Programming Game AI by Example-游戏人工智能
- Unreal Engine 4 中文教程
- 欢乐麻将游戏源码.rar
- Flash游戏合集(Flash Game Development_Cod
- Unity3d之NGUI简单计算器入门
- unity3d 室内漫游源码
- DirectX游戏开发之3D角色动起来
- 网络多人游戏架构与编程 英文版 Mu
- RPG文字游戏源码
- Unity3d组件手册(中文版)
- Unity3D海底模型
- 飞机大战全套游戏素材
- 游戏美术资源游戏素材 游戏界面UI 仙
- cocos creator奔跑吧小驴完整工程
- 一些cocos2d-x小游戏包括一些3.x和2.x版
- particle playground3.1.7 特效编辑插件 Un
评论
共有 条评论