simulating the physics of pool using renerman ● shaders and texture mapping ● spherical texture...
TRANSCRIPT
![Page 1: Simulating the Physics of Pool using RenerMan ● Shaders and Texture Mapping ● Spherical Texture Maps ● Rotating the Balls ● Lighting ● Physics Equations](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649e905503460f94b94ee1/html5/thumbnails/1.jpg)
Simulating the Physics of Pool using RenerMan
● Shaders and Texture Mapping● Spherical Texture Maps● Rotating the Balls● Lighting● Physics Equations● Functions Yet to Be Implemented
![Page 2: Simulating the Physics of Pool using RenerMan ● Shaders and Texture Mapping ● Spherical Texture Maps ● Rotating the Balls ● Lighting ● Physics Equations](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649e905503460f94b94ee1/html5/thumbnails/2.jpg)
Shaders and Texture Maps
● Shaders are a part of the rendering program that calculates the appearance of visible surfaces in the scene. In RenderMan, a written procedure is used as a shader.
● There are three types of shaders:– Light Shaders– Surface Shaders– Volume Shaders
![Page 3: Simulating the Physics of Pool using RenerMan ● Shaders and Texture Mapping ● Spherical Texture Maps ● Rotating the Balls ● Lighting ● Physics Equations](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649e905503460f94b94ee1/html5/thumbnails/3.jpg)
Light Shaders
● Light Source Shaders calculates the intensity and color of light sent by a light source to a point on a surface
● Basic light source shaders include:– ambient light– distant light– point light– spotlight
![Page 4: Simulating the Physics of Pool using RenerMan ● Shaders and Texture Mapping ● Spherical Texture Maps ● Rotating the Balls ● Lighting ● Physics Equations](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649e905503460f94b94ee1/html5/thumbnails/4.jpg)
Light Shaders (cont’d)
● Light Shaders used in project include:– ambient light– three point light
sources
![Page 5: Simulating the Physics of Pool using RenerMan ● Shaders and Texture Mapping ● Spherical Texture Maps ● Rotating the Balls ● Lighting ● Physics Equations](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649e905503460f94b94ee1/html5/thumbnails/5.jpg)
Surface Shaders
● A surface shader calculates the color of light reflecting from a point on a surface in a particular direction
● Basic Surface Shaders Include:– constant– matte– metal– plastic– texture map
![Page 6: Simulating the Physics of Pool using RenerMan ● Shaders and Texture Mapping ● Spherical Texture Maps ● Rotating the Balls ● Lighting ● Physics Equations](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649e905503460f94b94ee1/html5/thumbnails/6.jpg)
Surface Shaders (cont’d)
● Surface Shaders used in project include:– felt– wood– pool ball texture
map
![Page 7: Simulating the Physics of Pool using RenerMan ● Shaders and Texture Mapping ● Spherical Texture Maps ● Rotating the Balls ● Lighting ● Physics Equations](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649e905503460f94b94ee1/html5/thumbnails/7.jpg)
Spherical Texture Maps
● Applying texture maps to spheres is a special case
● When a texture is applied to a sphere, the texture will be stretched horizontally
![Page 8: Simulating the Physics of Pool using RenerMan ● Shaders and Texture Mapping ● Spherical Texture Maps ● Rotating the Balls ● Lighting ● Physics Equations](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649e905503460f94b94ee1/html5/thumbnails/8.jpg)
Spherical Texture Maps (cont’d)
● The original image has the size of 2h x h.
● Then scale the image’s x-axis by half
![Page 9: Simulating the Physics of Pool using RenerMan ● Shaders and Texture Mapping ● Spherical Texture Maps ● Rotating the Balls ● Lighting ● Physics Equations](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649e905503460f94b94ee1/html5/thumbnails/9.jpg)
Volume Shaders
● Volume Shaders calculates the color and intensity of light as it passes through a volume (a region of space).
● Volume Shaders include:– Fog– Jell-O
● I intend to use fog to simulate the smoky environment of a pool hall
![Page 10: Simulating the Physics of Pool using RenerMan ● Shaders and Texture Mapping ● Spherical Texture Maps ● Rotating the Balls ● Lighting ● Physics Equations](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649e905503460f94b94ee1/html5/thumbnails/10.jpg)
How Shaders All Come Together
● Draw Picture
![Page 11: Simulating the Physics of Pool using RenerMan ● Shaders and Texture Mapping ● Spherical Texture Maps ● Rotating the Balls ● Lighting ● Physics Equations](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649e905503460f94b94ee1/html5/thumbnails/11.jpg)
Physics Equations
● Most pool applications use the ninety degree rule to simulate the deflection of pool balls, even those that claim to simulate the actual physics of the game.
● Just because you used physics equations, does not mean you used the correct equations.
● The ninety degree rule holds true only in frictionless environments (air hockey, collisions in space, etc.)
![Page 12: Simulating the Physics of Pool using RenerMan ● Shaders and Texture Mapping ● Spherical Texture Maps ● Rotating the Balls ● Lighting ● Physics Equations](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649e905503460f94b94ee1/html5/thumbnails/12.jpg)
Physics (cont’d)Friction, and Deceleration
● Most people assume the friction between a billiard ball and the table is so small, friction can be ignored.
● This is not true, friction does exist on a pool table, causing an average deceleration of 0.21 m/s2.
● Since friction does exist, the ninety degree rule does NOT hold true for pool
![Page 13: Simulating the Physics of Pool using RenerMan ● Shaders and Texture Mapping ● Spherical Texture Maps ● Rotating the Balls ● Lighting ● Physics Equations](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649e905503460f94b94ee1/html5/thumbnails/13.jpg)
Physics (cont’d)Deflection
● The actual equations of deflection, in components, are:(where the subscripts o and c refer to the object ball and cue ball, respectively)
v xo V sin cos
v yo V cos2
v xc V sin cos
v yc V sin2
![Page 14: Simulating the Physics of Pool using RenerMan ● Shaders and Texture Mapping ● Spherical Texture Maps ● Rotating the Balls ● Lighting ● Physics Equations](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649e905503460f94b94ee1/html5/thumbnails/14.jpg)
Physics (cont’d)Angular Velocity
● To make the billiard balls roll correctly, the angular velocity is needed.
● The equation for angular velocity is:
wvr
![Page 15: Simulating the Physics of Pool using RenerMan ● Shaders and Texture Mapping ● Spherical Texture Maps ● Rotating the Balls ● Lighting ● Physics Equations](https://reader036.vdocuments.us/reader036/viewer/2022081603/56649e905503460f94b94ee1/html5/thumbnails/15.jpg)
Functions Yet to Be Implemented
● Smoky Environment● Motion Blur● Camera Motion● Pockets, and other pool accessories.● Ball deflection off of wall● Ball Falling In Pocket (maybe...)