Presentation is loading. Please wait.

Presentation is loading. Please wait.

Status – Week 231 Victor Moya. Summary Primitive Assembly Primitive Assembly Clipping triangle rejection. Clipping triangle rejection. Rasterization.

Similar presentations


Presentation on theme: "Status – Week 231 Victor Moya. Summary Primitive Assembly Primitive Assembly Clipping triangle rejection. Clipping triangle rejection. Rasterization."— Presentation transcript:

1 Status – Week 231 Victor Moya

2 Summary Primitive Assembly Primitive Assembly Clipping triangle rejection. Clipping triangle rejection. Rasterization. Rasterization. Triangle Setup. Triangle Setup. Early Z. Early Z. Current status. Current status.

3 Primitive Assembly Works as a LRU cache. Works as a LRU cache. Asks the Post T&L cache for missing vertex. Asks the Post T&L cache for missing vertex. Checks if some of the new vertex are already in the primitive assembly cache. Checks if some of the new vertex are already in the primitive assembly cache. Three vertex stored (2 for triangles, 3 for quads). Three vertex stored (2 for triangles, 3 for quads). Last vertex is always bypassed directly to Triangle Setup. Last vertex is always bypassed directly to Triangle Setup.

4 Clipping Check clipping per vertex. Check clipping per vertex. Use Cohen & Sutherland method. Use Cohen & Sutherland method. Reject full triangles. Reject full triangles. Do not generate new triangles. Do not generate new triangles.

5 Cohen & Sutherland Clipping Cohen & Sutherland: 6 bit outcode. Cohen & Sutherland: 6 bit outcode. if all three vertex have 000000 outcodes if all three vertex have 000000 outcodes the triangle is inside the fustrum volume. the triangle is inside the fustrum volume. if the logical and of the three vertex outcodes is 0 if the logical and of the three vertex outcodes is 0 the triangle intersects the fustrum volume. the triangle intersects the fustrum volume. if the logical and of the three vertex outcodes is not 0 if the logical and of the three vertex outcodes is not 0 the triangle is outside the fustrum volume. the triangle is outside the fustrum volume.

6 Sutherland & Cohen 010100011001 000010000100 011000101010

7 Clipper Streamer Commit Clipper Primitive Assembly transformed vertices assembled triangles clipped triangles

8 Clipping Alternatives: Alternatives: Full clipping: Full clipping: Sutherland – Hodgeman: Sutherland – Hodgeman: –Clip the triangle against each clip plane in an iterative way. Other algorithms similar to previous. Other algorithms similar to previous. Generates new triangles. Generates new triangles. No clipping: No clipping: Guad band and scissoring for left, right, bottom and top clipping. Guad band and scissoring for left, right, bottom and top clipping. 2DH rasterization (Olano) for w < 0 clipping. 2DH rasterization (Olano) for w < 0 clipping. More hardware needed in rasterizer. More hardware needed in rasterizer. Possible fillrate lose. Possible fillrate lose.

9 Rasterization Clipper Triangle Setup TraversalInterpolation Rasterizer Emulator Setup(vattrib[3])nextFragment()Interpolate(fr)

10 Rasterization Traversal algorithm has been reimplemented: Traversal algorithm has been reimplemented: did not work for small thin triangles :P. did not work for small thin triangles :P. Adjoint matrix (setup matrix) and edge equation math moved all to 64-bit FP Adjoint matrix (setup matrix) and edge equation math moved all to 64-bit FP there was a precission problem. there was a precission problem. There is still some problem with edges with 0 and 1 slope (vertical and horizontal edges). There is still some problem with edges with 0 and 1 slope (vertical and horizontal edges). Added screen ‘scissoring’ to the traversal algorithm Added screen ‘scissoring’ to the traversal algorithm Add a bottom bound line traversal ending condition. Add a bottom bound line traversal ending condition.

11 Rasterization Current traversal algorithm: Current traversal algorithm: Select top most vertex. Select top most vertex. Divide by w (project) and map to viewport top most vertex. Divide by w (project) and map to viewport top most vertex. Start traversal moving left and checking right and down. Start traversal moving left and checking right and down. Move to left until outside of the triangle. Move to left until outside of the triangle. Move to right if right save available. Move to right if right save available. Move to right until outside of the triangle. Move to right until outside of the triangle. Move to down if down save available. Move to down if down save available. Repeat. Repeat.

12 Rasterization Traversal algorithm: Traversal algorithm: Ending condition: next pixel outside or below the bottom bound line. Ending condition: next pixel outside or below the bottom bound line. Special case for thin triangles: Special case for thin triangles: Cross from negative to positive through the ‘vertical’ edges. Cross from negative to positive through the ‘vertical’ edges. Keep going until the bottom bound line. Keep going until the bottom bound line.

13 Rasterization scanned generated inside generated outside

14 Rasterizer Problems: Problems: Algorithm needs start point. Algorithm needs start point. Unclipped triangles. Unclipped triangles. Top most vertex can be: Top most vertex can be: far outside of the fustrum volume far outside of the fustrum volume –Many cycles required to travel to inside. behind the eye: behind the eye: –triangle is inverted. Top most vertex must be projected and mapped to the viewport. Top most vertex must be projected and mapped to the viewport. Others? Others?

15 Rasterizer Alternatives: Alternatives: Implement projection (divide by w) and use a normal rasterization algorithm (no 2DH). Implement projection (divide by w) and use a normal rasterization algorithm (no 2DH). Use iterative hierarchical approaches (McCool): Use iterative hierarchical approaches (McCool): May spend many cycles until first fragment is generated. May spend many cycles until first fragment is generated. Find a way of creating a bounding box for the triangle without projection, clipping or viewport mapping? Find a way of creating a bounding box for the triangle without projection, clipping or viewport mapping?

16 Problems Current implementation must count number of passing triangles in each box to detect end of batch. Current implementation must count number of passing triangles in each box to detect end of batch. ‘Empty’ culled (either in primitive assembly, clipper or triangle setup) triangles must be passed down to FragmentFIFO. ‘Empty’ culled (either in primitive assembly, clipper or triangle setup) triangles must be passed down to FragmentFIFO. This produces wastes cycles traversal, interpolation and fragment FIFO. This produces wastes cycles traversal, interpolation and fragment FIFO. Other solutions? Other solutions?

17 Synchronization Ready signals vs Request signals. Ready signals vs Request signals. Ready/Busy signals needs at least a buffer (for the incoming data) with the size of the signal latency in the sender. Ready/Busy signals needs at least a buffer (for the incoming data) with the size of the signal latency in the sender. This buffer could remain empty most of the time. This buffer could remain empty most of the time. Request signals require a counter (displacement counter?) in the reciever. Request signals require a counter (displacement counter?) in the reciever. The counter could be updated more than once per cycle (mutiple requests, multiple request serviced). The counter could be updated more than once per cycle (mutiple requests, multiple request serviced).

18 Synchronization data data signal write ready signal write data signal read ready signal read cycle n + 2 ready data busy no buffer available so data is lost cycle n + 1cycle n

19 Synchronization Alternatives: Alternatives: Start latencies of the consumer box are fixed and/or known by the producer box. Start latencies of the consumer box are fixed and/or known by the producer box.

20 Next steps Add the clipper box for trivial reject/accept of triangles against the fustrum volume. Add the clipper box for trivial reject/accept of triangles against the fustrum volume. Add the configuration options and file that was discussed months ago (signals, latencies, etc). Add the configuration options and file that was discussed months ago (signals, latencies, etc). Add new boxes: early Z, pixel shader, texture units, etc. Add new boxes: early Z, pixel shader, texture units, etc. Implement a more decent Memory Controller. Implement a more decent Memory Controller.

21 Early Z Could be implemented before interpolation. Could be implemented before interpolation. Interpolate the triangle Z (z/w) first. Interpolate the triangle Z (z/w) first. Could save some calculations. Could save some calculations. Would save time? Would save time? Implement hierarchical Z: multilevel z buffer internal/external memory. Implement hierarchical Z: multilevel z buffer internal/external memory. Must be disabled if pixel shaders write z. Must be disabled if pixel shaders write z.

22 Pixel Shader Add new math instructions to Shader emulator. Add new math instructions to Shader emulator. Add texture instructions to the Shader emulator. Add texture instructions to the Shader emulator. Design a megathreaded shader (maybe up to 100s of fragments on fly). Design a megathreaded shader (maybe up to 100s of fragments on fly). Design communication with the texture unit. Design communication with the texture unit.

23 Texture Unit Design texture unit. Design texture unit. Create a texture emulator. Create a texture emulator. Texture storage in memory? Texture storage in memory? Texture compression? Texture compression? Texture cache? Texture cache? Filtering methods: Filtering methods: Bilinear. Bilinear. Trilinear. Trilinear. Anisotropic. Anisotropic.

24 Memory Controller GDDR3? GDDR3? Need to read the current memory specifications. Need to read the current memory specifications. Banks, access methods, bus widths... Banks, access methods, bus widths... Memory buses to the GPU units? Memory buses to the GPU units? Priority, policies? Priority, policies?


Download ppt "Status – Week 231 Victor Moya. Summary Primitive Assembly Primitive Assembly Clipping triangle rejection. Clipping triangle rejection. Rasterization."

Similar presentations


Ads by Google