Opengl 4.4 scene rendering techniques11/14/2022 With the increasing sophistication of computer graphics since the 1970s onward, it has become a more distinct subject. In the 'graphics pipeline' it's the last major step, giving the final appearance to the models and animation. It is one of the major sub-topics of 3D computer graphics, and in practice always connected to the others. 'Rendering' is also used to describe the process of calculating effects in a video editing file to produce final video output. The term may be by analogy with an "artist's rendering" of a scene. The image is a digital image or raster graphics image. It would contain geometry, viewpoint, texture lighting information. The model is a description of three dimensional objects in a strictly defined language or data structure. kd Il (N L), if N L 0Il ,diff 0.0, if N L 0NL Psource Psurf To light cos=NL L sourcePsource Psurf Diffuse reflections from a spherical surface Point light source color = white Diffuse reflectivity coefficient : 0 4% of the incident light on aglass surface-and most of the range-> R = (2NL) N - L 54 55.Rendering is the process of generating an image from a model, by means of a software program. Depth-Buffer Algorithm Initialize the depth buffer and framebuffer so that for all buffer positions (x,y)depthBuff (x,y) = 1.0, frameBuff (x,y) = backgndColor Process each polygon in a scene, one at atime For each projected (x,y) pixel position of apolygon, calculate the depth z (if not allreadyknown) If z = 0, Il,diffuse=kdIlcos0.0, light source is behind the surface 46 47. Possible data type to hold face data Class face Ch13: Computer Graphics 2th, F. OpenGL and Concave Polygons A tessellator object in the GLUlibrary can tessellate a given polygoninto flat convex polygons Draw a simple polygon without holes basic idea is to describe a contourmytess = gluNewTess() //includegluTessProperty()gluTessBeginPolygon(mytess, NULL) //send them off to be renderedgluTessBeginContour(mytess) // draw contour (outside)for(i=0 i far (x,y) xvDepthvalue=0.0-> nearzv 12. Back-face detection (object-space) Simplify the back-face test (right-hand) N is a polygon surfaces normal vector Vview is a viewing direction vector fromour camera position plane: Ax By Cz D 0 Our monitor: xv N=(A,B,C) zv Vview N=(A,B,C)yv Vview Back face: VviewN > 0 If plane Vview // zv axis,C0 C > 0, hidden surface C0 Concave surface: Like to combine two convex objectsOne face is be partially hidden byother faces of the object 8. Polygons vertices & plane plane: Ax By Cz D 0 Using three points resolve aplane (x1,y1,z1) NPlaneany plane function: Ax By Cz D 0 (x ,y ,z ) 2 2 2 (x3,圓,z3) Each intercept between the plane and the axis x-axis: A/D, y-axis: B/D, z-axis: C/D (A / D)xk (B / D)y k (C / D)zk 1 k=1,2,3 ,Cramers rule:1 y1 z1 x1 1 z1x1 y1 1A 1 y 2 z2 B x2 1 z2 C x2 y 2 11 圓 z3 x3 1 z3 x3圓 1x1 y1 z1D x2 y2 z2x3 圓 z3 6. Object- & Image-space The major differences is in the basicapproaches about the various visible-surface detection algorithms Sorting method Based on facilitate depth (interval distance)which used to divide surfaces in a scene Coherence method Using the regularities in a scene 5. Visible-surface detection How to describe the surface? Object-space Compare objects or parts of objects in the scene We should label as visible Advantage: effectively locate visible surfaces in the same case Image-space Visibility is decided each pixel positions point (the closest to viewer) on the projection plane Most interface is only image-space 4. Visible-surface Visible-surface detection Polygons vertices & plane have somerelationship Back-face detection Back-face removals Concave Polygons Depth-Buffer method 3. Visible-surface detectionMethods + Illumination Models & surface-rendering modelsChen Jing-Fung () Assistant Research Fellow,Digital Media Center,National Taiwan Normal Universit圜h9: Computer Graphics with OpenGL 3th, Hearn BakerCh11-6: Computer Graphics with OpenGL 3th, Hearn BakerCh10: Computer Graphics with OpenGL 3th, Hearn BakerĢ.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |