- 博客(16)
- 收藏
- 关注
转载 Understanding Photometric and Radiometric units and their application to computer graphics
参考:http://mentalraytips.blogspot.com/2007/03/understanding-photometric-and.htmlUnderstanding Photometric and Radiometric units and their application to computer graphicsOr: "Ho
2016-07-28 21:57:04 722
转载 Shader Scale
Unity will scale the mesh on the CPU, and the shaders will already receive only pre-scaled vertex positions, normals etc. So in the shaders, everything that can happen is no scale at all or unifor
2016-07-25 14:33:27 608
原创 Unity Shader Example 14 (平面切割图片 )
Shader "Test"{ Properties { _MainTex ("Texture", 2D) = "white" {} _PureColor ("Pure Color", Color) = (1,1,1,1) _Plan("Plan", Vector) = (1, 1, 1, 0) _MaxDist("Alpha Dist", float) = 0 //_D
2016-07-22 17:31:02 1844
原创 Unity Shader Example 13 (边缘 Bloom )
Bloom.csusing UnityEngine;using System.Collections;public class CameraBloom : MonoBehaviour { public Material bloomMaterial; public int blurIterations = 4; public float blurSpread =
2016-07-22 17:27:03 867
原创 Vector4 的理解
在写一个Vertex结构的时候,不知道位置Pos,用Vector3,还是用Vector4比较好,最后选择,用Vector4.原因:1. 点,用Vector4表示就是(x,y,z,1)。2. 向量,用Vector4表示就是(x,y,z,0)。那么,向量是两个点相减组成,得到,(x1,y1,z1,1)- (x2,y2,z2,1) = (x1 - x2, y1 - y2,z1 - z2,
2016-07-21 23:57:38 7850 3
转载 深入探索透视纹理映射
1.推出了投影之后的x’和原始z之间的关系——x’和1/z是线性关系,y’和1/z也是线形关系。 上图是在相机空间的俯视图,eye是眼睛的位置,也就是原点。np和fp分别是近、远裁剪平面,N和F分别是z=0到两个裁剪平面的距离。pq是一个三角形pqr在xy平面上的两个点,p的坐标为(x, y, z),p’是p投影之后的点,坐标为(x’, y
2016-07-21 23:48:28 827
转载 The standard C# / Windows Forms game loop
参考:http://gamedev.stackexchange.com/questions/67651/what-is-the-standard-c-windows-forms-game-loopThe Application.Run call drives your Windows message pump, which is ultimately what powers
2016-07-14 20:58:03 513
转载 使用multi_compile编译Shader的多个版本
主要参考:http://www.66acg.com/?post=81一、新建一个Shader和一个Material Shader "Custom/Multi_Compile" { SubShader { Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag #pragma mu
2016-07-14 15:52:12 4741
原创 理解 Unity3D RenderWithShader Api
主要参考:unity, 替换shader渲染(Rendering with Replaced Shaders) :http://www.cnblogs.com/wantnon/p/4528677.html测试例子:Test.cs挂到Camera上using UnityEngine;using System.Collections;public class Test
2016-07-14 15:47:03 4967 1
原创 Unity Shader Example 12 (Bloom 高光)
1. 主要参考了Glow Effect Mobile Friendly 插件的做法。代码,挂在Camera上的Grow.cs主要的思想就是:1. 循环n次,分别把A模糊给B,清空A,再给B模糊给A,进行n次。2. shaderCamera 是有作用的,主要就是为了让bloom只针对发光的人物,如果没有shaderCamera的存在,整个背景都会bloom起来。
2016-07-14 15:18:25 1317
转载 如何开始用 C++ 写一个光栅化渲染器?
如何开始用 C++ 写一个光栅化渲染器?:http://www.zhihu.com/question/24786878
2016-07-09 20:34:23 1804
原创 Example 6 : Bounding Volume Heirarchy And Bump Lit
建立 BVH:思路:类似二叉树,一个node有child0, child1, 那么就递归下去。想象,有一个三角形列表(objs),三角形列表数量(num_objs),这个三角形列表的大包围盒(min, max),轴(axis)。而且,每一个三角形自己有一个包围盒。现在就是,把这个大包围盒划分为2个子包围盒,划分的规则就是,遍历每一个三角形,以一个轴为标准,例如x轴,比较
2016-07-08 16:58:59 406
转载 Unity Shader Example 11 (模板测试)
Box:Shader "Custom/Box" { SubShader { //"Queue"="Geometry-1" ,先渲 Tags { "RenderType"="Opaque" "Queue"="Geometry-1"} CGINCLUDE struct appdata { float4
2016-07-08 14:14:26 1336
原创 Unity Shader Example 10 (高斯模糊)
Shader:Shader "ImageEffect/Unlit/GaussianBlue" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} } CGINCLUDE #include "UnityCG.cginc" #pragma target 3.0 static const half curve
2016-07-07 23:00:18 852
原创 Unity Shader Example 9 (均值模糊)
Shader:Shader "ImageEffect/Unlit/BlurBox" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {}}SubShader { Pass { ZTest Always ZWrite Off CGPROGRAM #pragma vertex vert #pragma
2016-07-07 21:53:06 524
原创 Unity Shader Example 8 (光照贴图)
Shader "LightMap"{ Properties { _Color ("Main Color", Color) = (1, 1, 1, 1) _MainTex ("Base (RGB)", 2D) = "white" {} _LightMap ("Lightmap (RGB)", 2D) = "white" {} }
2016-07-05 19:20:14 2184
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人