You are on page 1of 3

ASSIGNMENT 2,3,4

Computer Graphics

Saud Ul Khalid Roll # 256

Blending is a convex combination of two colours allowing for transparency effects in computer graphics In Open GL, it is the stage of OpenGL rendering pipeline that takes the fragment colour outputs from the Fragment Shader and combines them with the colors in the color buffers that these outputs map to. Blending parameters can allow the source and destination colors for each output to be combined in various ways. It can be used to make objects appear transparent. It can also refer to the mixing of pixels in specific ways on multiple layers of an image. There are different blending modes 1. 2. 3. 4. 5. 6. Normal blend mode Dissolve Multiply & Screen Hard light Divide Lighten Only

A texture is an OpenGL Object that contains one or more images that all have the same image format. A texture can be used in two ways. It can be the source of a texture access from a Shader, or it can be used as a render target. Textures are typically used for images to decorate 3D models with, but in reality they can be used to store many different kinds of data. It's possible to have 1D, 2D and even 3D textures, which can be used to store bulk data on the GPU. glBindTexture( GL_TEXTURE_2D, tex );
Use: glEnable(GL_TEXTURE_2D); before rendering the one surface, and then right before the other surfaces: glDisable(GL_TEXTURE_2D);

Computer graphics lighting refers to the simulation of light in computer graphics. This simulation can either be extremely accurate, as is the case in an application like Radiance which attempts to track the energy flow of light interacting with materials using radiosity computational techniques.
OpenGL supports a fixed number of lights. The number that are available depends on the implementation, but will always be at least 3. Go to the line after glEnable(GL_CULL_FACE); and add the following: // Enable lighting glEnable(GL_LIGHTING); glEnable(GL_LIGHT0);

You might also like