Day05 - Day 05 Shader Basics

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Day 05 Shader Basics http://www.xbitlabs.com/articles/graphics/display/radeon-hd- OpenGL Shading Language, 3rd Edition OpenGL SuperBible, 5th Edition OpenGL Shading Language, 3rd Edition Vertex Shader a vertex shader can specify a completely general sequence of operations to be applied to each vertex and its associated data accepts inputs from the application and generates outputs that are consumed by the rest of the graphics pipeline the vertex shader is applied to each inbound vertex and must generate an outbound vertex Vertex Shader typical operations vertex transformation normal transformation and normalization texture coordinate generation texture coordinate transformation lighting color material application Vertex Shader does not replace graphics operations that require knowledge of several vertices at a time perspective divide primitive assembly frustum and user clipping frontface/backface culling polygon mode polygon offset Vertex Shader inputs attributes attributes are in variables variable that has a value when it is passed into the shader and cannot be changed by the shader per vertex data vertex coordinates, normal vector, color user-defined attributes are allowed uniforms a global variable set outside of the shader that is constant (uniform) for the entire primitive tend to change infrequently (at most once per primitive) Vertex Shader outputs vertex shaders are designed to transform and light a single vertex must compute the homogeneous position of the coordinate in clip space and store the result in the special output variable gl_Position global variables output by the vertex shader are called out variables write-only variable in the shader where it is defined i.e., an out variable has no initial value when it is created and it is assumed that the shader will assign a value to the variable Simple Vertex Shader...
View Full Document

Page1 / 33

Day05 - Day 05 Shader Basics

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

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