So You Want to Write a Ray Tracer Checkpoint 4 – Procedural Shading Ray Tracing Assignment Goal is to reproduce the following Whitted, 1980 1
Ray Tracing Assignment Seven checkpoints Setting the Scene Camera Modeling Basic Shading Procedural Shading Recursive Ray Tracing – Reflection Recursive Ray Tracing – Transmission Tone Reproduction Ray Tracing Assignment Seven checkpoints Setting the Scene Camera Modeling Basic Shading Procedural Shading Recursive Ray Tracing – Reflection Recursive Ray Tracing – Transmission Tone Reproduction 2
Procedural Shading Use procedural texture to create a checkerboard floor On floor intersection Rather than using Phong model Compute color based on checkerboard Texture Mapping Convert to Just return Will need Red or yellow (u,v) based color (if not point of based on on floor specs in shadow) or intersection which check supply as in object / diffuse / world space ambient color in Phong 3
Texture Mapping At intersection point of floor Must obtain the “texture coordinates” to map to u,v on texture. Use these u,v, values as a means to determine color. Procedural Shading x / u “origin” of floor Point of y / v intersection Checksize 4
Procedural Shading Algorithm Given text coordinates (u,v) for point of intersection Find row and col in which intersection point lies Row Col color Even Even Red Even Odd Yellow Odd Even Yellow Odd Odd Red Extra, Extra For 5 points each Implement another procedural shader or texture (your choice) Implement texture map from image. 5
Object oriented hints Procedual Shading Due date: Must be posted to Web site by Monday, January 21 Recall: 10% penalty per day Having trouble? Let me know EARLY. Questions? 6
Recommend
More recommend