OpenGL & Visualization

Size: px
Start display at page:

Download "OpenGL & Visualization"

Transcription

1 OpenGL & Visualization Martin Ilčík Institute of Computer Graphics and Algorithms Vienna University of Technology

2 Motivation What is OpenGL How to use OpenGL Slices with OpenGL GPU raycasting Martin Ilčík 2

3 What is OpenGL? Low-level API for 3D graphics Cross-platform High extensible Open source OS independent Headers for all common prog. languages Lots of tutorials and resources on the web Very simple to use Martin Ilčík 3

4 What can it do? HW acceleration for Rendering geometry Texture lookups Drawing buffers GPU programming Programmable pipeline What can t it do? 3D engine stuff GUI Math Window managing Input processing Martin Ilčík 4

5 What can we use it for? (1) Slices Stored as texture(s) Quick switching and manipulation Arbitrary sliceplane Transfer function Again a texture Comfortable and easy changes Fast application to data Martin Ilčík 5

6 What can we use it for? (2) Raycasting with 2.0 shaders partially on GPU with 3.0 shaders completely on GPU for others at least pleasant drawing Other HW accelerated volume rendering techniques discussed at lectures also in EG 06 tutorial not required for the LU Martin Ilčík 6

7 Let s start! Now I really want to use all the great benefits of OpenGL! How? Martin Ilčík 7

8 OpenGL resources (1) News, Links, Forums (great response time) OpenGL 1.x/2.x specs, GLSL specs best help & reference The red book old but good Biggest and best tutorial series all over the net NeHe auf deutsch Featured articles on general programming Martin Ilčík 8

9 OpenGL resources (2) GLinfo (for win) find out your graphics HW capabilities Many resources, also for 3D graphics Very good forums Many papers and presentations Documentation for company specific features Martin Ilčík 9

10 Principles of OpenGL Structured, not object oriented State machine with a state-vector 1.x core is old, but regulary extended ARB, EXT extensions NV, ATI extensions 2.x common standard supported by HW Functionality of 2.0 = Functionality of 1.5 Function names start with gl Type of main parameter as suffix: i, f, us, v Martin Ilčík 10

11 OpenGL setup (1) Application Initialization Create the window Attach the rendering surface to the OpenGL Set it s pixel format and buffers OpenGL initialization Setup basic parameters and states Extensions availability check Window resizing handling Load resources Martin Ilčík 11

12 OpenGL setup (2) Rendering loop Clear the buffer (Reset transformations) Draw Setup can be done Self-made SDL GLUT All samples and frameworks at NeHe Basecode Martin Ilčík 12

13 Hello Triangle! Type this into the rendering loop glbegin(gl_triangles); glvertex3f(-1.0f, 0.0f, 0.0f); glvertex3f(1.0f, 0.0f, 0.0f); glvertex3f(0.0f, 1.0f, 0.0f); glend(); More in NeHe Lesson 2 Martin Ilčík 13

14 Hello colorful triangle! glbegin(gl_triangles); glcolor3f(1.0f, 0.0f, 0.0f); glvertex3f(-1.0f, 0.0f, 0.0f); glcolor3f(0.0f, 1.0f, 0.0f); glvertex3f(1.0f, 0.0f, 0.0f); glcolor3f(0.0f, 0.0f, 1.0f); glvertex3f(0.0f, 1.0f, 0.0f); glend(); More in NeHe Lesson 3 Martin Ilčík 14

15 Hello texture! (1) Enable the texturing (only 2 K textures) glenable(gl_texture_2d); Allocate memory for texture data unsigned char* data = new unsigned char[size*size*3]; Create alias for our texture GLuint texture; Genrate a new texture in the graphics memory glgentextures(1, &texture); Martin Ilčík 15

16 Hello texture! (2) Send the texture data to the graphics card glbindtexture(gl_texture_2d, texture); glteximage2d(gl_texture_2d, 0, GL_RGB, size, size, 0, GL_RGB, GL_UNSIGNED_BYTE, data); delete[] data; Set the bilinear interpolation (tent filter)!!! gltextureparameteri(gl_texture_2d, GL_TEXTURE_MIN_FILTER, GL_LINEAR); gltextureparameteri(gl_texture_2d, GL_TEXTURE_MAG_FILTER, GL_LINEAR); Martin Ilčík 16

17 Hello textured quad! //don t forget to bind a texture before glbegin(gl_quads); gltexcoord2f(0.0f, 0.0f); glvertex3f(-1.0f, -1.0f, 0.0f); gltexcoord2f(1.0f, 0.0f); glvertex3f(1.0f, -1.0f, 0.0f); gltexcoord2f(1.0f, 1.0f); glvertex3f(1.0f, 1.0f, 0.0f); gltexcoord2f(0.0f, 1.0f); glvertex3f(-1.0f, 1.0f, 0.0f); More in NeHe Lesson 6 Martin Ilčík 17

18 Black hole? You ll see nothing, unless you fill the texture data with some values This has to be done before calling glteximage Texture data just a pointer to some memory block copied to the graphics memory Try some constant color or just random noise Our volumetric data is just a 3D image even in raw format Related stuff in NeHe lesson 33 Martin Ilčík 18

19 Slices as textures Generate separate texture for each slice for each axis Statically precomputed (needs memory) Dynamically generated on demand Save all the volume data in one 3D texture Easy slicing for arbitrary plane HW accelerated lookups (incl. interpolation) Can be used as input for GPU raycasting glteximage3d, gltexcoord3f, GL_TEXTURE_3D Martin Ilčík 19

20 Reading the dataset FILE* indata; indata = fopen(filename, rb ); unsigned short dimx, dimy, dimz; fread(&dimx, 1, 2, indata); //one entry fread(&dimy, 1, 2, indata); //two bytes long fread(&dimz, 1, 2, indata); unsigned short* imdata = new unsigned short[dimx*dimy*dimz]; fread(imdata, dimx*dimy*dimz, 2, indata); Martin Ilčík 20

21 Slices as 2D textures (1) ReadData(); //let the dataset be stored in data[] unsingned shot* slicedata = new unsigned short[size*size]; k = 10; for (int i = 0; i < dimx; i++) for (int j = 0; j < dimy; j++) slicedata[(size*j)+i] = data[(dimx*dimy*k) + (dimx*j) + i]; Martin Ilčík 21

22 Slices as 2D textures (2) GLuint slice; glgentextures(1, &slice); glbindtexture(gl_texture_2d, slice); glteximage2d(gl_texture_2d, 0, GL_LUMINANCE, dimx, dimy, 0, GL_LUMINANCE, GL_UNSIGNED_SHORT, slicedata); //don t forget to set the filters delete[] slicedata; for arbitrary data dimensions GL_TEXTURE_RECTANGLE_ARB or use glubuild2dmipmaps gltexsubimage2d Martin Ilčík 22

23 Slices as 3D textures (1) ReadData(); unsingned shot* slicedata = new unsigned short[dimx*dimy*dimz]; //we convert the 12-bit values to 16-bit for(int i = 0; i < dimx*dimy*dimz; i++) slicedata[i] = data[i]*16; Martin Ilčík 23

24 Slices as 3D textures (2) GLuint slices; glgentextures(1, &slices); glbindtexture(gl_texture_3d, slice); glteximage3d(gl_texture_3d, 0, GL_LUMINANCE, dimx, dimy, dimz, 0, GL_LUMINANCE, GL_UNSIGNED_SHORT, slicedata); //don t forget to set the filters delete[] slicedata; for non 2 k data dimensions GL_texture_non_power_of_two or use glubuild3dmipmaps gltexsubimage3d Martin Ilčík 24

25 Slices as 3D textures (3) k = 10.0f; glbegin(gl_quads); gltexcoord3f(0.0f, 0.0f, k/(float)dimz); glvertex3f(-1.0f, -1.0f, 0.0f); gltexcoord3f(1.0f, 0.0f, k/(float)dimz); glvertex3f(1.0f, -1.0f, 0.0f); //add the 2 remaining vertices in the same way glend(); Martin Ilčík 25

26 Transfer Function Interactive enhancement of the data by coloring [Intensity] [RGBA] Values defined at arbitrary points Interpolation What about trying to use L*a*b* Martin Ilčík 26

27 Transfer Texture a 1D texture X axis intensity [x] [r,g,b,a]; <0,1> <0,1> 4 Easy to show to the user Can be applied to slices/volumes in a shader Automatic interpolation of colors Must be regenerated after change Sampling errors Take a big texture (e.g. dimx == 4096) Martin Ilčík 27

28 Intermediate OpenGL Martin Ilčík 28

29 Resources Read more tutorials Download the OpenGL specs Get the latest headers (e.g. gl.h, glu.h, glext.h) Google Ask me :) Martin Ilčík 29

30 Transformations Matrices included in OpenGL state Modelview glmatrixmode(gl_modelview); Projection glmatrixmode(gl_projection); Reset the current matrix glloadidentity(); Matrix stack glpushmatrix(); glpopmatrix(); Transformations gltranslatef( ), glrotatef( ), glscalef( ) glmultmatrix( ); More in this slides (Ed Angel, UNM) Martin Ilčík 30

31 Camera stuff Camera position and viewing direction glulookat(eye,center,up); Projection type, clipping planes glperspective(angle, ratio, znear, zfar); glortho(left, right, bottom, up, znear, zfar); Should be updated by viewport changes More in this slides by Ed Angel, UNM Martin Ilčík 31

32 Memory management Objects allocated by OpenGL calls should be cleaned up, when no more needed Video RAM Stores textures, shaders, displaylists, vertexarrays, VBO s, FBO s When filled full, swapping to RAM SLOW! By visualization applications easily overflowed Use gldeletetextures( ) etc. Martin Ilčík 32

33 Multitexturing glactivatetexture(gl_texturen); Switches all texturing commands to the unit n Now texture compositing modes come to play gltexenv(gl_texture_env, GL_TEXTURE_ENV_MODE, mode) GL_NONE, GL_REPLACE,GL_MODULATE Deactivate texture units when no more used gldisable(gl_texture_2d); glmultitexcoord(gl_texturen, s, t ); More in OpenGL specs Martin Ilčík 33

34 Basic shaders stuff Low level GPU assembler (no more used) NVidia s Cg Crossplatform (OpenGL, DirectX) Different versions GLSL Integrated in OpenGL 2.0 Compiled and linked at runtime Works only with shaders 2.0 and higher CUDA Martin Ilčík 34

35 GLSL Shaders initialization Read source from a text file Create vertex/fragment shader object glcreateshaderobjectarb(shader_type); glshadersourcearb( ); glcompileshaderarb(shader); Create GPU program object glcreateprogramobject(); glattatchobjectarb(prog, shader); gllinkprogramarb(prog); Martin Ilčík 35

36 Enabling GLSL shaders gluseprogramobjectarb(program); passing parameters to variables inside of the shader glgetuniformlocationarb(program, name); gluniformarb(location, value); sampler variables must be set this way n = glgetuniformlocationarb(prog, sampler_name); gluniform1iarb(n, texture_unit_number); More in this article at NeHe (by Florian Rudolf) Martin Ilčík 36

37 Transfer function in GLSL (1) Vertex shader just as fixed pipeline void main() { } gl_texcoord[0] = glmultitexcoord0; gl_texcoord[1] = glmultitexcoord1; gl_position = gl_modelviewprojectionmatrix * gl_vertex; Martin Ilčík 37

38 Transfer function in GLSL (2) Fragment shader uniform sampler2d slice_sampler; uniform sampler1d transfer_sampler; void main() { } vec4 intensity = texture2d(slice_sampler, vec2(gl_texcoord[0]) ); gl_fragcolor = texture1d(transfer_sampler, intensity.x); Martin Ilčík 38

39 GPU Raycasting Advanced OpenGL Martin Ilčík 39

40 How it works (1) Martin Ilčík 40

41 How it works (2) Implementation One fragment (pixel) = one ray HW makes it simpler Implementation in shaders Use direction textures for the ray Iterate all the steps in a fragment shader Data storage Render directions to textures Store data in one or more 3D textures Store the transfer function also in a texture Martin Ilčík 41

42 Direction textures Lowpoly envelope around the dataset Take simply a box Map world coordinates to it s primary color Render Front faces for entry points of rays Back faces for exit points of rays Store in two textures Martin Ilčík 42

43 Hardware ray initialization Rendering in 3 passes 1 st... get texture with ray-entry coordinates 2 nd... get texture with ray-exit coordinates 3 st... actual raycasting In the fragment shader Compute ray directions Sample trough the dataset iterate steps until opacity ~ 1.0 or ray outside Martin Ilčík 43

44 Rendering to texture Frame buffer object New extension in OpenGL 1.5 Finally fast access to offscreen buffers API feature, independent from hardware Backwards compatible, depends on drivers Interface similar to multitexturing More on LWJGL Wiki Martin Ilčík 44

45 Creating texture storage glgentextures(1, FBOTextureFront); glbindtexture( GL_TEXTURE_RECTANGLE_ARB, FBOTextureFront); glteximage2d( GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA8, ScreenX, ScreenY, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); Martin Ilčík 45

46 Creating and linking a FBO glgenframebuffersext(1, &FBufferFront); glbindframebufferext( GL_FRAMEBUFFER_EXT, FBufferFront); glclearcolor(0, 0, 0, 0); glframebuffertexture2dext( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_RECTANGLE_ARB, FBOTextureFront, 0); Create a FBO for the back faces just the same way Martin Ilčík 46

47 Rendering direction textures (1) Bind the front faces buffer and draw them glbindframebufferext( GL_FRAMEBUFFER_EXT, FBufferFront); glclear(gl_color_buffer_bit); gluseprogramobjectarb(prog1st); drawboundingbox(); Martin Ilčík 47

48 Rendering direction textures (2) Bind the back faces and draw them glcullface(gl_front); glbindframebufferext( GL_FRAMEBUFFER_EXT, FBufferBack); glclear(gl_color_buffer_bit); drawboundingbox(); unbind the texture and render to screen glbindframebufferext( GL_FRAMEBUFFER_EXT, 0); glcullface(gl_back); Martin Ilčík 48

49 Rendering direction textures (3) Martin Ilčík 49

50 Raycasting in fragment shader Check if the ray crosses the bounding box Read the entry and exit point from textures Determine ray direction Iterate until opacity ~ 1.0 or outside Read the intensity at this sample Apply transfer function Compositing Next sample Martin Ilčík 50

51 How it works once again Martin Ilčík 51

52 Fragment shader (1) Input samplers uniform sampler2drect tex_entry; uniform sampler2drect tex_exit; uniform sampler3d tex_intensity; uniform sampler1d tex_transfer; Martin Ilčík 52

53 Fragment shader (2) void main() { const float dz = 0.005; const int maxrange = 347; vec4 entry_point = texture2drect(tex_entry, vec2(gltexcoord[0])); vec4 exit_point = texture2drect(tex_exit, vec2(gltexcoord[0])); float dist = distance(entry_point, exit_point)/dz; int maxiter = int(floor(dist)); vec3 diff = (exit_point.xyz entry_point.xyz)/dist; Martin Ilčík 53

54 Fragment shader (3) if (entry_point.w == 0.0) discard; else { float numsamples = 0.0f; for(int = 0; i < maxrange; i++) { // see next slide } glfragcolor = Result; } Martin Ilčík 54

55 Fragment shader Compositing (4) intensity = texture3d(tex_intensity, point); transferred = texture1d(tex_transfer, intensity.x); Result.xyz += (1.0 Result.w) * transferred.w * transferred.xyz; Result.w += (1.0 Result.w) * transferred.w; point +=diff; if ((Result.w >= 1.0) (i >= maxiter)) break; Martin Ilčík 55

56 Fragment shader Averaging (5) intensity = texture3d(tex_intensity, point); transferred = texture1d(tex_transfer, intensity.x); Result.xyz += transferred.w * transferred.xyz; Result.w += transferred.w; point +=diff; if (i >= maxiter) { Result /= float(maxiter); break; } Martin Ilčík 56

57 Conclusions Use hardware rendering Use the best API for you Store data in textures Shaders make things much simpler and faster Feel free to ask: ilcik at cg.tuwien.ac.at Thank you for your attention! Martin Ilčík 57

Information Coding / Computer Graphics, ISY, LiTH GLSL. OpenGL Shading Language. Language with syntax similar to C

Information Coding / Computer Graphics, ISY, LiTH GLSL. OpenGL Shading Language. Language with syntax similar to C GLSL OpenGL Shading Language Language with syntax similar to C Syntax somewhere between C och C++ No classes. Straight ans simple code. Remarkably understandable and obvious! Avoids most of the bad things

More information

SHADER PROGRAMMING. Based on Jian Huang s lecture on Shader Programming

SHADER PROGRAMMING. Based on Jian Huang s lecture on Shader Programming SHADER PROGRAMMING Based on Jian Huang s lecture on Shader Programming What OpenGL 15 years ago could do http://www.neilturner.me.uk/shots/opengl-big.jpg What OpenGL can do now What s Changed? 15 years

More information

Texture Mapping. Mike Bailey.

Texture Mapping. Mike Bailey. Texture Mapping 1 Mike Bailey mjb@cs.oregonstate.edu This work is licensed under a Creative Commons Attribution-NonCommercial- NoDerivatives 4.0 International License TextureMapping.pptx The Basic Idea

More information

CS179: GPU Programming

CS179: GPU Programming CS179: GPU Programming Lecture 4: Textures Original Slides by Luke Durant, Russel McClellan, Tamas Szalay Today Recap Textures What are textures? Traditional uses Alternative uses Recap Our data so far:

More information

三維繪圖程式設計 3D Graphics Programming Design 第七章基礎材質張貼技術嘉大資工系盧天麒

三維繪圖程式設計 3D Graphics Programming Design 第七章基礎材質張貼技術嘉大資工系盧天麒 三維繪圖程式設計 3D Graphics Programming Design 第七章基礎材質張貼技術嘉大資工系盧天麒 1 In this chapter, you will learn The basics of texture mapping Texture coordinates Texture objects and texture binding Texture specification

More information

Discussion 3. PPM loading Texture rendering in OpenGL

Discussion 3. PPM loading Texture rendering in OpenGL Discussion 3 PPM loading Texture rendering in OpenGL PPM Loading - Portable PixMap format 1. 2. Code for loadppm(): http://ivl.calit2.net/wiki/images/0/09/loadppm.txt ppm file format: Header: 1. P6: byte

More information

Graphics. Texture Mapping 고려대학교컴퓨터그래픽스연구실.

Graphics. Texture Mapping 고려대학교컴퓨터그래픽스연구실. Graphics Texture Mapping 고려대학교컴퓨터그래픽스연구실 3D Rendering Pipeline 3D Primitives 3D Modeling Coordinates Model Transformation 3D World Coordinates Lighting 3D World Coordinates Viewing Transformation 3D Viewing

More information

X. GPU Programming. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter X 1

X. GPU Programming. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter X 1 X. GPU Programming 320491: Advanced Graphics - Chapter X 1 X.1 GPU Architecture 320491: Advanced Graphics - Chapter X 2 GPU Graphics Processing Unit Parallelized SIMD Architecture 112 processing cores

More information

Overview. By end of the week:

Overview. By end of the week: Overview By end of the week: - Know the basics of git - Make sure we can all compile and run a C++/ OpenGL program - Understand the OpenGL rendering pipeline - Understand how matrices are used for geometric

More information

CPSC 436D Video Game Programming

CPSC 436D Video Game Programming CPSC 436D Video Game Programming OpenGL/Shaders Opengl RENDERING PIPELINE Copyright: Alla Sheffer 1 Opengl RENDERING PIPELINE C/C++ OpenGL GLSL (automatic) (automatic) GLSL (automatic) opengl Low-level

More information

CS 432 Interactive Computer Graphics

CS 432 Interactive Computer Graphics CS 432 Interactive Computer Graphics Lecture 7 Part 2 Texture Mapping in OpenGL Matt Burlick - Drexel University - CS 432 1 Topics Texture Mapping in OpenGL Matt Burlick - Drexel University - CS 432 2

More information

Lighting and Texturing

Lighting and Texturing Lighting and Texturing Michael Tao Michael Tao Lighting and Texturing 1 / 1 Fixed Function OpenGL Lighting Need to enable lighting Need to configure lights Need to configure triangle material properties

More information

OpenGL. Toolkits.

OpenGL. Toolkits. http://www.opengl.org OpenGL Open Graphics Library Graphics API Delivered with UNIX, Win9x/2000/Me/Nt/Xp, Mac OS Direct3D (DirectX) is only Windows Utilizes the window system and event handling of the

More information

CT5510: Computer Graphics. Texture Mapping

CT5510: Computer Graphics. Texture Mapping CT5510: Computer Graphics Texture Mapping BOCHANG MOON Texture Mapping Simulate spatially varying surface properties Phong illumination model is coupled with a material (e.g., color) Add small polygons

More information

Lecture 22 Sections 8.8, 8.9, Wed, Oct 28, 2009

Lecture 22 Sections 8.8, 8.9, Wed, Oct 28, 2009 s The s Lecture 22 Sections 8.8, 8.9, 8.10 Hampden-Sydney College Wed, Oct 28, 2009 Outline s The 1 2 3 4 5 The 6 7 8 Outline s The 1 2 3 4 5 The 6 7 8 Creating Images s The To create a texture image internally,

More information

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer Real-Time Rendering (Echtzeitgraphik) Michael Wimmer wimmer@cg.tuwien.ac.at Walking down the graphics pipeline Application Geometry Rasterizer What for? Understanding the rendering pipeline is the key

More information

General Purpose computation on GPUs. Liangjun Zhang 2/23/2005

General Purpose computation on GPUs. Liangjun Zhang 2/23/2005 General Purpose computation on GPUs Liangjun Zhang 2/23/2005 Outline Interpretation of GPGPU GPU Programmable interfaces GPU programming sample: Hello, GPGPU More complex programming GPU essentials, opportunity

More information

Introduction to OpenGL

Introduction to OpenGL Introduction to OpenGL Banafsheh Azari http://www.uni-weimar.de/cms/medien/cg.html What You ll See Today What is OpenGL? Related Libraries OpenGL Command Syntax B. Azari http://www.uni-weimar.de/cms/medien/cg.html

More information

Sign up for crits! Announcments

Sign up for crits! Announcments Sign up for crits! Announcments Reading for Next Week FvD 16.1-16.3 local lighting models GL 5 lighting GL 9 (skim) texture mapping Modern Game Techniques CS248 Lecture Nov 13 Andrew Adams Overview The

More information

Programming shaders & GPUs Christian Miller CS Fall 2011

Programming shaders & GPUs Christian Miller CS Fall 2011 Programming shaders & GPUs Christian Miller CS 354 - Fall 2011 Fixed-function vs. programmable Up until 2001, graphics cards implemented the whole pipeline for you Fixed functionality but configurable

More information

OpenGL Basics I. Seoul National University Graphics & Media Lab

OpenGL Basics I. Seoul National University Graphics & Media Lab OpenGL Basics I Seoul National University Graphics & Media Lab Contents Introduction to OpenGL OpenGL sample 01 OpenGL primitives OpenGL colors Introduction to OpenGL Evolution of Computers 4 Graphics

More information

CS452/552; EE465/505. Image Processing Frame Buffer Objects

CS452/552; EE465/505. Image Processing Frame Buffer Objects CS452/552; EE465/505 Image Processing Frame Buffer Objects 3-12 15 Outline! Image Processing: Examples! Render to Texture Read: Angel, Chapter 7, 7.10-7.13 Lab3 new due date: Friday, Mar. 13 th Project#1

More information

Programmable Graphics Hardware

Programmable Graphics Hardware Programmable Graphics Hardware Outline 2/ 49 A brief Introduction into Programmable Graphics Hardware Hardware Graphics Pipeline Shading Languages Tools GPGPU Resources Hardware Graphics Pipeline 3/ 49

More information

CS4621/5621 Fall Basics of OpenGL/GLSL Textures Basics

CS4621/5621 Fall Basics of OpenGL/GLSL Textures Basics CS4621/5621 Fall 2015 Basics of OpenGL/GLSL Textures Basics Professor: Kavita Bala Instructor: Nicolas Savva with slides from Balazs Kovacs, Eston Schweickart, Daniel Schroeder, Jiang Huang and Pramook

More information

VGP352 Week March-2008

VGP352 Week March-2008 VGP352 Week 10 Agenda: Texture rectangles Post-processing effects Filter kernels Simple blur Edge detection Separable filter kernels Gaussian blur Depth-of-field Texture Rectangle Cousin to 2D textures

More information

Shaders. Slide credit to Prof. Zwicker

Shaders. Slide credit to Prof. Zwicker Shaders Slide credit to Prof. Zwicker 2 Today Shader programming 3 Complete model Blinn model with several light sources i diffuse specular ambient How is this implemented on the graphics processor (GPU)?

More information

Graphics Programming

Graphics Programming Graphics Programming 3 rd Week, 2011 OpenGL API (1) API (application programming interface) Interface between an application program and a graphics system Application Program OpenGL API Graphics Library

More information

Page 6 PROCESSOR PROCESSOR FRAGMENT FRAGMENT. texy[1] texx. texy[1] texx. texy[0] texy[0]

Page 6 PROCESSOR PROCESSOR FRAGMENT FRAGMENT. texy[1] texx. texy[1] texx. texy[0] texy[0] This lecture is based on GPGPU::Basic Math Tutorial, Dominik Goeddeke, http:www.mathematik.uni-dortmund.de/~goeddeke/gpgpu/tutorial.html 220 Winter 2009 CMPE A linear algebra application GPGPU: SAXPY stands

More information

Graphics Hardware. Instructor Stephen J. Guy

Graphics Hardware. Instructor Stephen J. Guy Instructor Stephen J. Guy Overview What is a GPU Evolution of GPU GPU Design Modern Features Programmability! Programming Examples Overview What is a GPU Evolution of GPU GPU Design Modern Features Programmability!

More information

INF3320 Computer Graphics and Discrete Geometry

INF3320 Computer Graphics and Discrete Geometry INF3320 Computer Graphics and Discrete Geometry Texturing Christopher Dyken Martin Reimers 06.10.2010 Page 1 Texturing Linear interpolation Real Time Rendering: Chapter 5: Visual Appearance Chapter 6:

More information

Textures. Texture Mapping. Bitmap Textures. Basic Texture Techniques

Textures. Texture Mapping. Bitmap Textures. Basic Texture Techniques Texture Mapping Textures The realism of an image is greatly enhanced by adding surface textures to the various faces of a mesh object. In part a) images have been pasted onto each face of a box. Part b)

More information

Graphics Pipeline & APIs

Graphics Pipeline & APIs Graphics Pipeline & APIs CPU Vertex Processing Rasterization Fragment Processing glclear (GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT); glpushmatrix (); gltranslatef (-0.15, -0.15, solidz); glmaterialfv(gl_front,

More information

Computergraphics Exercise 15/ Shading & Texturing

Computergraphics Exercise 15/ Shading & Texturing Computergraphics Exercise 15/16 3. Shading & Texturing Jakob Wagner for internal use only Shaders Vertex Specification define vertex format & data in model space Vertex Processing transform to clip space

More information

Introduction to Shaders.

Introduction to Shaders. Introduction to Shaders Marco Benvegnù hiforce@gmx.it www.benve.org Summer 2005 Overview Rendering pipeline Shaders concepts Shading Languages Shading Tools Effects showcase Setup of a Shader in OpenGL

More information

OpenGL: Open Graphics Library. Introduction to OpenGL Part II. How do I render a geometric primitive? What is OpenGL

OpenGL: Open Graphics Library. Introduction to OpenGL Part II. How do I render a geometric primitive? What is OpenGL OpenGL: Open Graphics Library Introduction to OpenGL Part II CS 351-50 Graphics API ( Application Programming Interface) Software library Layer between programmer and graphics hardware (and other software

More information

Supplement to Lecture 22

Supplement to Lecture 22 Supplement to Lecture 22 Programmable GPUs Programmable Pipelines Introduce programmable pipelines - Vertex shaders - Fragment shaders Introduce shading languages - Needed to describe shaders - RenderMan

More information

Assignment #6 2D Vector Field Visualization Arrow Plot and LIC

Assignment #6 2D Vector Field Visualization Arrow Plot and LIC Assignment #6 2D Vector Field Visualization Arrow Plot and LIC Due Oct.15th before midnight Goal: In this assignment, you will be asked to implement two visualization techniques for 2D steady (time independent)

More information

OpenGL Performances and Flexibility

OpenGL Performances and Flexibility OpenGL Performances and Flexibility Marco Di Benedetto Visual Computing Laboratory ISTI CNR, Italy OpenGL Roadmap 1.0 - Jan 1992 - First Version 1.1 - Jan 1997 - Vertex Arrays, Texture Objects 1.2 - Mar

More information

OpenGL Performances and Flexibility. Visual Computing Laboratory ISTI CNR, Italy

OpenGL Performances and Flexibility. Visual Computing Laboratory ISTI CNR, Italy OpenGL Performances and Flexibility Visual Computing Laboratory ISTI CNR, Italy The Abstract Graphics Pipeline Application 1. The application specifies vertices & connectivity. Vertex Processing 2. The

More information

Today. Rendering - III. Outline. Texturing: The 10,000m View. Texture Coordinates. Specifying Texture Coordinates in GL

Today. Rendering - III. Outline. Texturing: The 10,000m View. Texture Coordinates. Specifying Texture Coordinates in GL Today Rendering - III CS148, Summer 2010 Graphics Pipeline and Programmable Shaders Artist Workflow Siddhartha Chaudhuri 1 2 Outline Texturing: The 10,000m View Intro to textures The fixed-function graphics

More information

Programmable GPUs. Real Time Graphics 11/13/2013. Nalu 2004 (NVIDIA Corporation) GeForce 6. Virtua Fighter 1995 (SEGA Corporation) NV1

Programmable GPUs. Real Time Graphics 11/13/2013. Nalu 2004 (NVIDIA Corporation) GeForce 6. Virtua Fighter 1995 (SEGA Corporation) NV1 Programmable GPUs Real Time Graphics Virtua Fighter 1995 (SEGA Corporation) NV1 Dead or Alive 3 2001 (Tecmo Corporation) Xbox (NV2A) Nalu 2004 (NVIDIA Corporation) GeForce 6 Human Head 2006 (NVIDIA Corporation)

More information

Best practices for effective OpenGL programming. Dan Omachi OpenGL Development Engineer

Best practices for effective OpenGL programming. Dan Omachi OpenGL Development Engineer Best practices for effective OpenGL programming Dan Omachi OpenGL Development Engineer 2 What Is OpenGL? 3 OpenGL is a software interface to graphics hardware - OpenGL Specification 4 GPU accelerates rendering

More information

Programming with OpenGL Part 3: Shaders. Ed Angel Professor of Emeritus of Computer Science University of New Mexico

Programming with OpenGL Part 3: Shaders. Ed Angel Professor of Emeritus of Computer Science University of New Mexico Programming with OpenGL Part 3: Shaders Ed Angel Professor of Emeritus of Computer Science University of New Mexico 1 Objectives Simple Shaders - Vertex shader - Fragment shaders Programming shaders with

More information

Graphics Pipeline & APIs

Graphics Pipeline & APIs 3 2 4 Graphics Pipeline & APIs CPU Vertex Processing Rasterization Processing glclear (GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT); glpushmatrix (); gltranslatef (-0.15, -0.15, solidz); glmaterialfv(gl_front,

More information

Lecture 07: Buffers and Textures

Lecture 07: Buffers and Textures Lecture 07: Buffers and Textures CSE 40166 Computer Graphics Peter Bui University of Notre Dame, IN, USA October 26, 2010 OpenGL Pipeline Today s Focus Pixel Buffers: read and write image data to and from

More information

Fog example. Fog is atmospheric effect. Better realism, helps determine distances

Fog example. Fog is atmospheric effect. Better realism, helps determine distances Fog example Fog is atmospheric effect Better realism, helps determine distances Fog Fog was part of OpenGL fixed function pipeline Programming fixed function fog Parameters: Choose fog color, fog model

More information

Texture Mapping. Texture Mapping. Map textures to surfaces. Trompe L Oeil ( Deceive the Eye ) The texture. Texture map

Texture Mapping. Texture Mapping. Map textures to surfaces. Trompe L Oeil ( Deceive the Eye ) The texture. Texture map CSCI 42 Computer Graphic Lecture 2 Texture Mapping A way of adding urface detail Texture Mapping Jernej Barbic Univerity of Southern California Texture Mapping + Shading Filtering and Mipmap Non-color

More information

Framebuffer Objects. Emil Persson ATI Technologies, Inc.

Framebuffer Objects. Emil Persson ATI Technologies, Inc. Framebuffer Objects Emil Persson ATI Technologies, Inc. epersson@ati.com Introduction Render-to-texture is one of the most important techniques in real-time rendering. In OpenGL this was traditionally

More information

Programming Graphics Hardware

Programming Graphics Hardware Programming Graphics Hardware Computer Graphics, VT 2013 Lecture 10 Johan Nysjö Centre for Image analysis Swedish University of Agricultural Sciences Uppsala University Recap: The fixed-function OpenGL

More information

FAKULTI TEKNOLOGI MAKLUMAT DAN KOMUNIKASI BITM INTERACTIVE COMPUTER GRAPHICS LAB SESSION 4. C++ - OpenGL

FAKULTI TEKNOLOGI MAKLUMAT DAN KOMUNIKASI BITM INTERACTIVE COMPUTER GRAPHICS LAB SESSION 4. C++ - OpenGL FAKULTI TEKNOLOGI MAKLUMAT DAN KOMUNIKASI BITM 3213 - INTERACTIVE COMPUTER GRAPHICS LAB SESSION 4 C++ - OpenGL Part 1- C++ - Texture Mapping 1. Download texture file and put it into your current folder

More information

Copyright Khronos Group 2012 Page 1. Teaching GL. Dave Shreiner Director, Graphics and GPU Computing, ARM 1 December 2012

Copyright Khronos Group 2012 Page 1. Teaching GL. Dave Shreiner Director, Graphics and GPU Computing, ARM 1 December 2012 Copyright Khronos Group 2012 Page 1 Teaching GL Dave Shreiner Director, Graphics and GPU Computing, ARM 1 December 2012 Copyright Khronos Group 2012 Page 2 Agenda Overview of OpenGL family of APIs Comparison

More information

Information Coding / Computer Graphics, ISY, LiTH GLSL. OpenGL Shading Language. Language with syntax similar to C

Information Coding / Computer Graphics, ISY, LiTH GLSL. OpenGL Shading Language. Language with syntax similar to C GLSL OpenGL Shading Language Language with syntax similar to C Syntax somewhere between C och C++ No classes. Straight ans simple code. Remarkably understandable and obvious! Avoids most of the bad things

More information

Graphics Programming. Computer Graphics, VT 2016 Lecture 2, Chapter 2. Fredrik Nysjö Centre for Image analysis Uppsala University

Graphics Programming. Computer Graphics, VT 2016 Lecture 2, Chapter 2. Fredrik Nysjö Centre for Image analysis Uppsala University Graphics Programming Computer Graphics, VT 2016 Lecture 2, Chapter 2 Fredrik Nysjö Centre for Image analysis Uppsala University Graphics programming Typically deals with How to define a 3D scene with a

More information

Texture Mapping. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Texture Mapping. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science Texture Mapping CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science 1 Objectives Introduce Mapping Methods - Texture Mapping - Environment Mapping - Bump Mapping Consider

More information

Motivation Hardware Overview Programming model. GPU computing. Part 1: General introduction. Ch. Hoelbling. Wuppertal University

Motivation Hardware Overview Programming model. GPU computing. Part 1: General introduction. Ch. Hoelbling. Wuppertal University Part 1: General introduction Ch. Hoelbling Wuppertal University Lattice Practices 2011 Outline 1 Motivation 2 Hardware Overview History Present Capabilities 3 Programming model Past: OpenGL Present: CUDA

More information

Texture Mapping. Computer Graphics, 2015 Lecture 9. Johan Nysjö Centre for Image analysis Uppsala University

Texture Mapping. Computer Graphics, 2015 Lecture 9. Johan Nysjö Centre for Image analysis Uppsala University Texture Mapping Computer Graphics, 2015 Lecture 9 Johan Nysjö Centre for Image analysis Uppsala University What we have rendered so far: Looks OK, but how do we add more details (and colors)? Texture mapping

More information

Rendering Objects. Need to transform all geometry then

Rendering Objects. Need to transform all geometry then Intro to OpenGL Rendering Objects Object has internal geometry (Model) Object relative to other objects (World) Object relative to camera (View) Object relative to screen (Projection) Need to transform

More information

COMP371 COMPUTER GRAPHICS

COMP371 COMPUTER GRAPHICS COMP371 COMPUTER GRAPHICS SESSION 12 PROGRAMMABLE SHADERS Announcement Programming Assignment #2 deadline next week: Session #7 Review of project proposals 2 Lecture Overview GPU programming 3 GPU Pipeline

More information

Applying Textures. Lecture 27. Robb T. Koether. Hampden-Sydney College. Fri, Nov 3, 2017

Applying Textures. Lecture 27. Robb T. Koether. Hampden-Sydney College. Fri, Nov 3, 2017 Applying Textures Lecture 27 Robb T. Koether Hampden-Sydney College Fri, Nov 3, 2017 Robb T. Koether (Hampden-Sydney College) Applying Textures Fri, Nov 3, 2017 1 / 24 Outline 1 Applying Textures 2 Photographs

More information

Levy: Constraint Texture Mapping, SIGGRAPH, CS 148, Summer 2012 Introduction to Computer Graphics and Imaging Justin Solomon

Levy: Constraint Texture Mapping, SIGGRAPH, CS 148, Summer 2012 Introduction to Computer Graphics and Imaging Justin Solomon Levy: Constraint Texture Mapping, SIGGRAPH, 2001 CS 148, Summer 2012 Introduction to Computer Graphics and Imaging Justin Solomon Instructor: Justin Solomon Email: justin.solomon@stanford.edu Office: Clark

More information

1)Write a shader program that renders a regular pentagon with textured image like the one shown below.

1)Write a shader program that renders a regular pentagon with textured image like the one shown below. Andrew Yenalavitch CSE520 Winter 2015 Quiz 2 Report 1)Write a shader program that renders a regular pentagon with textured image like the one shown below. Use the following provided image for the texture:

More information

Computer Graphics Programming

Computer Graphics Programming Computer Graphics Programming Graphics APIs Using MFC (Microsoft Foundation Class) in Visual C++ Programming in Visual C++ GLUT in Windows and Unix platform Overview and Application Graphics APIs Provide

More information

Lecture 19: OpenGL Texture Mapping. CITS3003 Graphics & Animation

Lecture 19: OpenGL Texture Mapping. CITS3003 Graphics & Animation Lecture 19: OpenGL Texture Mapping CITS3003 Graphics & Animation E. Angel and D. Shreiner: Interactive Computer Graphics 6E Addison-Wesley 2012 Objectives Introduce the OpenGL texture functions and options

More information

Grafica Computazionale

Grafica Computazionale Grafica Computazionale lezione36 Informatica e Automazione, "Roma Tre" June 3, 2010 Grafica Computazionale: Lezione 33 Textures Introduction Steps in Texture Mapping A Sample Program Texturing algorithms

More information

IntMu.Lab5. Download all the files available from

IntMu.Lab5. Download all the files available from IntMu.Lab5 0. Download all the files available from http://www.dee.isep.ipp.pt/~jml/intmu/lab5: wget http://www.dee.isep.ipp.pt/~jml/intmu/lab5/makefile make getall Analyze the program windmill.c. Compile

More information

Programmable shader. Hanyang University

Programmable shader. Hanyang University Programmable shader Hanyang University Objective API references (will be skipped) Examples Simple shader Phong shading shader INTRODUCTION GLSL(OPENGL SHADING LANGUAGE) Scalar Data types Structure Structures

More information

INF3320 Computer Graphics and Discrete Geometry

INF3320 Computer Graphics and Discrete Geometry INF3320 Computer Graphics and Discrete Geometry Texturing Christopher Dyken Martin Reimers 06.10.2010 Page 1 Texturing Linear interpolation Real Time Rendering: Chapter 5: Visual Appearance Chapter 6:

More information

Introduction to OpenGL Transformations, Viewing and Lighting. Ali Bigdelou

Introduction to OpenGL Transformations, Viewing and Lighting. Ali Bigdelou Introduction to OpenGL Transformations, Viewing and Lighting Ali Bigdelou Modeling From Points to Polygonal Objects Vertices (points) are positioned in the virtual 3D scene Connect points to form polygons

More information

OpenGL An introduction

OpenGL An introduction OpenGL An introduction Camilla Berglund elmindreda@stacken.kth.se Introductory illustration by theodore This material is under a Creative Commons license http://creativecommons.org/licenses/by-sa/2.5/se/

More information

Assignment #5: Scalar Field Visualization 3D: Direct Volume Rendering

Assignment #5: Scalar Field Visualization 3D: Direct Volume Rendering Assignment #5: Scalar Field Visualization 3D: Direct Volume Rendering Goals: Due October 4 th, before midnight This is the continuation of Assignment 4. The goal is to implement a simple DVR -- 2D texture-based

More information

Computer graphics MN1

Computer graphics MN1 Computer graphics MN1 http://www.opengl.org Todays lecture What is OpenGL? How do I use it? Rendering pipeline Points, vertices, lines,, polygons Matrices and transformations Lighting and shading Code

More information

Methodology for Lecture

Methodology for Lecture Basic Geometry Setup Methodology for Lecture Make mytest1 more ambitious Sequence of steps Demo Review of Last Demo Changed floor to all white, added global for teapot and teapotloc, moved geometry to

More information

Programming with OpenGL Shaders I. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico

Programming with OpenGL Shaders I. Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico Programming with OpenGL Shaders I Adapted From: Ed Angel Professor of Emeritus of Computer Science University of New Mexico 0 Objectives Shader Basics Simple Shaders Vertex shader Fragment shaders 1 Vertex

More information

Lecture 2 2D transformations Introduction to OpenGL

Lecture 2 2D transformations Introduction to OpenGL Lecture 2 2D transformations Introduction to OpenGL OpenGL where it fits what it contains how you work with it OpenGL parts: GL = Graphics Library (core lib) GLU = GL Utilities (always present) GLX, AGL,

More information

CS4621/5621 Fall Computer Graphics Practicum Intro to OpenGL/GLSL

CS4621/5621 Fall Computer Graphics Practicum Intro to OpenGL/GLSL CS4621/5621 Fall 2015 Computer Graphics Practicum Intro to OpenGL/GLSL Professor: Kavita Bala Instructor: Nicolas Savva with slides from Balazs Kovacs, Eston Schweickart, Daniel Schroeder, Jiang Huang

More information

Ulf Assarsson Department of Computer Engineering Chalmers University of Technology

Ulf Assarsson Department of Computer Engineering Chalmers University of Technology Ulf Assarsson Department of Computer Engineering Chalmers University of Technology 1. I am located in room 4115 in EDIT-huset 2. Email: 3. Phone: 031-772 1775 (office) 4. Course assistant: Tomas Akenine-Mőller

More information

GLSL Introduction. Fu-Chung Huang. Thanks for materials from many other people

GLSL Introduction. Fu-Chung Huang. Thanks for materials from many other people GLSL Introduction Fu-Chung Huang Thanks for materials from many other people Programmable Shaders //per vertex inputs from main attribute aposition; attribute anormal; //outputs to frag. program varying

More information

12.2 Programmable Graphics Hardware

12.2 Programmable Graphics Hardware Fall 2018 CSCI 420: Computer Graphics 12.2 Programmable Graphics Hardware Kyle Morgenroth http://cs420.hao-li.com 1 Introduction Recent major advance in real time graphics is the programmable pipeline:

More information

GLSL 1: Basics. J.Tumblin-Modified SLIDES from:

GLSL 1: Basics. J.Tumblin-Modified SLIDES from: GLSL 1: Basics J.Tumblin-Modified SLIDES from: Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New Mexico and

More information

WebGL and GLSL Basics. CS559 Fall 2015 Lecture 10 October 6, 2015

WebGL and GLSL Basics. CS559 Fall 2015 Lecture 10 October 6, 2015 WebGL and GLSL Basics CS559 Fall 2015 Lecture 10 October 6, 2015 Last time Hardware Rasterization For each point: Compute barycentric coords Decide if in or out.7,.7, -.4 1.1, 0, -.1.9,.05,.05.33,.33,.33

More information

OpenGL. Jimmy Johansson Norrköping Visualization and Interaction Studio Linköping University

OpenGL. Jimmy Johansson Norrköping Visualization and Interaction Studio Linköping University OpenGL Jimmy Johansson Norrköping Visualization and Interaction Studio Linköping University Background Software interface to graphics hardware 250+ commands Objects (models) are built from geometric primitives

More information

Buffers. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Buffers. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015 Buffers 1 Objectives Introduce additional WebGL buffers Reading and writing buffers Buffers and Images 2 Buffer Define a buffer by its spatial resolution (n x m) and its depth (or precision) k, the number

More information

Lecture 13: OpenGL Shading Language (GLSL)

Lecture 13: OpenGL Shading Language (GLSL) Lecture 13: OpenGL Shading Language (GLSL) COMP 175: Computer Graphics April 18, 2018 1/56 Motivation } Last week, we discussed the many of the new tricks in Graphics require low-level access to the Graphics

More information

Name: SID: LAB Section: Lab 6 - Part 1: Pixels and Triangle Rasterization

Name: SID: LAB Section: Lab 6 - Part 1: Pixels and Triangle Rasterization Name: SID: LAB Section: Lab 6 - Part 1: Pixels and Triangle Rasterization 1. Coordinate space conversions. In OpenGL, the coordinates of a vertex in model-view space can be converted to NPC coordinates,

More information

Introduction to Computer Graphics with WebGL

Introduction to Computer Graphics with WebGL Introduction to Computer Graphics with WebGL Ed Angel The Mandelbrot Set Fractals Fractal (fractional geometry) objects generate some of the most complex and beautiful graphics - The mathematics describing

More information

last time put back pipeline figure today will be very codey OpenGL API library of routines to control graphics calls to compile and load shaders

last time put back pipeline figure today will be very codey OpenGL API library of routines to control graphics calls to compile and load shaders last time put back pipeline figure today will be very codey OpenGL API library of routines to control graphics calls to compile and load shaders calls to load vertex data to vertex buffers calls to load

More information

CSE 167: Introduction to Computer Graphics Lecture #7: GLSL. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016

CSE 167: Introduction to Computer Graphics Lecture #7: GLSL. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016 CSE 167: Introduction to Computer Graphics Lecture #7: GLSL Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016 Announcements Project 2 due Friday 4/22 at 2pm Midterm #1 on

More information

Shader Programming 1. Examples. Vertex displacement mapping. Daniel Wesslén 1. Post-processing, animated procedural textures

Shader Programming 1. Examples. Vertex displacement mapping. Daniel Wesslén 1. Post-processing, animated procedural textures Shader Programming 1 Examples Daniel Wesslén, dwn@hig.se Per-pixel lighting Texture convolution filtering Post-processing, animated procedural textures Vertex displacement mapping Daniel Wesslén 1 Fragment

More information

Some advantages come from the limited environment! No classes. Stranight ans simple code. Remarkably. Avoids most of the bad things with C/C++.

Some advantages come from the limited environment! No classes. Stranight ans simple code. Remarkably. Avoids most of the bad things with C/C++. GLSL OpenGL Shading Language Language with syntax similar to C Syntax somewhere between C och C++ No classes. Stranight ans simple code. Remarkably understandable and obvious! Avoids most of the bad things

More information

CSE 167: Introduction to Computer Graphics Lecture #7: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018

CSE 167: Introduction to Computer Graphics Lecture #7: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018 CSE 167: Introduction to Computer Graphics Lecture #7: Textures Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018 Announcements Project 2 due this Friday at 2pm Grading in

More information

OpenGL refresher. Advanced Computer Graphics 2012

OpenGL refresher. Advanced Computer Graphics 2012 Advanced Computer Graphics 2012 What you will see today Outline General OpenGL introduction Setting up: GLUT and GLEW Elementary rendering Transformations in OpenGL Texture mapping Programmable shading

More information

Lecture 2. Shaders, GLSL and GPGPU

Lecture 2. Shaders, GLSL and GPGPU Lecture 2 Shaders, GLSL and GPGPU Is it interesting to do GPU computing with graphics APIs today? Lecture overview Why care about shaders for computing? Shaders for graphics GLSL Computing with shaders

More information

CISC 3620 Lecture 7 Lighting and shading. Topics: Exam results Buffers Texture mapping intro Texture mapping basics WebGL texture mapping

CISC 3620 Lecture 7 Lighting and shading. Topics: Exam results Buffers Texture mapping intro Texture mapping basics WebGL texture mapping CISC 3620 Lecture 7 Lighting and shading Topics: Exam results Buffers Texture mapping intro Texture mapping basics WebGL texture mapping Exam results Grade distribution 12 Min: 26 10 Mean: 74 8 Median:

More information

CS452/552; EE465/505. Texture Mapping in WebGL

CS452/552; EE465/505. Texture Mapping in WebGL CS452/552; EE465/505 Texture Mapping in WebGL 2-26 15 Outline! Texture Mapping in WebGL Read: Angel, Chapter 7, 7.3-7.5 LearningWebGL lesson 5: http://learningwebgl.com/blog/?p=507 Lab3 due: Monday, 3/2

More information

Transformation Pipeline

Transformation Pipeline Transformation Pipeline Local (Object) Space Modeling World Space Clip Space Projection Eye Space Viewing Perspective divide NDC space Normalized l d Device Coordinatesd Viewport mapping Screen space Coordinate

More information

The Graphics Pipeline and OpenGL III: OpenGL Shading Language (GLSL 1.10)!

The Graphics Pipeline and OpenGL III: OpenGL Shading Language (GLSL 1.10)! ! The Graphics Pipeline and OpenGL III: OpenGL Shading Language (GLSL 1.10)! Gordon Wetzstein! Stanford University! EE 267 Virtual Reality! Lecture 4! stanford.edu/class/ee267/! Updates! for 24h lab access:

More information

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE UGRAD.CS.UBC.C A/~CS314 Mikhail Bessmeltsev 1 WHAT IS RENDERING? Generating image from a 3D scene 2 WHAT IS RENDERING? Generating image

More information

CENG 477 Introduction to Computer Graphics. Graphics Hardware and OpenGL

CENG 477 Introduction to Computer Graphics. Graphics Hardware and OpenGL CENG 477 Introduction to Computer Graphics Graphics Hardware and OpenGL Introduction Until now, we focused on graphic algorithms rather than hardware and implementation details But graphics, without using

More information

+ = Texturing: Glue n-dimensional images onto geometrical objects. Texturing. Texture magnification. Texture coordinates. Bilinear interpolation

+ = Texturing: Glue n-dimensional images onto geometrical objects. Texturing. Texture magnification. Texture coordinates. Bilinear interpolation Texturing Slides done bytomas Akenine-Möller and Ulf Assarsson Chalmers University of Technology Texturing: Glue n-dimensional images onto geometrical objects Purpose: more realism, and this is a cheap

More information

Real - Time Rendering. Graphics pipeline. Michal Červeňanský Juraj Starinský

Real - Time Rendering. Graphics pipeline. Michal Červeňanský Juraj Starinský Real - Time Rendering Graphics pipeline Michal Červeňanský Juraj Starinský Overview History of Graphics HW Rendering pipeline Shaders Debugging 2 History of Graphics HW First generation Second generation

More information