vertex shaders notes

vertex shaders notes - ARB Shading Language Scott Davis...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
ARB Shading Language Scott Davis November 29, 2005 1 OpenGL pipeline simple OpenGL program glColor3f(0,1,0); glBegin(GL QUADS); glVertex2i(0,0); glVertex2i(1,0); glVertex2i(1,1); glVertex2i(0,1); glEnd(); broad overview (fixed function) vertex per-vertex operations rasterization per-fragment operations framebuffer recent work (within the last 5 years) allows programmers to: replace per-vertex operations with a vertex program and replace per-fragment operations with a fragment program 2 ARB Shader Overview all or nothing if you write a vertex or fragment program, then nothing from the “fixed” version of the program is done, i.e. no transformation is done to vertex or normals the vertex color is not transfered to the fragment program no texturing no automatic texture generation however, the rasterization step is still not programmable and is fixed quantities accessible in a vertex program: for each vertex position color normal texture coordinate (a way to pass data from vertex to fragment programs 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
material properties (ambient, diffuse, specular, . ..) light properties (ambient, position, attenuation . ..) automatically generated texture coordinates matrices (modelview, projection, mvp, texture, program, . ..) output from a vertex program (screen-space) position - required color texture coordinates point size quantities accessible in a fragment program: for each fragment position color texture coordinate material properties (ambient, diffuse, specular, . ..) light properties (ambient, position, attenuation . ..) automatically generated texture coordinates matrices (modelview, projection, mvp, texture, program, . ..) output from a fragment program (only 2) color - required depth 3 ARB Shader Syntax # this line is a comment all programs end with END < OPCODE > < OUTPUT > { , < INPUTS > } bindings and variables keyword description
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 9

vertex shaders notes - ARB Shading Language Scott Davis...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online