GPU Stuff and Curves and Splines

GPU Stuff and Curves and Splines

More GPU Stuff and Curves and Splines Outline • Announcements • Project 2 • GLSL • Hermite Splines • Catmull-Rom Splines • Bezier Curves • Higher Continuity: Natural and B-Splines • Drawing Splines Announcements • Don’t lock the door of the lab! • Don’t paste solutions to the BBoards. • Final Exam: Tues 5/12 from 8:30AM - 11:30AM, room TBA. Outline • Announcements • Project 2 • GLSL • Hermite Splines • Catmull-Rom Splines • Bezier Curves • Higher Continuity: Natural and B-Splines • Drawing Splines Project 2 Get started early!!! Outline • Announcements • Project 2 • GLSL • Hermite Splines • Catmull-Rom Splines • Bezier Curves • Higher Continuity: Natural and B-Splines • Drawing Splines OpenGL Pipeline ! !"#$"%&&%'()*!+,)(+-) ! .)"/)0*,"#1)22#"2 ! 3"%$&)-/*,"#1)22#"2 Simplified OpenGL Pipeline Vertex Data Vertex Rasterization Fragment Operation (Interpolation) Operation Framebuffer More Detail PositionsNormalsColors Eye Positions Position Eye Normals Normal Vertex Rasterization Fragment Colors Color Operation (Interpolation) Operation (Interpolated) Framebuffer Programmability PositionsNormalsColors Eye Positions Position Eye Normals Normal Vertex Rasterization Fragment Colors Color Operation (Interpolation) Operation Programmable (Interpolated) Programmable Framebuffer Variable Types • const - The declaration is of a compile time constant • attribute - Global variables that may change per vertex, that are passed from the OpenGL application to vertex shaders. This qualifier can only be used in vertex shaders. For the shader this is a read-only variable. • varying - used for interpolated data between a vertex shader and a fragment shader. Available for writing in the vertex shader, and read-only in a fragment shader. • uniform - Global variables that may change per primitive (may not be set inside glBegin,/glEnd), that are passed from the OpenGL application to the shaders. This qualifier can be used in both vertex and fragment shaders. For the shaders this is a read-only variable. Attribute Variables PositionsNormalsColorsAttributes Eye Positions Position Eye Normals Normal Vertex Rasterization Fragment Colors Color Operation (Interpolation) Operation Programmable (Interpolated) Programmable Framebuffer Varying Variables PositionsNormalsColorsAttributes Eye Positions Position Eye Normals Normal Vertex Rasterization Fragment Colors (Interpolation) Color Operation Varying Varying Operation Programmable (Interpolated) Programmable Framebuffer Uniform Variables Uniform PositionsNormalsColorsAttributes Eye Positions Position Eye Normals Normal Vertex Rasterization Fragment Colors (Interpolation) Color Operation Varying Varying Operation Programmable (Interpolated) Programmable Framebuffer Why So Fast? Uniform PositionsNormalsColorsAttributes ~16 Fragment Shaders Eye Positions Position Eye Normals Normal Vertex Rasterization Fragment Colors (Interpolation) Color Operation Varying Varying Operation Programmable (Interpolated) Programmable ~4 Vertex Shaders Framebuffer Types and Functions !"#$%&#'()"'*%#+',( +<?4F$X(,T.K14J($.4J3.J?(8F$,$=( -./012()345/1647(89:;(<;;= ( C?DE( !"#$$!"#%&'()!*+,-#.$!"#/$!"#$0$ Y315Q(@?Z?0?45?(F31K?$ 234$=$234>$?$234@$?$234A$ ( $ !"#$=$!"#>$?$!"#@$?$!"#A$ >?5/60(@?A./164.A()345/1647(89:B(<;;= ( H3<4%&13<$ONMN$23%<&)5$GPGQ/$"<$&54-,C3C$&5$R*35ON$2>PQ/$"5C$<*34&B&3C$16$ &234$=$&234>$?$&234@$?$&234A$ 1))-$$"--.$1234$0$ S9:3$R*35ONT$M:"C&58$N"58,"83S/$23%<&)5$GPGQPUVP$$M34#&)5$"5C$*"83$ 1234$=$1234>$?$1234@$?$1234A$ 1))-$$"56.$1234$0$ 1234$$37,"-.$234/$234$0$ 5,!13%<$%3B3%$#)$#:"#$23%<&)5$)B$#:3$<*34P$ 83596*3$=$B-)"#$?$234>$?$234@$?$234A$ 1234$$37,"-.$&234/$&234$0$ 1234$$37,"-.$1234/$1234$0$ 1234$$8%3"#3%9:"5.$234/$234$0$ UI%I(%\PO,(8H:L(<LB=$ I4JA?(.4K(%01J646G?/0D()345/1647(89:L(<;L=( 1234$$8%3"#3%9:"5.$&234/$&234$0$ $ 83596*3$$<&5.$83596*3$0$ 1234$$8%3"#3%9:"5;7,"-.$234/$234$0$ B-)"#/$234>/$234@/$234A$$ 83596*3$$4)<.$83596*3$0$ 1234$$8%3"#3%9:"5;7,"-.$&234/$&234$0$ &5#/$&234>/$&234@/$&234A$$ 83596*3$$#"5.$83596*3$0$ 1234$$-3<<9:"5.$234/$234$0$ $ 1))-/$1234>/$1234@/$1234A$$ 1234$$-3<<9:"5.$&234/$&234$0$ 83596*3$$"<&5.$83596*3$0$ 1234$$-3<<9:"5;7,"-.$234/$234$0$ !"#>/$!"#@/$!"#A$$ 2)&C$$ 83596*3$$"4)<.$83596*3$0$ 1234$$-3<<9:"5;7,"-.$&234/$&234$0$ <"!*-3%GH/$<"!*-3%>H/$<"!*-3%@H$$ 83596*3$$"#"5.$83596*3/$83596*3$0$ 1234$$5)#.$1234$0$ <"!*-3%(,13$$ 83596*3$$"#"5.$83596*3$0$ 1234$$5)#;7,"-.$234/$234$0$ <"!*-3%GHM:"C)D/$<"!*-3%>HM:"C)D$ $ 1234$$5)#;7,"-.$&234/$&234$0$ 83596*3$$%"C&"5<.$83596*3$0 1234$$5)#;7,"-.$1234/$1234$0$ 83596*3$$C38%33<.$83596*3$0$ $ $ %?2/30?($66Q3<()345/1647(89:R(<;B=$$$ UI%I(%\PO(Y"I$#)#O@,(8H:M(<NN=(( $ O2<64?4/1.A()345/1647(89:N(<;N=( '1$230,4&52,6&$"#/&26&-#,./"0$&'()*& 234A$$#3'#,%3GH.$<"!*-3%GH/$B-)"#$I/B-)"#$52,6J$0$ JA6].A([.01.]A?(K?5A.0./1647E( 83596*3$$*)D.$83596*3/$83596*3$0$ ,5&B)%!$ &5*,#$#)$[3%#3'$"5C$F%"8!35#$<:"C3%$B%)!$R*35ON$)%$ 83596*3$$3'*.$83596*3$0$ 234A$$#3'#,%3GHK%)L.$<"!*-3%GH/$234>$I/B-)"#$52,6J$0$ "**-&4"#&)5$.\;`HaRZNb0$ 83596*3$$-)8.$83596*3$0$ 234A$$#3'#,%3GHK%)L.$<"!*-3%GH/$234A$I/B-)"#$52,6J$0$ "##%&1,#3$ &5*,#$*3%a23%#3'$#)$[3%#3'$<:"C3%$B%)!$R*35ON$)%$ 83596*3$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H.$<"!*-3%>HM:"C)D/$234@$I/B-)"#$ 52,6J$0$ 83596*3$$!"'.$83596*3/$83596*3$0$ 234A$$<:"C)DGHK%)L.$<"!*-3%GHM:"C)D/$234A$I/B-)"#$ 52,6J$0$ >O*%+@(*+-P+'O'%,(8;:;(<(MW=$ 83596*3$$!"'.$83596*3/$B-)"#$0$ 234A$$<:"C)D>HK%)L.$<"!*-3%>HM:"C)D/$234A$I/B-)"#$52,6J$0$ $ 83596*3$$!&5.$83596*3/$83596*3$0$ F3/130"0$&0,/"6&/,G&03$&5"&/2%"E&,F#366&6"$6&& 83596*3$$!&5.$83596*3/$B-)"#$0$ $$$$$$$$'/$6/$E/$D$ 83596*3$$!&'.$83596*3/$83596*3/$83596*3$0$ %?2/30?($66Q3<()345/1647(S1/T($+U(89:R(<;B= $$ $$$$$$$$%/$8/$1/$"$ 83596*3$$!&'.$83596*3/$83596*3/$B-)"#$0$ !"#$"%&'()*7&"068#"&9):;<=:!>?@>=:@>=@A?>:+;<9>:A(+ @B&C&D$ $$$$$$$$</$#/$*/$7$ 83596*3$$!)C.$83596*3/$83596*3$0$ 234A$$#3'#,%3GHN)C.$<"!*-3%GH/$B-)"#/$B-)"# &43E$0$ 83596*3$$!)C.$83596*3/$B-)"#$0$ 234A$$#3'#,%3GHK%)LN)C.$<"!*-3%GH/$234>/$B-)"# &43E$0$ 83596*3$$<&85.$83596*3$0$ 234A$$#3'#,%3GHK%)LN)C.$<"!*-3%GH/$234A/$B-)"# &43E$0$ 83596*3$$<!))#:<#3*.$83596*3/$83596*3/$83596*3$0$ $ 83596*3$$<!))#:<#3*.$B-)"#/$B-)"#/$83596*3$0$ 234A$$#3'#,%3>HN)C.$<"!*-3%>H/$234>/$B-)"#&43E$0$ P@OP@+*O,,+@(8M:M(<V=$ 83596*3$$<#3*.$83596*3/$83596*3$0$ 234A$$#3'#,%3>HK%)LN)C.$<"!*-3%>H/$234@/$B-)"#&43E$0$ W$ $ WC3B&53$ XXNYZ;XX$ 83596*3$$<#3*.$B-)"#/$83596*3$0$ 234A$$#3'#,%3>HK%)LN)C.$<"!*-3%>H/$234A/$B-)"#&43E$0$ W,5C3B$ XXFYN;XX$ $ 234A$$#3'#,%3@HK%)LN)C.$<"!*-3%@H/$234A/$B-)"#&43E$0$ W&B$ XX[;\MYRZXX$ F?6G?/015()345/1647(89:H(<;H=( $ W&BC3B$ 234A$$ B#%"5<B)%!.0$$$$$$$$$$$!"#$"%&'()*$ 234A$$#3'#,%3(,13N)C.$<"!*-3%(,13/$234@/$B-)"#$ 43E&0$ W&B5C3B$ 234@$$ 4%)<<.$234@/$234@$0$ $ W3-<3$ B-)"#$$ C&<#"543.$83596*3/$83596*3$0$ 234A$$<:"C)DGHN)C.$<"!*-3%GHM:"C)D/$234@/$B-)"# &43E&0$ B-)"#$$$ C)#.$83596*3/$83596*3$0$ 234A$$<:"C)D>HN)C.$<"!*-3%>HM:"C)D/$234@/$B-)"#&43E$0$ W3-&B$ 83596*3$$ B"43B)%D"%C.$83596*3$!/$83596*3&+/$83596*3$($0$ 234A$$<:"C)DGHK%)LN)C.$<"!*-3%GHM:"C)D/$234A/$B-)"#&43E$0$ W35C&B$ B-)"#$$$ -358#:.$83596*3$0$ 234A$$<:"C)D>HK%)LN)C.$<"!*-3%>HM:"C)D/$234A/$B-)"#&43E&0 W3%%)%$ W*%"8!"$ 83596*3$$ 5)%!"-&E3.$83596*3$0$ W-&53$ 83596*3$$ %3B-34#.$83596*3&+/$83596*3$($0$ 83596*3$$ %3B%"4#.$83596*3&+/$83596*3$(/$B-)"#$"$,$0$ '617?()345/1647(89:V(<BW=( ( B-)"#$$5)&<3G.$83596*3$0$ F$,$([?07164(K?5A.0./164(.4K(?2/?471647(<06/656AE( )0.JG?4/(P065?7714J()345/1647(89:9(<;9=($&-#,./"0$&'()*$ 234>$$5)&<3>.$83596*3$0$ W23%<&)5$ 234@$$5)&<3@.$83596*3$0$ 83596*3$$CFC'.$83596*3$0$ $$$$$$$$C3B",-#$&<$SW23%<&)5$GGQS$.@P@$*GG0$ 83596*3$$CFC6.$83596*3$0$ 234A$$5)&<3A.$83596*3$0$ W3'#35<&)5$]0,/"$?$"--^$_$]%37,&%3$?$35"1-3$?$D"%5$?$C&<"1-3^$ 83596*3$$BD&C#:.$83596*3$0 $$$$$$$$C3B",-#$&<$SW3'#35<&)5$"--$_$C&<"1-3S$.@P@$*GG0$ Type Properties • Matrix / vector / integer / floating point types.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    69 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us