Simulating the Physics of Pool using RenerMan ● Shaders and Texture Mapping ● Spherical Texture...

Preview:

Citation preview

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

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

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

Light Shaders (cont’d)

● Light Shaders used in project include:– ambient light– three point light

sources

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

Surface Shaders (cont’d)

● Surface Shaders used in project include:– felt– wood– pool ball texture

map

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

Spherical Texture Maps (cont’d)

● The original image has the size of 2h x h.

● Then scale the image’s x-axis by half

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

How Shaders All Come Together

● Draw Picture

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.)

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

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

Physics (cont’d)Angular Velocity

● To make the billiard balls roll correctly, the angular velocity is needed.

● The equation for angular velocity is:

wvr

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...)

Recommended