vertex shaders notes

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

Info icon This 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
Image of page 1

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

View Full Document Right 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 access ATTRIB
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern