Definitions Spectral Elements – data structures that contain information about data at points...

1
Definitions Spectral Elements data structures that contain information about data at points within each geometric entity. Finite elements only hold information at the vertices. Canonical and World Space – each element in world space maps to a position in canonical space, where calculations are done. An object in canonical coordinates lies within the unit cube. In this case, the Lagrange polynomial is calculated with points in canonical space. Quadrature Points – for an n th order solution, the n+2 positions along each axis at which the data values are known without evaluation. Texture Shader – a programmable part of the hardware that takes texture coordinates and maps them to colors on a texture map. Directly Rendering Spectral Elements using Texture Shaders Bernard Peng and Andrew Forsberg Brown University Overview We directly render high-order polynomials using Texture Shaders on modern graphics hardware such as nVidia’s GeForce3. Spectral elements are a high-order data structure used in simulation and are advantageous because, generally, fewer elements are needed than with other techniques such as finite elements for the same problem. OpenGL-based programs normally linearly interpolate colors across each polygon, so the detail within each face is lost. We present a new approach for directly rendering spectral elements using Texture Shaders. This interactive technique uses resources proportional to dimensions visualized and polynomial order resources required are independent of an object’s geometric complexity. Our Approach We present a method to directly render the surface of spectral elements by evaluating Lagrange polynomials using GeForce3 Hardware. A data value at a point in a spectral element can be evaluated using the following equation or its 2D or 3D form: However, since the GeForce hardware shaders have limited computational capability, the polynomials cannot be evaluated directly and instead we use pre-computed texture maps, a texture shader, and multi-pass rendering. Lagrange polynomial coefficients are pre- computed and stored in texture maps. At runtime, each pixel in a polygon is colored by the texture shader, which evaluates the dot product between the data values at the quadrature points and the Lagrange polynomial coefficients for those points. Since only 3 terms can be stored per pixel in each texture map, multiple texture maps must be used and additively blended together to compute the result of the Lagrange polynomial. OpenGL Implementation Overview Pre-Process -load data values -load pixel shader and texture shader -pre-compute Lagrange polynomial coefficient textures Render glEnable(GL_BLEND); glBlendEquation(GL_FUNC_ADD); glBlendFunc(GL_ONE, GL_ONE); For every point: glTexCoord0(canonical coordinates); glTexCoord1(all pressure values); glVertex(world coordinates); Texture Shader texture_2d(); dot_product_2d_1of2(tex0); dot_product_2d_2of2(tex0); Pixel Shader out.rgb = tex2 + col0; Detail of directly rendered spectral element (uses all 16 the data values given below) Sample Output Based on the following data values (from the highlighted element): 427 282 640 632 347 226 542 543 307 200 492 494 325 214 512 510 (tested on a 866 Mhz Pentium III w/ GeForce3 and 256MB RAM) Conclusion •We have developed a way to shade polygons with more detail across each face OpenGL instead of simply linearly interpolating between vertices, allowing us to directly render spectral elements. •This same method can be extended for rendering 1D and 3D data also, using 1D or 3D texture maps. Using 3D data, we could render arbitrary slicing planes through an element. •The real-time dot products allow us to change the data we pass it in real time, which is useful for animating multiple time steps, or changing the scale on the data to focus on a specific range of values. •We have maintained a correlation between each element and the polygon that represents it. Data positions for a 2 nd order Spectral Element Data positions for a Finite Element Detail of standard OpenGL rendered element (uses only the 4 corner data values) References Karniadakis, G.E. and Sherwin, S. J., "Spectral/hp Element Methods for CFD", Oxford University Press, 1999. H. Battke, D. Stalling, and H. Hege, Fast Line Integral Convolution for Arbitrary Surfaces in 3D, Visualization and Mathematics (H. Hege and K. Polthier, eds.), Springer, 1997, pp. 181--195. Resources Order Textures (Passes) Texture Memory (MB) 1 3 6 2 6 11 3 9 15 4 12 20 n (n+2) 2 /3 (n+2) 2 /3*256 2 *3*8 bytes Performance Order FPS (artery, 704 elements) FPS (coil, 3332 elements) 1 24.39 6.45 2 14.92 3.79 3 10.75 N/A 4 N/A N/A Not using this method 25.64 7.57

Transcript of Definitions Spectral Elements – data structures that contain information about data at points...

Page 1: Definitions Spectral Elements – data structures that contain information about data at points within each geometric entity. Finite elements only hold information.

Definitions

•Spectral Elements – data structures that contain information about data at points within each geometric entity. Finite elements only hold information at the vertices.

•Canonical and World Space – each element in world space maps to a position in canonical space, where calculations are done. An object in canonical coordinates lies within the unit cube. In this case, the Lagrange polynomial is calculated with points in canonical space.

•Quadrature Points – for an nth order solution, the n+2 positions along each axis at which the data values are known without evaluation.

•Texture Shader – a programmable part of the hardware that takes texture coordinates and maps them to colors on a texture map.

Directly Rendering Spectral Elements using Texture Shaders

Bernard Peng and Andrew ForsbergBrown University

Overview

We directly render high-order polynomials using Texture Shaders on modern graphics hardware such as nVidia’s GeForce3.

Spectral elements are a high-order data structure used in simulation and are advantageous because, generally, fewer elements are needed than with other techniques such as finite elements for the same problem. OpenGL-based programs normally linearly interpolate colors across each polygon, so the detail within each face is lost. We present a new approach for directly rendering spectral elements using Texture Shaders. This interactive technique uses resources proportional to dimensions visualized and polynomial order – resources required are independent of an object’s geometric complexity.

Our Approach

We present a method to directly render the surface of spectral elements by evaluating Lagrange polynomials using GeForce3 Hardware.

A data value at a point in a spectral element can be evaluated using the following equation or its 2D or 3D form:

However, since the GeForce hardware shaders have limited computational capability, the polynomials cannot be evaluated directly and instead we use pre-computed texture maps, a texture shader, and multi-pass rendering.

Lagrange polynomial coefficients are pre-computed and stored in texture maps. At runtime, each pixel in a polygon is colored by the texture shader, which evaluates the dot product between the data values at the quadrature points and the Lagrange polynomial coefficients for those points.

Since only 3 terms can be stored per pixel in each texture map, multiple texture maps must be used and additively blended together to compute the result of the Lagrange polynomial.

OpenGL Implementation Overview

•Pre-Process-load data values-load pixel shader and texture shader-pre-compute Lagrange polynomial coefficient textures

•RenderglEnable(GL_BLEND);glBlendEquation(GL_FUNC_ADD);glBlendFunc(GL_ONE, GL_ONE);

For every point:glTexCoord0(canonical coordinates);glTexCoord1(all pressure values);glVertex(world coordinates);

•Texture Shadertexture_2d();dot_product_2d_1of2(tex0);dot_product_2d_2of2(tex0);

•Pixel Shaderout.rgb = tex2 + col0;

Detail of directly rendered spectral element (uses all 16 the data values given below)

Sample OutputBased on the following data values (from the highlighted element):

427 282 640 632347 226 542 543307 200 492 494325 214 512 510

(tested on a 866 Mhz Pentium III w/ GeForce3 and 256MB RAM)

Conclusion

•We have developed a way to shade polygons with more detail across each face OpenGL instead of simply linearly interpolating between vertices, allowing us to directly render spectral elements.

•This same method can be extended for rendering 1D and 3D data also, using 1D or 3D texture maps. Using 3D data, we could render arbitrary slicing planes through an element.

•The real-time dot products allow us to change the data we pass it in real time, which is useful for animating multiple time steps, or changing the scale on the data to focus on a specific range of values.

•We have maintained a correlation between each element and the polygon that represents it.

Data positions for a 2nd order Spectral Element Data positions for a Finite Element

Detail of standard OpenGL rendered element(uses only the 4 corner data values)

References

Karniadakis, G.E. and Sherwin, S. J., "Spectral/hp Element Methods for CFD", Oxford University Press, 1999.

H. Battke, D. Stalling, and H. Hege, Fast Line Integral Convolution for Arbitrary Surfaces in 3D, Visualization and Mathematics (H. Hege and K. Polthier, eds.), Springer, 1997, pp. 181--195.

ResourcesOrder Textures (Passes) Texture Memory (MB)1 3 62 6 113 9 154 12 20n (n+2)2/3 (n+2)2/3*2562*3*8 bytes

PerformanceOrder FPS (artery, 704 elements) FPS (coil, 3332 elements)1 24.39 6.452 14.92 3.793 10.75 N/A4 N/A N/ANot using this method 25.64 7.57