Posts

Showing posts from March, 2018

Opengl-es Buffer

Image
Framebuffer A  Framebuffer  is a collection of buffers that can be used as the destination for rendering. OpenGL has two kinds of framebuffers: the  Default Framebuffer , which is provided by the  OpenGL Context ; and user-created framebuffers called  Framebuffer Objects  (FBOs). The buffers for default framebuffers are part of the context and usually represent a window or display device. The buffers for FBOs reference images from either  Textures  or  Renderbuffers ; they are never directly visible. Default Framebuffer The Default Framebuffer is the Framebuffer that OpenGL is created with. It is created along with the OpenGL Context. Like Framebuffer Objects , the default framebuffer is a series of images. Unlike FBOs, one of these images usually represents what you actually see on some part of your screen. Framebuffer Object FBO contains a collection of rendering destinations; color, depth and stencil buffer. These logical buff...

GPU Pipeline

Image
Graphics Pipeline Geometry and primitives Typically, An application is the place where we want to define the geometry that we want to render to the screen. This geometry can be defined by points, lines, triangles, quads, triangle strips... These are so called  geometric primitives.  These points will then reside in system memory.  Your application will use the 3D API to transfer the defined vertices from system memory into the GPU memory.  Vertices So we'll have a vertex that contains location, as well as color information. Vertex shaders A "pass-through" vertex shader will take the shader inputs and will pass these to its output without modifying these: the vertices P1, P2 and P3 from the triangle are fetched from memory, each individual vertex is fed to vertex shader instances which run in parallel.  Vertex processing computes the  normalized coordinate space position  of vertices.  The outputs from the vertex shaders are fed ...

CPU Pipeline

Image
History of CPU Pipeline The original 8086 processor has 14 CPU registers which are still in use today. Four are general purpose registers -- AX, BX, CX, and DX. Four are segment registers that are used to help with pointers -- Code Segment (CS), Data Segment (DS), Extra Segment (ES), and Stack Segment (SS). Four are index registers that point to various memory locations -- Source Index (SI), Destination Index (DI), Base Pointer (BP), and Stack Pointer (SP). The instruction pointer’s job is to point to the next instruction to be run. First, they follow the instruction pointer and decode the next CPU instruction at that location. After decoding, there is an execute stage where the instruction is run. Some instructions read from memory or write to it, others perform calculations or comparisons or do other work. When the work is done, the instruction goes through a retire stage and the instruction pointer is modified to point to the next instruction.  In 1982 an instructi...

Opengl Stages of Vertex Transformation

Image
Stages of Vertex Transformation Required to render the desired scene of a 3d world in a 2d screen Object Coordinates : local coordinate system of object before any transformation is applied. Eye coordinates : the result of multiplication of GL_MODELVIEW matrix and object coordinates. Objects are transformed from object space to eye space. M(ModelView) = M(view). M(model) where M(model) = object space to world space and M(view) = world space to eye space. Clip coordinates : the result of multiplication of GL_PROJECTION matrix and eye coordinates. GL_PROJECTION matrix used to define the frustum. It determined hot the 3D scene is projected onto the screen. NDC : Perspective division which is yielded by dividing the clip coordinates by w. Window coordinates : NDC are scaled and translated in order to fit into the rendering screen. Analogy With a Camera Transformations : Viewing Transformation : Setting up tripod and pointing the camera at the scene....

Embedded Communication Protocol and Motor Control

Image
i2c I2C specifications defined maximum clock frequency of 100 kHz. This was later increased to 400 kHz as  Fast mode . There is also a High speed mode which can go up to 3.4 MHz and there is also a 5 MHz ultra-fast mode. I2C Interface I2C uses only two wires: SCL (serial clock) and SDA (serial data).  I2C Addresses Basic  I2C communication  is using transfers of 8 bits or bytes. Each I2C slave device has a  7-bit address  that needs to be unique on the bus. 7-bit address represents bits 7 to 1 while bit 0 is used to signal reading from or writing to the device. If bit 0 (in the address byte) is set to 1 then the master device will read from the slave I2C device. I2C Protocol In normal state both lines (SCL and SDA) are high.    Both need to be pulled up with a resistor to +Vdd. With I2C, data is transferred in  messages.  Messages are broken up into  frames  of data. Each message has an address fr...