430 likes | 698 Views
Realistic Rendering. Pavel Zemčík Department of Computer Science and Engineering, Faculty of Electrical Engineering and Computer Science, Technical University of Brno, Czech Republic zemcik@dcse.fee.vutbr.cz. What is realistic rendering?.
E N D
Realistic Rendering Pavel Zemčík Department of Computer Science and Engineering, Faculty of Electrical Engineering and Computer Science, Technical University of Brno, Czech Republic zemcik@dcse.fee.vutbr.cz
What is realistic rendering? • Realistic (photo-realistic) rendering is the process of production of photograph-like images from a 3D model • Measure of “realism” is human • Affected by wide range of factors
The realistic rendering needs • Models of objects, environment, and light • Light features (particle and wave effects) • Fine structure of objects’ surface • The material features (e.g. for glass)
Is realistic rendering possible? NO!!! True realism is not possible • Accurate models not available • Light features impossible to model • Any close approximation very demanding • Very rough approximations used
Rough realistic rendering The approximations usually assume • empty space between objects • no particle or wave light effects • simple scene geometry and lights • simple materials and surfaces
Constructive Solid Geometry • Constructive Solid Geometry (CSG) is a method for representing the 3D objects • tree structure (binary or n-ary) • primitive objects in the leaves • CSG (set) operations in other nodes
CSG operations • CSG operations are generally set operations on 3D objects’ volumes • unary operation (not) • binary operations (intersection, and) (union, or) \ (difference) • operations can be extended to n-ary
CSG surface exclusion • CSG objects sometimes do not include the surface (for mathematical purity) • In such case, e.g. CSG union can be defined as:
Rendering methods - objects • The objects are processed in a sequence • No objects interaction - no shadows
Rendering methods - pixels • The pixels are processed in a sequence • No global interaction - no half-shadows
Rendering methods - scene • The complete scene is processed • Very complex - no sharp shadows
Radiosity principle • Get form factors • Assign lights • Solve equation • Render usinga pixel method
Ray tracing principle • The image is created by evaluation of content of each of the picture elements Durer A.: The Art of Measurement, Volume IV, The Netherlands, 1538
Ray tracing algorithm For each pixel • send a ray eye pixel scene • calculate what can be seen • calculate the value of the pixel - • if necessary, proceed recursively
Ray tracing - secondary rays • Secondary rays are necessary for evaluation of shadows and mirrors
Sending a ray • Simple task, involves 3D projective transformation
Geometry - what can be seen • Very complex task, in naive approach it involves calculation of intersection of the ray with all objects in the scene • (intersection often involves quadratic equation solution, or similar task) Estimated complexity: (P+S)*N e.g. (256x256+3*256x256)*1024=256M
Calculation of pixel value • Depends on the local light model • Basic models include e.g. • flat model • diffusion • Phong model • mirror
Geometry - sphere equations • Definition • Intersection (note that |d|=1) • or • Normal vector
Geometry - halfspace equations • Definition (note that p·n is constant) • Intersection • Normal vector (already in definition)
Geometry - cylinder equations • Definition • Intersection (substitution l=s-p, |d|=1) • Normal vector (intersection reused)
Geometry - Quadric equations • Definition • Intersection (d’, s’ are d, s in 4D) • Normal
Geometry - CSG algorithm • Shoot a ray & Convert sets to intervals • Apply CSG operations to intervals • or Convert to simpler list operations • Get the “real” intersection
References • Gouraud H: Continouous Shading of Curved Surfaces, IEEE Transactions on Computer Graphics, n. 6, vol. C-20, june 1971, USA, pp. 623-629 • Foley J D, Van Dam A: Fundamentals of Interactive Computer Graphics, Addison-Wesley 1983, USA • Goral C M, Torrance K E, Greenberg D P, Battaile B: Modelling The Interaction of Light Between Diffuse Surfaces, sborník SIGGRAPH '84, ACM Computer Graphics, USA, 1984 • Watt A, Watt M: Advanced Animation and Rendering Techniques, Addison-Wesley 1992, USA, str. 33-64