自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(27)
  • 收藏
  • 关注

原创 Example 5 : Texturing

主要实现的功能就是UV贴图,与光照计算。思路:1. 一个图片的每一个pixel, 都随机采样n次,然后每一次采样就是相当于发出一条ray,来检测是否碰到物体。for (s = 0; s < NUM_SAMPLES; s++){ xl_samples[s] -= 0.5f; yl_samples[s] -= 0.5f; VectorCopy(cam.eye, st

2016-06-30 17:59:41 456

转载 服务端入门《七》(Core Dump )

简介当程序运行的过程中异常终止或崩溃,操作系统会将程序当时的内存状态记录下来,保存在一个文件中,这种行为就叫做Core Dump(中文有的翻译成“核心转储”)。我们可以认为 core dump 是“内存快照”,但实际上,除了内存信息之外,还有些关键的程序运行状态也会同时 dump 下来,例如寄存器信息(包括程序指针、栈指针等)、内存管理信息、其他处理器和操作系统状态和信息。core dump

2016-06-28 15:45:41 523

转载 服务端入门《六》(gdb 调试例子)

单步调试1. step(或s) : 执行下一行语句,如果有函数调用则进入到函数中。2. next(或n) : 执行下一行语句,不进行函数。3. finish :跳出调试的函数 多文件调试断点标记方法#include void swap(int *a, int *b);int main( void ){int i = 3;int j

2016-06-28 13:10:16 523

转载 服务端入门《五》(gdb 调试)

#includeint func(int n){ int sum = 0; int i = 0; for(i = 0; i < n ; i++) { sum += i; } return sum;}int main(){ int i = 0;

2016-06-27 17:22:23 507

原创 记录Vim用过的命令<2>

1. 标签 添加标签 : m + a(任意字母) 回到标签: ` + a (任意字母)2. 分屏 vsp 进行水平分屏。 ctril + w + w,进行切换。 vi filename, 打开文件3. 定位鼠标所有的单词  假如鼠标定在一个test的单词上,直接按#,就可以把文档的test进行高亮,按n就跳到下一个test。

2016-06-27 10:49:53 327

转载 安装使用cscope

1. 检查是否按钮了cscopesudo yum search cscope-- 看看有无cscope下载sudo yum install cscope-- 安装cscope(其他这一步可以省略,直接第3步就可以找当前目录下的文件)(2. 使用Cscope需要生成cscope数据库文件。进入项目代码根目录运行命令:cscope -Rbq -f xxx.o

2016-06-24 18:26:54 368

转载 安装使用Ctags

CentOS 6.4 系统1. 先下载ctags命令:sudo yum search Ctags  -- 看看有无Ctags下载sudo yum install Ctags -- 安装Ctags2. 在~/.vimrc中增加以下这行:map  :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .  (发现在~/

2016-06-24 16:54:27 543

转载 服务端入门《四》(makefile)

下面针对只有几个文件的程序来简单试验一下Makefile在这里要准备四个文件 /* mytool1.h */#ifndef _MYTOOL_1_H#define _MYTOOL_1_H#include"stdio.h"void mytool1_print(char *print_str);#endif/* mytool1.c*/#in

2016-06-24 15:36:25 391

转载 服务端入门《三》(gcc 链接 静态库与动态库)

hello.h(见程序1)为该函数库的头文件。 hello.c(见程序2)是函数库的源程序,其中包含公用函数hello,该函数将在屏幕上输出"Hello XXX!"。 main.c(见程序3)为测试库文件的主程序,在主程序中调用了公用函数hello。程序1: hello.h#ifndef HELLO_H#define HE

2016-06-23 22:50:59 764

原创 服务端入门《二》(gcc 与 man )

《1》 gcc 的简单理解:从最简单的"hello world"开始,新建hello.c的代码如下#include int main(){ printf("Hello World\n"); return 0;}生成可执行文件的命令如下:gcc test.c-o test(如果没有-o的话,就会默认生成a.out, 有了-o 选项去指定的话,就会把

2016-06-23 17:52:22 597

原创 UGUI 代码流程

举Image.cs为例子1. 先执行MaskableGraphic.OnEnable(初始化)2. CanvasUpdateRegistry.PerformUpdate (Update)3. 在CanvasUpdateRegistry.PerformUpdate中会调用Graphic.Rebuild。

2016-06-21 19:28:38 1047

原创 服务端入门《一》(配置SrcureCRT 与 sshd_config )

用SecureCRT登录自己的虚拟机上的CentOS。 先配置CentOS1. 禁止密码登录。主要配置sshd_conf,vi  /etc/ssh/ssh_config,PasswordAuthentication no # 禁止密码认证,默认是打开的。2. 修改端口。主要配置sshd_conf,vi  /etc/ssh/ssh_config,Port

2016-06-21 19:08:42 1566

原创 模拟粒子系统(ParticleSystem.Simulate)

using UnityEngine;using UnityEditor;[ExecuteInEditMode]public class MyWindow : EditorWindow{ private GameObject _curEffect; private float _curValue = 0; private float _preTime;

2016-06-19 18:54:00 5793 3

原创 ScriptableWizard

using UnityEngine;using UnityEditor;using System.Collections; // A Wizard class that generates it's fields from public propertiespublic MyScriptableWizard : ScriptableWizard{ //----------------

2016-06-16 21:48:27 443

原创 Unity Shader Example 7 (溶解)

Shader "Test" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} _DissolveTex ("Dissolve Texture", 2D) = "white" {} _Percent ("Percent", Range(0.0, 1.0)) = 0.0 _BrightFact

2016-06-15 13:18:39 658

原创 Unity Shader Example 6 (区域变色)

Shader "Test"{ Properties { _MainTex ("Texture", 2D) = "white" {} _RegionTex ("Region Texture", 2D) = "white" {} _RedRegionCol ("Region Red Color", Color) = (1,1,1,1) _GreenRegionCol ("Regi

2016-06-14 21:26:45 1638

原创 Unity Shader Example 5 (地形混合)

Shader "T4M-4-Textures" {Properties { _Splat0 ("Layer 1", 2D) = "white" {} _Splat1 ("Layer 2", 2D) = "white" {} _Splat2 ("Layer 3", 2D) = "white" {} _Splat3 ("Layer 4", 2D) = "white" {} _Control

2016-06-14 21:22:45 2386

转载 Unity Shader Example 4 (扭曲)

// 简单的扭曲效果Shader "CGwell FX/Distortion Bump" { Properties { _BumpAmt ("Distortion", range (0,128)) = 10 _BumpMap ("Normalmap", 2D) = "bump" {} } Category { // We must be transparent, so o

2016-06-14 21:12:44 2402 3

原创 法线贴图

1. 个人理解法线贴图  在做动画的时候,面会变形,顶点关系改变了,即面的形状,方向改变了,如果面上存在一个固定的坐标系,那当物体变形,移动,旋转时,这个坐标系必定跟着面一起运动,那么在这个坐标系里的某个点或向量(比如我们把高模法线转换到这个坐标系里),不需要变动,当整个面发生变化时,我们只需要计算面上的坐标系到世界坐标系的转换矩阵,那么定义在这个面上的点或坐标(固定的),乘以这个矩阵即可得到

2016-06-14 19:52:58 701

转载 Unity Shader Example 3 (GrabPass捕捉屏幕纹理 )

转自:http://blog.sina.com.cn/s/blog_89d90b7c0102va4m.htmlShader "Custom/GrabTest" {Properties { //_MainTex ("Base (RGB)", 2D) = "white" {}}SubShader { // 在所有不透明对象之后绘制自己,更加靠近屏幕 Tags{"Queue"="

2016-06-14 19:12:46 1508

原创 Example 4 : Thin lens camera

main.c#include #include #include #include "vec3.h"#include "sample.h"#include "shapes.h"#define IMAGE_WIDTH 512#define IMAGE_HEIGHT 384#define NUM_SAMPLES 16shape_t shapes[4];light_

2016-06-14 11:52:51 498

原创 OnBeforeSerialize And OnAfterDeserialize

using UnityEngine;using System.Collections.Generic;public class test : MonoBehaviour, ISerializationCallbackReceiver{ public List _keys; public List _values; //Unity doesn't know ho

2016-06-12 15:31:33 2348

原创 PropertyDrawer

Ingredient.csusing UnityEngine;using System.Collections;using System.Collections.Generic;[System.Serializable]public enum IngredientUnit { Spoon, Cup, Bowl, Piece }// Custom serializable c

2016-06-12 15:29:38 1219

原创 Example 3 : motion blur And Shade(Shadow)

下面是main.c#include #include #include #pragma comment(lib,"DevIL.lib")#pragma comment(lib,"ILU.lib")#pragma comment(lib,"ILUT.lib")#include "vec3.h"#include "sample.h"#include "shapes.h"

2016-06-08 20:24:42 447

原创 C++ 引用外部 DLL

例如,需要需用一个DevIL.dll。(注意,这个DevIL需要有对应的 .h, .lib,  .dll )1. 添加 Include 目录,  -> -> -> -> 进行添加目录。2. 添加库目录, -> -> -> -> 进行添加目录。3. 添加附近依赖项,  -> -> -> -> ->   进行添加依赖项,例如,DevIL.lib(注意是,是lib

2016-06-08 16:28:27 2401

原创 Example 2 : Multi Sampling And Filtering Methods

#include#include#include"Vector3.h"#include"rgb.h"#include"Image.h"#include"Shape.h"#include"Triangle.h"#include"Sphere.h"#include #include "Sample.h"using namespace std;#define IMAGE_WID

2016-06-07 16:47:44 446

原创 Example 1 : A Single Sample Ray Tracer

#include#include#include"Vector3.h"#include"rgb.h"#include"Image.h"#include"Shape.h"#include"Triangle.h"#include"Sphere.h"#include using namespace std;int main(){ofstream testFile("test.ppm");HitRecor

2016-06-01 08:03:24 458

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除