280 likes | 433 Views
Lighting models & optimization. Pavel Zemčík Department of Computer Science and Engineering, Faculty of Electrical Engineering and Computer Science, Technical Univeristy of Brno, Czech Republic zemcik@dcse.fee.vutbr.cz. What are lighting models?.
E N D
Lighting models& optimization Pavel Zemčík Department of Computer Science and Engineering, Faculty of Electrical Engineering and Computer Science, Technical Univeristy of Brno, Czech Republic zemcik@dcse.fee.vutbr.cz
What are lighting models? • Lighting models are models of light behaviour on the objects’ surface • Global models • Local models • Behaviour at the edges
Global models • Generally used in radiation methods • Physics laws (preservs model’s energy) • Simple light propagation (form factors)
Local models • Approximate light propagation locally • Not necessarily physics based • Measurement based (empirical) • Often just a ‘good looking’ guess
Phong model equations • General • Details (note that Ib is constant)
Phong model parameters-n • The image showsthe effect of nn= 15 7 3 1
Phong model parameters-kd,kr • The image showsthe effect of kd,krkd,kr = 0.3,0.6 0.5,0.4 0.7,0.2 0.9,0
Surface texture • The image wasrendered usingPhong model withsuperimposedtexture modifyingthe coefficients
Normal vector texture • The image wasrendered usingPhong model withsuperimposedtexture modifyingthe normal vector
Mirror model equations • General • Details (reflection direction)
Glass model equations • Direction • Energy distribution approximation
Other lighting models • Torrance-Sparrow (rough surfaces) • Blinn, Strauss (half-transparent objects) • Metals (fluorescent effects) • etc.
Optimisation of ray tracing Three general approaches • Reduction of number of evaluated pixels • Bounding volumes • Space subdivision
Reduction of number of pixels Mostly using adaptive subsampling • naive would be • 40x30 • optimised 5x5 • 16x12+10x21 • 402/1200-66%
Bounding volumes Bounding volume must bound all the real objects but be as small as possible • complex • done manually • speedup >10
Space subdivision Scene is divided into several smaller units that are evaluated separately • simple principle • automatic butquite high cost • speedup >10
Referenecs (in addition to the previous lecture) • Bronsvoort W F: Techniques for Reducing Boolean Evaluation Time in CSG scan-line algorithms, Computer-aided Design, vol. 18, no. 10, 1986, Great Britain, pp. 533-536 • Fujimoto A, Tanaka T, Iwata K: ARTS Accelerated Ray Tracing System, IEEE Computer Graphics & Applications, April 1986, USA, pp. 16-26 • Glassner A S: Efficient Boolean Evaluation of CSG Models for Ray Tracing, The Ray Tracing News, vol. 1, no. 1, September 1987, USA, pp. 3-7 • Strauss P S: A Realistic Model for Computer Animators, IEEE Computer Graphics & Applications, November 1990, USA, pp. 56-64