Advanced Lighting casting shadows where the sun never shines!

Similar documents
light light light B E

Problem Set 4 Part 1 CMSC 427 Distributed: Thursday, November 1, 2007 Due: Tuesday, November 20, 2007

Chapter 6- Lighting and Cameras

Shadows. COMP 575/770 Spring 2013

Appendix B RenderMan Quick Reference

lecture 18 - ray tracing - environment mapping - refraction

Advanced Distant Light for DAZ Studio

Lecture 12: Advanced Rendering

Global Rendering. Ingela Nyström 1. Effects needed for realism. The Rendering Equation. Local vs global rendering. Light-material interaction

Topics and things to know about them:

Chapter 17: The Truth about Normals

3D Programming. 3D Programming Concepts. Outline. 3D Concepts. 3D Concepts -- Coordinate Systems. 3D Concepts Displaying 3D Models

Lighting & 3D Graphics. Images from 3D Creative Magazine

Shadows in the graphics pipeline

For Intuition about Scene Lighting. Today. Limitations of Planar Shadows. Cast Shadows on Planar Surfaces. Shadow/View Duality.

Computer Graphics. Lecture 13. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura

Chapter 1. Introduction Marc Olano

COMP 4801 Final Year Project. Ray Tracing for Computer Graphics. Final Project Report FYP Runjing Liu. Advised by. Dr. L.Y.

REYES REYES REYES. Goals of REYES. REYES Design Principles

CS451Real-time Rendering Pipeline

Last Time. Why are Shadows Important? Today. Graphics Pipeline. Clipping. Rasterization. Why are Shadows Important?

Lecture 17: Recursive Ray Tracing. Where is the way where light dwelleth? Job 38:19

CHAPTER 1 Graphics Systems and Models 3

Last Time. Reading for Today: Graphics Pipeline. Clipping. Rasterization

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Texture Mapping. Images from 3D Creative Magazine

CMSC427: Computer Graphics Lecture Notes Last update: November 21, 2014

Computer Graphics with OpenGL ES (J. Han) Chapter VII Rasterizer

Computer Graphics. Lecture 10. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura 12/03/15

SAMPLING AND NOISE. Increasing the number of samples per pixel gives an anti-aliased image which better represents the actual scene.

CS 4620 Midterm, March 21, 2017

521493S Computer Graphics. Exercise 3

An Introduction to Maya. Maya. Used in industrial design, CAD, computer games and motion picture effects. The ambition is what get

Graphics for VEs. Ruth Aylett

The University of Calgary

Scalable multi-gpu cloud raytracing with OpenGL

Rendering and Radiosity. Introduction to Design Media Lecture 4 John Lee

Deferred Rendering Due: Wednesday November 15 at 10pm

Real-Time Shadows. André Offringa Timo Laman

Rendering & Compositing

REU Modeling Course Day 1 pt2 AutoDesk Maya - More Modeling

CS 184: Assignment 4 Simple Raytracer

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

Lecture 18: Primer on Ray Tracing Techniques

Assignment 6: Ray Tracing

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic.

Chapter 7 - Light, Materials, Appearance

Render methods, Compositing, Post-process and NPR in NX Render

The Wireframe Update Buttons. The Frontface and Backface Buttons. The Project Designer 265

BCC Sphere Transition

MITOCW MIT6_172_F10_lec18_300k-mp4

CS Simple Raytracer for students new to Rendering

Rasterization Overview

Computer Graphics. Shadows

CS 488. More Shading and Illumination. Luc RENAMBOT

Shadow Rendering EDA101 Advanced Shading and Rendering

X 2 -Toon: An Extended X-Toon Shader

Other approaches to obtaining 3D structure

Chapter 11. Caustics and Global Illumination

Course Information Package

Ray Tracing. Foley & Van Dam, Chapters 15 and 16

CS 563 Advanced Topics in Computer Graphics Camera Models. by Kevin Kardian

Ray Tracing Foley & Van Dam, Chapters 15 and 16

Dynamic Ambient Occlusion and Indirect Lighting. Michael Bunnell NVIDIA Corporation

Introduction Ray tracing basics Advanced topics (shading) Advanced topics (geometry) Graphics 2010/2011, 4th quarter. Lecture 11: Ray tracing

Pipeline Operations. CS 4620 Lecture 10

CS 465 Program 5: Ray II

Advanced Shading I: Shadow Rasterization Techniques

Homework #2. Hidden Surfaces, Projections, Shading and Texture, Ray Tracing, and Parametric Curves

Advanced Lighting Techniques Due: Monday November 2 at 10pm

Think about film & lighting

Movie: For The Birds. Announcements. Ray Tracing 1. Programming 2 Recap. Programming 3 Info Test data for part 1 (Lines) is available

CGI and Pixar. In my opinion, one of the most fascinating applications of computer graphics

Ray Tracing. CPSC 453 Fall 2018 Sonny Chan

Ambien Occlusion. Lighting: Ambient Light Sources. Lighting: Ambient Light Sources. Summary

STARTING COMPOSITING PROJECT

Building a Fast Ray Tracer

Edge Detection. Whitepaper

Rendering Synthetic Objects into Real Scenes. based on [Debevec98]

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

3ds Max certification prep

Screen Space Ambient Occlusion. Daniel Kvarfordt & Benjamin Lillandt

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL

Shadow Techniques. Sim Dietrich NVIDIA Corporation

GUERRILLA DEVELOP CONFERENCE JULY 07 BRIGHTON

Draw Guide. Chapter 7 Working with 3D Objects

Volume Rendering. Computer Animation and Visualisation Lecture 9. Taku Komura. Institute for Perception, Action & Behaviour School of Informatics

Recursive Ray Tracing. Ron Goldman Department of Computer Science Rice University

Shading I Computer Graphics I, Fall 2008

Shadow Algorithms. CSE 781 Winter Han-Wei Shen

Ray Tracing Part 1. CSC418/2504 Introduction to Computer Graphics. TA: Muhammed Anwar & Kevin Gibson

CS 4620 Program 4: Ray II

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Computer graphics Labs: Blender (1/3) Modelling, transparency and reflection

Ray Tracer Due date: April 27, 2011

Computer Graphics 1. Chapter 7 (June 17th, 2010, 2-4pm): Shading and rendering. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2010

Guide Contents Introduction Useful Information Navigating the Scene Hotkeys Placing and Manipulating Objects The Builder Cube Builder Cube Edit

Radiance. Pixels measure radiance. This pixel Measures radiance along this ray

Computer Graphics Tick 1

Transcription:

Advanced Lighting casting shadows where the sun never shines! Overview Shadows in real life are normally considered to be an integral part of scene a natural outcome of the interplay of light and objects. In 3D graphics, however, a shadow is treated as if it were an additional element. Infact, shadow casting is an extra facility that must be explicitly turned on. When lit by one of the basic light sources, objects are shaded according to the orientation and optical characteristics of their surfaces. But basic light sources are unable to cast shadows of objects onto other objects. With the exception of an ambientlight, each of the basic light sources has a counter-part that allows shadow casting to occur. For example, instead of using a basic distant light in a scene, such as LightSource "distant" 1 "from" [3 3 3] "to" [0 0 0] its shadow casting equivalent could be used ie. LightSource "shadowdistant" 1 "from" [3 3 3] "to" [0 0 0] "shadowname" "shadow1.tx" For a complete description of the shadowdistant and other shadow casting light sources refer to Appendix C Shader Reference, pages 12 to 14. Shadow casting is not an automatic attribute of every light source because the renderer is required to perform additional calculations in order to determine the location and interaction of the shadows. This makes the rendering process slow and, in some situations, it is not always necessary to have shadows. Unlike the technique known as ray-tracing, in which the shadows are created along with every other part of an image, RenderMan s so-called scan-line renderer calculates the contribution that each shadow casting light source will make to the final image BEFORE it is rendered. This method of creating shadows is more efficient than ray-tracing if, for example, over part of an animation the lights and objects in a scene remain in a fixed relationship to each other. During such periods of static lighting the renderer need only perform the lengthy shadow calculations on the first frame, there after it can apply the pre-calculated shadow information to all subsequent frames relatively quickly. Pre-processing the shadows before making the final image also offers more creative control. For example, the renderer can be forced to use the wrong shadow information. In this way light sources can be made to cast shadows around corners, or an object can cast the shadow of an entirely different object. Such manipulations are beyond the capabilities of most ray-tracers. Advanced Lighting 9 1

For each light source that will create a shadow(s) in a scene, RenderMan requires a special image to be generated from the view-point of the light source. However, these special output files do not contain images as such, but store information about how far away each part of the scene is from the light source. The following example is a very simple scene lit by a single (shadowing) distant light. z y x LightSource shadowdistant" "intensity" 1.5 "from" [0 0 4] "to" [0 0 0] "shadowname" "shadow.tx" step 1 The first step in creating shadows is the production of a depth map for each (shadow) light source. Because the output file from this step only contains depth information it is unnecessary, when defining the scene from the view point of a light, to specify the colour or surface properties of the objects themselves, for example, FrameBegin 1 Format 128 128 1 Translate 0 0 4 # equivalent to moving the view-point 4 Rotate 180 0 1 0 # units directly above the origin of the scene Notice how this first step is contained within its own frame block. This isolates it from remainder of the RIB script that produces the final full coloured rendered image. Advanced Lighting 9 2

step 1 continued The first frame produces two files, namely, depth.pic and shadow.tx. The display statement that produces depth.pic uses two new parameters, The inclusion of the letter z indicates to the renderer that it is to produce a depth map rather than a normal full colour image. Step 1 is concluded with the production of a texture file from the depth map, step 2 In the second step the texture file(s) produced in step 1 is (are) used by the appropiate light source(s) to calculate the correct lighting values for each part of the scene, for example, FrameBegin 2 Display "half ball.tiff" "tiff" "rgba" Format 400 300 1 Projection "perspective" "fov" 40 Translate 0 1 8 Rotate -120 1 0 0 Rotate 25 0 0 1 LightSource "shadowdistant" 1 "intensity" 1.5 "from" [0 0 4] "to" [0 0 0] "shadowname" "shadow.tx" Surface "matte" There are several points to be noted in this example. Strictly speaking the RIB script, for the sake of simplicity, has produced an incorrect shadow! Distant light sources behave much like the sun they produce shadows with parallel light. In the first frame the depth map was made using perspective projection with a field of view large enough to see the entire scene. Without this simplification it would have been necessary to use orthographic projection and to scale the scene in order for it to fit into a viewing space 1 unit by 1 unit the dimensions of an orthographic viewing frame. Alternatively, if the shadow version of a pointlight had been used instead of a shadowdistant it would have been necessary to produce 6 depth maps each one corresponding to the 6 directions a point light source can radiate light ie. top, bottom, left, right, front and back! The important point is that although the final image is technically incorrect it is still CONVINCING. Advanced Lighting 9 3

Example 1 complete script RIB script # Experiments with single shadows ObjectBegin 1 Sphere 1 0 1 360 ObjectEnd ObjectBegin 2 Polygon "P" [-3 3-1 -3-3 -1 3-3 -1 3 3-1 ] ObjectEnd FrameBegin 1 Format 128 128 1 Translate 0 0 4 Rotate 180 0 1 0 FrameBegin 2 Display "half ball.tiff" "tiff" "rgba" Format 400 300 1 Projection "perspective" "fov" 40 Translate 0 1 8 Rotate -120 1 0 0 Rotate 25 0 0 1 LightSource "shadowdistant" 1 "intensity" 1.5 "from" [0 0 4] "to" [0 0 0] "shadowname" "shadow.tx" Surface "matte" Advanced Lighting 9 4

The Shadow Algorithm how it works When using a light source that creates shadows the renderer determines if a point in a 3D scene lies within a shadow cast by another object by comparing two distances. Firstly, it calculates the true distance from the point to the light source and then it compares this value to the corresponding distance in the texture file that was produced from a depth map. If the true distance is the larger of the two then the screen pixel corresponding to the 3D point is shaded a dark colour appropriate to a shadow. Alternatively, if the true distance is smaller then the screen pixel is assigned the colour and brightness of the corresponding 3D point on the surface of the object casting the shadow. light source true distance from the light source to the point distance as seen from the light source depth map The true distance is the greater, therefore, point is in shadow. Both distances are the same, therefore, point is not in shadow. Advanced Lighting 9 5