Cutting edge Representation Equipment 2002 Vertex Programs.

Uploaded on:
Category: Product / Service
Present day Representation Equipment 2002 Vertex Programs Joe Michael Kniss Diagram Pipeline outline VP/FP review Vertex Programs – Me Piece Programs – Aaron Talk Primitive development Tessellation Change to homogeneous eye space, light, texgen, misshape… Change and Lighting
Slide 1

Cutting edge Graphics Hardware 2002 Vertex Programs Joe Michael Kniss

Slide 2

Overview Pipeline review VP/FP diagram Vertex Programs – Me Fragment Programs – Aaron Discussion

Slide 3

Primitive development Tessellation Transform to homogeneous eye space, light, texgen, deform… Transform & Lighting Triangle setup View volume clasp, perspective surface directions Generate pieces, add shading & texcoords Rasterization Fragment preparing Access compositions, & register last shading Stencil, alpha, scissor, profundity …. Tests Add, mult, introduce, max… Blending Anti-Aliasing Modern Graphics Hardware

Slide 4

03? Primitive development Primitive Programs? Piece Programs Transform & Lighting Vertex Programs 00 02 01 99 Triangle setup Rasterization Pre- - 98 Vertex Programs Fragment Programs Vertex Programs 2.0 Fragment handling Tests Combiners Blending Anti-Aliasing Modern Graphics Hardware

Slide 5

Higher request surface Transform & Lighting Vertex Programs Fragment Programs Triangle setup Rasterization Fragment preparing Tests Blending Anti-Aliasing Higher request surfaces PN Triangles (ATI) Bezier patches (NVIDIA)

Slide 6

Higher request surface Transform & Lighting Fragment Programs Vertex Programs Triangle setup Rasterization Fragment handling Tests Blending Anti-Aliasing Vertex Programs 16 information vectors 256 static vectors 12 temp vectors Loops 22 yield vectors Post T&L reserve

Slide 7

Vertex Programs 3-5 flavors nv vertex programs 1.0 & 2.0 ati vertex program (EXT) ARB vertex program 1.0 ( & 2.0 ???) nv 1.0 + ati ext  ARB 1.0 Next gen == ARB 2.0 ???? Nearly coordinates Direct3D

Slide 8

Vertex Programs First era (nv1.0, ati ext, ARB1.0) 128 guidelines 96 constants 12 temps No circles 16 info vectors 96 static vectors 12 temp vectors 15 yield vectors Post T&L reserve

Slide 9

Vertex Programs First gen. inputs Generic Attribute Conventional Attribute Conventional Attribute Command - - - - 0 vertex position Vertex 1 vertex weights 0-3 WeightARB, VertexWeightEXT 2 ordinary Normal 3 essential shading Color 4 optional shading SecondaryColorEXT 5 haze coordinate FogCoordEXT 6 - 7 - 8 composition direction set 0 MultiTexCoord(TEXTURE0, ...) 9 surface direction set 1 MultiTexCoord(TEXTURE1, ...) 10 composition direction set 2 MultiTexCoord(TEXTURE2, ...) 11 composition direction set 3 MultiTexCoord(TEXTURE3, ...) 12 composition direction set 4 MultiTexCoord(TEXTURE4, ...) 13 surface direction set 5 MultiTexCoord(TEXTURE5, ...) 14 composition direction set 6 MultiTexCoord(TEXTURE6, ...) 15 composition direction set 7 MultiTexCoord(TEXTURE7, ...) 8+n composition direction set n MultiTexCoord(TEXTURE0+n, ...)

Slide 10

Vertex Programs First gen. inputs Conventional Attribute Binding Generic Attribute Binding - - - - vertex.position vertex.attrib[0] vertex.weight vertex.attrib[1] vertex.weight[0] vertex.attrib[1] vertex.normal vertex.attrib[2] vertex.color vertex.attrib[3] vertex.color.primary vertex.attrib[3] vertex.color.secondary vertex.attrib[4] vertex.fogcoord vertex.attrib[5] vertex.texcoord vertex.attrib[8] vertex.texcoord[0] vertex.attrib[8] vertex.texcoord[1] vertex.attrib[9] vertex.texcoord[2] vertex.attrib[10] vertex.texcoord[3] vertex.attrib[11] vertex.texcoord[4] vertex.attrib[12] vertex.texcoord[5] vertex.attrib[13] vertex.texcoord[6] vertex.attrib[14] vertex.texcoord[7] vertex.attrib[15] vertex.texcoord[n] vertex.attrib[8+n] ARB 1.0 documentation (inputs == Read just)

Slide 11

Vertex Programs Instruction Inputs Output Description - - - - ABS v total worth ADD v,v v include ARL v a location register load DP3 v,v ssss 3-segment speck item DP4 v,v ssss 4-part spot item DPH v,v ssss homogeneous dab item DST v,v v separation vector EX2 s ssss exponential base 2 EXP s v exponential base 2 (rough) FLR v floor FRC v division LG2 s ssss logarithm base 2 LIT v figure light coefficients LOG s v logarithm base 2 (inexact) MAD v,v,v v increase and include MAX v,v v most extreme MIN v,v v least MOV v move MUL v,v v duplicate POW s,s ssss exponentiate RCP s ssss corresponding RSQ s ssss equal square root SGE v,v v set on more noteworthy than or approach SLT v,v v set on not as much as SUB v,v v subtract SWZ v broadened swizzle XPD v,v v cross item First gen guideline set

Slide 12

Vertex Programs First gen direction set Wow! That’s a considerable measure of guidelines Why: SIMD processor Single clock execution Taken from ARB spec, not all directions accessible on all stages

Slide 13

Vertex Programs First gen. yields Binding Components Description - - - - - result.position (x,y,z,w) position in clasp organizes result.color (r,g,b,a) front-confronting essential shading result.color.primary (r,g,b,a) front-confronting essential shading result.color.secondary (r,g,b,a) front-confronting optional shading result.color.front (r,g,b,a) front-confronting essential shading result.color.front.primary (r,g,b,a) front-confronting essential shading result.color.front.secondary (r,g,b,a) front-confronting auxiliary shading result.color.back (r,g,b,a) back-confronting essential shading result.color.back.primary (r,g,b,a) back-confronting essential shading result.color.back.secondary (r,g,b,a) back-confronting optional shading result.fogcoord (f,*,*,*) mist coordinate result.pointsize (s,*,*,*) point size result.texcoord (s,t,r,q) composition coordinate, unit 0 result.texcoord[n] (s,t,r,q) surface direction, unit n ARB 1.0 documentation (yields == Write just??)

Slide 14

Vertex Programs What’s uncommon about the ARB 1.0 spec? Binds together coding for various stages (That’s their occupation!) Access to “tracked” OGL state (Materials, Matrices,…) Unifies vertex programs and cutting edge part programs

Slide 15

Vertex Programs ARB 1.0 proceeded with Position invariant vertex projects Use the altered capacity channel to change vertices despite everything you do the lighting Same change regardless of the fact that vertex system empowered Option set in VP content record KEY for multi-pass calculations!!!

Slide 16

Vertex Programs ARB 1.0 continued… Vender particular “enhancements” Access unique usefulness of chip Use “OPTION BLAH” at top of project content

Slide 17

Vertex Programs Other ARB 1.0 components Constant perusing, env, state, nearby Determines life time & redesign conduct Temporary associating (tmp1 = tmp2) Automatic steady administration, let driver manage consistent numbering!

Slide 18

Vertex Programs ARB 1.0 sample !!ARBvp1.0 # remark here ;) ATTRIB pos = vertex.position; #alias long names ATTRIB standard = vertex.normal; PARAM mv[4] = { state.matrix.modelview }; #alias PARAM mvit[4] = { state.matrix.modelview.invtrans }; TEMP tnorm; # temp for the changed ordinary DP4 result.position.x mv[0] pos; # vertex to clasp space DP4 result.position.y mv[1] pos; DP4 result.position.z mv[2] pos; DP4 result.position.w mv[3] pos; DP3 tnorm.x mvit[0] standard; # tranform the typical DP3 tnorm.y mvit[1] standard; # for lighting (later) DP3 tnorm.z mvit[2] standard; …

Slide 19

Vertex Programs Same illustration in Cg: struct appin : application2vertex { float4 pos : POSITION; float4 Norm : NORMAL; }; struct vertout : vertex2fragment { float4 HPos : POSITION; float4 PCol : COLOR0; }; vertout main(appin IN) { vertout out; out.Hpos = mul(glstate.matrix.mvp, IN.pos);/note cast to float3 for the normal!!!! float3 tnorm = mul(glstate.matrix.invtrans.modelview[0],(float3)IN.norm); … return out; }

Slide 20

Vertex Programs Next era (nv2.0, ati ?, ARB2.0?) 256 guidelines 256 constants 12 temps ? Circles Subroutines Conditional fanning 4 location registers 6 cuts & 8 compositions 16 data vectors 256 static vectors 12 temp vectors Loops 22 yield vectors Post T&L store

Slide 21

Vertex Programs N

View more...