Depth Bounds Test (DBT) Depth Bounds Test(深度范围检测),是Nvdia GeForce 6系列以后显卡的特性(GPU Programming Guide GeForce 8 and 9 Series),并不是DirectX的特性.所以在例如Nsight和Pix的图形分析工具里,是看不到它的设置的.   Depth Bounds Test的功能是允许程序员在blend render target前进行额外的像素Discard.这个扩展增加了一个新的逐个fr…
转自:http://blog.csdn.net/hippig/article/details/7858574 shadow volume 这个术语几乎是随着 DOOM3 的发布而成为FPS 玩家和图形学爱好者谈论的对象的.虽然这个游戏还没有上市,但是凭借 John Carmack 的传奇经历以及 DOOM3发布的一些让人惊讶的预览图片,我们仍然有理由认为它将会是 2004 年最热门的 FPS 游戏之一. id software向来都不吝惜为了达到最好的图像效果而使用最先进的渲染技术,这曾经使得玩…
D3D9 GPU Hacks I’ve been trying to catch up what hacks GPU vendors have exposed in Direct3D9, and turns out there’s a lot of them! If you know more hacks or more details, please let me know in the comments! Most hacks are exposed as custom (“FOURCC”)…
最近完成了deferred shading和spot light的支持, 并作了一部分优化. 之前forward shading也只支持方向光, 现在也支持了点光源和探照光. 对于forward shading, 可以在渲染每个对象之前, 用对象的包围盒, 查询空间内的光源, 然后填入shader cosntant里. 因为空间一般是基于四叉树或者八叉树的划分, 所以查询不会慢.现在透明物体也能通过forward shading 正常光照了. Deferred shading optimizat…
转记:找了不少关于shadow volume原理的资料,还是这个帖子讲解的一目了然,转帖在这里,方便查阅.引用链接:http://blog.donews.com/yyh/archive/2005/05/19/387143.aspx 阴影锥(shadow volume)原理与展望---真实的游戏效果的实现 作者:王浩 前言:真实的游戏效果 shadow volume 这个术语几乎是随着 DOOM3 的发布而成为FPS 玩家和图形学爱好者谈论的对象的.虽然这个游戏还没有上市,但是凭借 John Ca…
Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. 二叉树的经典问题之最小深度问题就是就最短路径的节点个数,还是用深度优先搜索DFS来完成,万能的递归啊...请看代码: /** * Definition for binary tre…
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. 求二叉树的最大深度问题用到深度优先搜索DFS,递归的完美应用,跟求二叉树的最小深度问题原理相同.代码如下: C++ 解法一: class Solution { public: in…
problem description: Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. problem analysis: 第一步,设计演算法:遍历一棵树的方法有两种,BFS and DFS,思考了下,BFS是一圈一圈的扩张出…
- frame 是一个以**父视图**为坐标系的位置- bounds 是一个以**自身**为坐标系的位置- 如果改变了bounds 那么会影响子控件的显示位置…
题目简述: Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. 解题思路: # Definition for a binary tree node # class TreeNode: # def __init__(self, x):…
Problem: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. 初看本题第一印象为递归写法.首先找出终止条件:node == NULL.若未进入递归终止状态,则分左子树和又子树进行递归,最终返回累加最大的值.其代码如下: /*…
在OpenCV2中Mat类无疑使占据着核心地位的,前段时间初学OpenCV2时对Mat类有了个初步的了解,见OpenCV2:Mat初学.这几天试着用OpenCV2实现了图像缩小的两种算法:基于等间隔采样和基于局部均值的图像缩小,发现对Mat中的数据布局和一些属性的认知还是懵懵懂懂,本文对Mat的一些重要属性和数据布局做一个总结. Mat的作用 The class Mat represents an n-dimensional dense numerical single-channel or m…
作为3D世界里最重要的窗口,摄像机的应用就显得很重要,毕竟在屏幕上看到的一切都得用摄像机矩阵变换得来的嘛.论坛上看到了一篇帖子讲非天空盒的背景做法,让我想起其实很多界面合成画面可以用摄像机之间的交互来实现(避开用GUI,效率问题我没尝试过,但是貌似用深度相机比gui好?以后试验下). 首先说下深度相机,就是用2个或者2个以上的相机,设置好参数后自动到屏幕视觉合成的效果,应用上两个方面:1,背景图 2,用户界面. 步骤:1.建立第二个相机,设置 Clear Flags 属性为 Depth Only…
Rect 表示一个2D矩形区域 Bounds 表示一个3D的方块区域 http://www.cnblogs.com/crazylights/p/3977348.html…
直接抄: https://apollomapping.com/2012/August/article15.html For this month’s Geospatial Frequently Asked Question (G-FAQ), I pivot to a topic that deserves more attention than it gets, and that is bit depth. Some of you may have heard this term when or…
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. Have you met this question in a real interview? Yes Example Given a binary tree as follow:…
self.view.frame.size.width在导航栏titleView计算frame时会出现宽度不准确的情况,布局出现问题,[UIScreen mainScreen].bounds.size.width则不会…
 Bugly:  Trapped uncaught exception 'NSRangeException', reason: 'NSMutableRLEArray objectAtIndex:effectiveRange:: Out of bounds'(0   CoreFoundation                      0x0000000116162e65 __exceptionPreprocess + 1651   libobjc.A.dylib                …
JSX IN DEPTH JSX 从根本上说,JSX只是提供了语法糖React.createElement(component, props, ...children)的功能.以下JSX代码: <MyButton color="blue" shadowSize={2}> Click Me </MyButton> 被编译为: React.createElement( MyButton, {color: 'blue', shadowSize: 2}, 'Click…
Python中默认的最大递归深度是989,当尝试递归第990时便出现递归深度超限的错误: RuntimeError: maximum recursion depth exceeded in comparison 简单方法是使用阶乘重现: #!/usr/bin/env Python def factorial(n): if n == 0 or n == 1: return 1 else: return(n * factorial(n - 1)) >>> factorial(989) ...…
bounds坐标:自己定义的坐标系统,setbound指明了本视图左上角在该坐标系统中的坐标,   默认值(0,0) frame坐标:  子视图左上角在父视图坐标系统(bounds坐标系统)中的坐标,默认值(0,0) 子视图实际位置=父视图实际位置-父视图bounds坐标+子视图frame坐标 一.bounds 只影响“子视图”相对屏幕的位置,修改时不会影响自身相对屏幕的位置 1.父视图bounds坐标为(0,0)时 - (void)viewDidLoad { [super viewDidLoa…
Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. Summary: BFS or DFS with recursion. int minDepth(TreeNode *root) { if(root == NULL) ; if(r…
真是书到用时方恨少,平时都是完成任务,书都是看个前面几章就扔书柜了.... 今天看了博客园一篇文章<我们为什么应该坚持写博客>,很有感触,觉得人生不能得过且过,以前为了各种原因,家庭,孩子,其实有很多都是借口,自己心里清楚. 现在孩子慢慢长大,当我督促她学习的同时,也为自己浑浑噩噩的几年感到有些羞耻. 既然如此,那就开始吧,开工没有回头箭,既然不讨厌编程,既然选择了程序员这条路,那就坚定地走下去吧,坚持博客,是我对自己的第一个要求. 先巩固一下基础知识,从C# in depth开始 第一章 C…
最近做的题记录下. 258. Add Digits Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has only one digit, return it. int addDigi…
本地ssms是 安装Sqlserver 2008 r2 自带的 远端的server是sqlserver2014 可以连接,可以执行查询语句.但是,不能使用ssms生成对象的脚本.推测ssms 2008的内置命令与sqlserver2014不兼容. 错误: 1, TITLE: Microsoft SQL Server Management Studio ------------------------------ Index was outside the bounds of the array.…
在进行类转json字符串时,报错JsonException: Max allowed object depth reached while trying to export from type System.Single. ok,实际上是类的属性中有json不能识别的数据类型. JsonData public JsonData(bool boolean); public JsonData(double number); public JsonData(int number); public Js…
在使用cocos2d-iphone 2.0生成项目的时候,用5s测试时全屏中上下一直有黑条,发现[[UIScreen mainScreen] bounds]返回的屏幕尺寸不是320*568的,而是320*480.后来在项目的警告中发现提示缺少Default-568@2x.png: 单击之后弹出: 点击add之后再运行项目就可以得到320*568的全屏了! 另外,要隐藏statusBar还需要在info.plist中添加一条View controller-based status bar appe…
http://www.cocoachina.com/bbs/read.php?tid-264373.html [[UIScreen mainScreen] bounds]获取尺寸不对       我在 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 这个方法里面使用 self.window = [[UIWindow alloc]…
Minimum Depth of Binary Tree Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. 比较左子树和右子树的深度,取小的那个返回上来,并+1. 需要注意的是如果没有左子树或右子树.那么无条件取存在的那一边子树深…
1.概要翻开ios官方开发文档,赫然发现上面对这三个属性的解释如下: frame:描述当前视图在其父视图中的位置和大小. bounds:描述当前视图在其自身坐标系统中的位置和大小. center:描述当前视图的中心点在其父视图中的位置. 是不是有点迷糊?好吧,别急,让我们先说说ios的坐标系统. 2.ios坐标系统 ios以左上角为坐标原点(0,0),以原点向右侧为X轴正方向,原点下侧为Y轴正方向. ios采用CGPoint来表示点在坐标系上X.Y位置.我们可以通过CGPointMake(x,y…