33
Michael Haller Christian Hanl Jeremiah Diephuis Upper Austria University of Applied Sciences, Media Technology and Design, Hagenberg (ACM Computers in Entertainment, 2004) Non-Photorealistic Rendering Techniques for Motion in Computer Games

Non-Photorealistic Rendering Techniques for Motion in Computer Games

  • Upload
    carson

  • View
    54

  • Download
    0

Embed Size (px)

DESCRIPTION

Non-Photorealistic Rendering Techniques for Motion in Computer Games. Michael Haller Christian Hanl Jeremiah Diephuis Upper Austria University of Applied Sciences, Media Technology and Design, Hagenberg (ACM Computers in Entertainment, 2004). Introduction. - PowerPoint PPT Presentation

Citation preview

Page 1: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Michael HallerChristian Hanl

Jeremiah Diephuis

Upper Austria University of Applied Sciences,

Media Technology and Design, Hagenberg

(ACM Computers in Entertainment, 2004)

Non-Photorealistic Rendering Techniques

for Motion in Computer Games

Non-Photorealistic Rendering Techniques

for Motion in Computer Games

Page 2: Non-Photorealistic Rendering Techniques for Motion in Computer Games

IntroductionIntroduction

•Computer graphics has long been defined as the quest to achieve photorealism

•Programmable hardware makes rendering photorealistically not only possible, but allows us to produce stylized renderings

•Users expect realistic behavior in worlds that are rendered photorealistically

Page 3: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Varieties of Realism –

Ferwerda[2003]

Varieties of Realism –

Ferwerda[2003]

Physical Realism• the virtual objects provide the same visual

simulation as the real scene

Photorealism• the image produces the same visual

response as the scene

Functional Realism• the image provides the same visual

information as the scene

Page 4: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Functional RealismFunctional Realism

•NP pictures can be more effective at conveying information

•Is there a way to express motion ?•Are there any “rules”, especially for games,

that enhance the users’ perceptions ?

•We don’t usually depict the motion of objects in computer-generated dynamic images -especially in real-time rendered dynamic images

•Although motion is essential, it is not usually visualized

Page 5: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Related WorkRelated Work

Motivation•Walt Disney Studio: 12 principles of animation

[1930]

•guide production and creative discussions as well to train young animators better and faster

•help us to create more believable characters and situations, ex: bouncing ball

•McCloud[1993] has also analyzed the abstract illustration of motion in comics

•motion lines

•multiple images the most important for still image

Page 6: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Motion Lines TechniquesMotion Lines Techniques

•Most common one for visualizing motion in comics

•This Technique can express high degree of movement, and emphasizes the quality of the illustration’s dynamics

• Its usage in a dynamic environment would enhance the users’ perception as well

•Fun factor: the attention of the user becomes more focused on motion

Page 7: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Multiple ImagesMultiple Images

•Create a “blurred” object on the screen, often seems to be more realistic than the normal movement of the object without the blur effect

•When objects move very fast, our eyes expect to “see” something (still images,contours), even if the object if off the screen

•Very complex motions can be emphasized with this technique because users have more time to analyze movement

Page 8: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Squash-and-Stretch [Disney]Squash-and-Stretch [Disney]

•A combination of the two techniques, together with Disney’s squash-and-stretch technique, will achieve the best results for visualizing motion in real-time

•The deformation of an object due to itsspeed is a very important technique in enhancing visual perception

•The squash-effect exaggerates the objectand the stretch-effect anticipates the collision

Page 9: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Our ApproachOur Approach

•The motion of objects can be classified into the following three groups

•squash-and stretch

•multiple images

•motion lines

•The three methods can by combined to enhance the graphical behavior of motion

Page 10: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Requirements & LimitationsRequirements & Limitations

•Detailed geometric data for all objects we want to apply the technique to

•The object’s geometric data has to be modifiable

•The position of the object has to be available at all times

•Only past motions can be considered, future motions cannot

Page 11: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Squash-and-StretchSquash-and-Stretch

Adjust the style of motion• (direction, speed or acceleration of movement as well as the rigidity of the object)

•Maximum speed, vmax

•Maximum acceleration, amax

•Maximum speed scale, kvmax

•Maximum acceleration scale, kamax

•Minimum acceleration scale, kamin

•User defined and assigned to a specific object

•The desired results can be achieved easily by varying the parameters

maximum stretch

minimum squash

Page 12: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Squash-and-StretchSquash-and-Stretch

•Speed-dependent scaling parameter

)1(1max

max

vv kv

vkstretc

h

0),1(1

0),1(1

min

max

max

max

aka

ak

aka

ak

aa

aa

squash

stretch

av kkk result result scaling parameter

Page 13: Non-Photorealistic Rendering Techniques for Motion in Computer Games

DeformationDeformation

•Simulating Cartoon Style Animation [Chenney 2002, University of Wisconsin at Madison]

•The stylistic choices we made in defining our deformations are:

•The deformations should be volume preserving

•Each object has a natural set of deformation axes, including one principle axis

•These axes define a deformation coordinate system with the x-axis aligned with the “forward” direction for the object

Page 14: Non-Photorealistic Rendering Techniques for Motion in Computer Games

DeformationDeformation

•The deformation is controlled by a single parameter, s, which is the scaling coefficient along the principle axis

•Scale the other dimensions equally according to our volume preserving requirement

s

s

s

100

010

00

* s = kresult

Page 15: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Squash-and-StretchSquash-and-Stretch

Page 16: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Multiple ImagesMultiple Images

•Snapshots of the moving object are taken for every constant time interval that can be configured

•The easiest form of multiple images if to draw the whole object several times (real-time)

•A texture containing all contour replications is drawn in the background

•Replication rate, n: the amount of contour replications generated per second

•A common style of multiple images is the continuous decrease in contour replications

Page 17: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Multiple ImagesMultiple Images

Page 18: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Multiple ImagesMultiple Images

Page 19: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Motion Lines - Requirements Motion Lines - Requirements

• Schulz [1999] calls for a couple of requirements for the motion lines in still image

•The upper and lower motion lines relative to the direction of motion have to be at the same level as the maximum extent of the object

•Object’s geometrical data (vertices) → starting points of motion lines

Page 20: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Motion Lines - RequirementsMotion Lines - Requirements

•Motion lines are to be placed on significant region of the object

•The number of motion lines has to be configurable

•The space between motion lines must not be too constant

Page 21: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Motion Lines - RequirementsMotion Lines - Requirements

•Accumulations of motions on certain regions of the object are not allowed

•Motion lines are to begin after the object and are not allowed to cut the object

•The length of motion lines has to be configurable

Page 22: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Motion LinesMotion Lines

•To determine the starting points of the motion lines, the positions of the vertices are transformed into screen coordinates

Page 23: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Motion LinesMotion Lines

•To get the starting points more easily, the object is rotated to the motion direction

•Now the limiting vertices can be determined by comparing their coordinates of the y-axis

Page 24: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Motion LinesMotion Lines

•To get the starting points for the motion lines in between, the object is split into equally large strokes

• In every stripe, the vertex with the lowest x-coordinate is used as a starting point

Page 25: Non-Photorealistic Rendering Techniques for Motion in Computer Games

Motion LinesMotion Lines

•A particle system is used to draw the motion lines

•particle emitters: correspondingto the number of motion lines,each of these emitters releases a defined number of particles

•life cycle: a particle lasts for a predefined period (properties of the particle are changing)

•position of the emitter is updated every program cycle

Page 26: Non-Photorealistic Rendering Techniques for Motion in Computer Games

ImplementationImplementation

• OpenGL & Cg, Halflife model as file format

Squash-and-Stretch: vertex shader• //1. Set the position toe the model origin

float3 modelOrigin = float3(0, 0, 0);modelOrigin = Vertor Transform ( modelOrigin, boneMatrix);position.xyz -= modelOrigin;//2. Rotate the object based ob the direction of the motionposition.xyz = VectorRotate ( position.xyz, motionMatrix );//3. Apply the scalingposition.x *= motionScaleX; //k_resultposition.y *= motionScaleYZ; //k_normposition.z *= motionScaleYZ; //k_norm//4. Bring the object to its original orientationposition.xyz = VectorIRotate ( position.xyz, motionMatrix);//5. Move the object back to the original positionposition.xyz += modelOrigin;

Page 27: Non-Photorealistic Rendering Techniques for Motion in Computer Games

ImplementationImplementation

Multiple images• It is necessary to switch between the two

projection modes

•Orthogonal Projection Mode

•it is possible to use the two-dimensional screen coordinates

•update and display the texture containing the contour replications

•Perspective Projection Mode

•render the 3D object

Page 28: Non-Photorealistic Rendering Techniques for Motion in Computer Games

ImplementationImplementation

Motion Lines•Properties of emitter

•current position

•duration of the life cycles of particles

•length of the motion lines is defined through the duration of the life cycle

•Every property of the particle (e.g., line width, color) has a start value and an end value

Page 29: Non-Photorealistic Rendering Techniques for Motion in Computer Games

ResultsResults

Page 30: Non-Photorealistic Rendering Techniques for Motion in Computer Games

ResultsResults

Page 31: Non-Photorealistic Rendering Techniques for Motion in Computer Games

ResultResult

Page 32: Non-Photorealistic Rendering Techniques for Motion in Computer Games

ResultResult

Page 33: Non-Photorealistic Rendering Techniques for Motion in Computer Games

The EndThe End