摘要:/***用高精度计时器,毫秒为单位***/#include #include using namespace std ;int main(void){ LARGE_INTEGER BegainTime ; LARGE_INTEGER EndTime ; LARGE_INTEGER Frequen...
阅读全文
摘要:1.使用thrust:http://stackoverflow.com/questions/13185221/cuda-host-object-to-devicehttp://blog.csdn.net/shenlan282/article/details/8237576http://blog.cs...
阅读全文
摘要:http://blog.csdn.net/dreampursue/article/details/6278752在这节中我们曾使用了这样的表达式,H.begin() 、H.end()、D.begin() + 7。begin()与end()的返回值在C++中被称为迭代器。vector的迭代器类似于数组...
阅读全文
摘要:http://blog.csdn.net/dreampursue/article/details/6278737Trust 提供了两个vector容器:host_vector 与 device_vector。按照命名规则,host_vector位于主机端,device_vector位于GPU设备端。...
阅读全文
摘要:http://blog.csdn.net/dreampursue/article/details/6278726thrust网站 http://thrust.github.com/ <<<-----------very good!!Thrust 是一个类似于STL的针对CUDA的C++模板库。T...
阅读全文
摘要:https://devtalk.nvidia.com/default/topic/387841/structure-pack-issue/When I copy an instance of the following structurefrom Visual Studio C++ code to ...
阅读全文
摘要:Problem: Two parallel lines can intercept. Railroad gets narrower and meets at horizon.In Euclidean space (geometry), two parallel lines on the same p...
阅读全文
摘要:http://www.songho.ca/opengl/gl_projectionmatrix.htmlRelated Topics: OpenGL TransformationOverviewPerspective ProjectionOrthographic ProjectionOverview...
阅读全文
摘要:Depth ClampingThat's all well and good, but this:This is never a good thing. Sure, it keeps the hardware from dividing by zero, which I guess is impor...
阅读全文
摘要:Boundaries and ClippingIf you recall back to the Perspective projection tutorial, we choose to use some special hardware in the graphics chip to do th...
阅读全文
摘要:Overlap and Depth BufferingRegardless of how we render the objects, there is a strange visual problem with what we're rendering:If the smaller object ...
阅读全文
摘要:Optimization: Base VertexUsing VAOs can dramatically simplify code. However, VAOs are not always the best case for performance, particularly if you us...
阅读全文
摘要:In this tutorial, we will look at how to deal with rendering multiple objects, as well as what happens when multiple objects overlap.Multiple Objects ...
阅读全文
摘要:Aspect of the WorldIf you run the last program, and resize the window, the viewport resizes with it. Unfortunately, this also means that what was once...
阅读全文
摘要:Perspective ProjectionRecall that our destination image, the screen, is just a two dimensional array of pixels. The 3D rendering pipeline we are using...
阅读全文
摘要:Chapter 4. Objects at RestThus far, we have seen very flat things. Namely, a single triangle. Maybe the triangle moved around or had some colors.This ...
阅读全文
摘要:Multiple ShadersWell, moving the triangle around is nice and all, but it would also be good if we could do something time-based in the fragment shader...
阅读全文
摘要:More Power to the ShadersIt's all well and good that we are no longer having to transform vertices manually. But perhaps we can move more things to th...
阅读全文
摘要:A Better WayThis is fine for a 3-vertex example. But imagine a scene involving millions of vertices (and no, that's not an exaggeration for high-end a...
阅读全文
摘要:Chapter 3. OpenGL's Moving TriangleThis tutorial is about how to move objects around. It will introduce new shader techniques.Moving the VerticesThe s...
阅读全文
摘要:#version 400layout(location = 0) in vec4 position;void main(){gl_Position= vec4(position);}#version 400out vec4 outputColor;void main(){outputColor=ve...
阅读全文
摘要:NameglVertexAttribPointer — 定义顶点属性数组C Specificationvoid glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei str...
阅读全文
摘要:原文地址http://www.arcsynthesis.org/gltut/Basics/Tut02%20Vertex%20Attributes.htmlVertex AttributesUsing the fragment position in a fragment shader is quit...
阅读全文
摘要:http://www.arcsynthesis.org/gltut/Basics/Tutorial%2002.html#FragPositionChapter 2. Playing with ColorsThis tutorial will show how to provide some colo...
阅读全文
摘要:http://www.arcsynthesis.org/gltut/Basics/Tut01%20Making%20Shaders.htmlMaking ShadersWe glossed over exactly how these text strings called shaders actu...
阅读全文
摘要:http://www.arcsynthesis.org/gltut/Basics/Tut01%20Following%20the%20Data.htmlFollowing the DataIn the basic background section, we described the functi...
阅读全文
摘要:http://www.arcsynthesis.org/gltut/Basics/Tut01%20Dissecting%20Display.htmlDissecting DisplayThe display function seems on the surface to be fairly sim...
阅读全文
摘要:http://www.arcsynthesis.org/gltut/Basics/Intro%20Graphics%20and%20Rendering.htmlGraphics and RenderingThis is an overview of the process of rendering....
阅读全文
摘要:在许多OpenGL操作中,我们都向OpenGL发送一大块数据,例如向它传递需要处理的顶点数组数据。传输这种数据可能非常简单,例如把数据从系统的内存中复制到图形卡。但是,由于OpenGL是按照客户机-服务器模式设计的,在OpenGL需要数据的任何时候,都必须把数据从客户机内存传输到服务器。如果数据并没...
阅读全文
摘要:一个三角形顶点数据float position[9]={ -0.8f, -0.8f, 0.0f, 0.8f, -0.8f, 0.0f, 0.0f, 0.8f, 0.0f}; 一、 /***单独vao绘制***/ glEnableClientState(GL_VERTEX_ARRAY); glVe...
阅读全文
摘要:http://www.songho.ca/opengl/gl_vbo.htmlOpenGL Vertex Buffer Object (VBO)Related Topics: Vertex Array, Display List, Pixel Buffer Object Download: vbo....
阅读全文
摘要:原文地址http://www.songho.ca/opengl/gl_vertexarray.html make -f Makefile.linux
阅读全文
摘要:http://www.189works.com/article-12359-1.html摘要: 介绍了事件委托机制的需求,各种解决方案的演变,最终提出模板化的事件委托机制,并给出较详细的进化过程和原理说明。关键词: C++,委托,委托器,事件器,模板第一章 基础版实现在平时的工作中,我们经常会遇到以...
阅读全文
摘要:http://blog.csdn.net/shan9liang/article/details/6784747===================================================================== c++实现类似c#事件机制的链接一:http://...
阅读全文
摘要:对于普通类型的对象来说,它们之间的复制是很简单的,例如:int a=88;int b=a; 而类对象与普通对象不同,类对象内部结构一般较为复杂,存在各种成员变量。下面看一个类对象拷贝的简单例子。 #include using namespace std;class CExample {private...
阅读全文
摘要:原因:未实现拷贝构造函数,错误原错误:BoundingBox boxArray[2]={box,box2};这里要调用拷贝构造函数,而且在拷贝构造函数中我未给成员指针分配空间。原文:http://hi.baidu.com/yanbizhu/item/e25da7165eb02cddbf9042fe指...
阅读全文