54
CoDA Center for Digital Archaeology -UC Berkeley www.codifi.info E.Toffalori elena@codifi.info 10 mar 2011 3D Modeling for Cultural Heritage with Blender (2) Basic Concepts of 3D Graphics

CoDA Training - Basics of 3D Graphics

Embed Size (px)

DESCRIPTION

This is a keynote I used in a workshop about Cultural 3D held in 2011 at the Center for Digital Archaeology @ UC Berkeley (www.codifi.info)

Citation preview

Page 1: CoDA Training - Basics of 3D Graphics

CoDA Center for Digital Archaeology -UC Berkeleywww.codifi.info

E.Toffalori [email protected]

10 mar 2011

3D Modeling for Cultural Heritage with Blender (2)

Basic Concepts of 3D Graphics

Page 2: CoDA Training - Basics of 3D Graphics

3D Modeling for Cultural Heritage with Blender

Basic concepts of 3D Graphics: SUMMARY

3D data embedded in 2D formats

3D data types

Encoding of data

Working view

Rendering

Materials and Textures

Lights and Cameras

Other entities

Software Overview

Page 3: CoDA Training - Basics of 3D Graphics

Traditional Cartography and engineering drawings (and their digital form, CAD or GIS)

http://commons.wikimedia.org

- Basic concepts of 3D Graphics -3D data embedded in 2D formats

Page 4: CoDA Training - Basics of 3D Graphics

Traditional Cartography and engineering drawings

Normal map (a raster image that assigns a direction value to every pixel of a surface, encoded in RGB values)

http://www.blender.org

- Basic concepts of 3D Graphics -3D data embedded in 2D formats

Page 6: CoDA Training - Basics of 3D Graphics

Traditional Cartography and engineering drawings

Normal map

Reflectance Transformation Imaging

Stereographic images and video (offset images presented separately to R/L eye)

- Basic concepts of 3D Graphics -3D data embedded in 2D formats

Page 7: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -3D data embedded in 2D formats

http://commons.wikimedia.org

Page 8: CoDA Training - Basics of 3D Graphics

Traditional Cartography and engineering drawings

Normal map

Reflectance Transformation Imaging

Stereographic images and video

Sculpted prims (a particular type of normal map, standard format of detailed meshes in Second Life)

- Basic concepts of 3D Graphics -3D data embedded in 2D formats

Page 9: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -3D data types

POINT CLOUD Points identified by XYZ values;

Main method for automatic acquisition of massive 3D data;

O u t p u t f o r m a t f o r p h o t o g r a m m e t r y a n d photomodeling;

Controllable resolution;

Light data structure - allows storage of huge quantities of data

Page 10: CoDA Training - Basics of 3D Graphics

POINT CLOUD

From laser-scanning we can alternatively obtain boundary representations (TIN = Triangulated Irregular Networks)

Issue with laser scanning, apart from dimensions, is the need of human interpretation! (Time consuming, more likely to become unusable)

http://archive.cyark.org/

- Basic concepts of 3D Graphics -3D data types

Page 11: CoDA Training - Basics of 3D Graphics

POINT CLOUD

VOXEL

3D version of pixel, regular grid of cubes;

controllable, finite resolution;

volume/weight computing or division into sub-volumes;

visualization of scientific data (often sampled in a regular grid);

3D printing;

- Basic concepts of 3D Graphics -3D data types

Page 12: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -3D data types

POINT CLOUD

VOXEL

http://nasaimages.org

Page 13: CoDA Training - Basics of 3D Graphics

POINT CLOUD

VOXEL

C AD = C o m p ute r Aided Design

vector-based drawing system;

based on lines and polylines, secondarily on surfaces and volumes;

in archaeology, used for manually acquired 3D data from total-station;

mainly used for architectural s c a l e ( g e n e r a l p l a n s , digitization of field drawings);

- Basic concepts of 3D Graphics -3D data types

Page 14: CoDA Training - Basics of 3D Graphics

E.Toffalori

- Basic concepts of 3D Graphics -3D data types

Page 15: CoDA Training - Basics of 3D Graphics

POINT CLOUD

VOXEL

CAD

Polygonal MESH

collection of vertices, edges and faces that can be freely moved;

most common format for ‘freehand’ or manual modeling;

base d on pr im it ives an d m o d i fi e d b y m e a n s o f subdivision and addition of vertices and detail;

main format for Blender, too!!!

- Basic concepts of 3D Graphics -3D data types

Page 16: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -3D data types

POINT CLOUD

VOXEL

CAD

Polygonal MESH

http://www.blender.org

Page 17: CoDA Training - Basics of 3D Graphics

POINT CLOUD

VOXEL

CAD

Polygonal MESH

NURBS

parametric curves or surfaces;

handled more efficiently than meshes, but they allow more limited changes;

a NURBS sphere will always be rendered as a perfect circle (whereas I will see edges on a mesh)...

...but I can’t texture it in detail...

- Basic concepts of 3D Graphics -3D data types

Page 18: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -3D data types

POINT CLOUD

VOXEL

CAD

Polygonal MESH

NURBS

http://en.wikipedia.org

Page 19: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -3D data types

POINT CLOUD

VOXEL

CAD

Polygonal MESH

NURBS

Procedural Modeling

generated through encoded r u le s (S h a p e G e n e rato r Language);

can provide infinite variations of models within certain rules (representation of randomness, self-similarity, repetitiveness);

i n t e g r a t e d w i t h o t h e r techniques;

often aimed to high-quality rendering of urban landscapes;

Page 20: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -3D data types

POINT CLOUD

VOXEL

CAD

Polygonal MESH

NURBS

Procedural Modeling

http://www.procedural.com

Page 21: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -Encoding of data: examples

code of a NURBS sphere(.wrl)

code of a MESH sphere(.dae)

Page 22: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -Encoding of data: examples

City Engine: generative code of...

Page 23: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -Encoding of data: examples

.... a whole city!

Page 24: CoDA Training - Basics of 3D Graphics

The core level of 3D data is the geometrical structure; this can be encoded either in an ASCII/human-readable format (like Google .KMZ and other Collada files) or in a binary format (.blend files);

Editing to the geometric structure can be done directly inside the code (ASCII formats)...

...or through an interface provided by the 3D modeling software; (not always graphic: see AutoCAD text shell, Blender Python Scripting Console...)

- Basic concepts of 3D Graphics -Encoding of data

Page 25: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -Working view: examples

Blender

Page 26: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -Working view: examples

3DS Max

Page 27: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -Working view: examples

Maya

Page 28: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -Working view: examples

Google SketchUp

Page 29: CoDA Training - Basics of 3D Graphics

A RENDERING is not a working space anymore;

While it can still be interactive (video games, virtual environments, 3D PDF), it doesn’t allow changes to the model;

given a certain dataset, a rendering is the result of the computing process, returning a value for every pixel of our monitor or display device;

It can refer to a still image, a video animation or an interactive scene;

- Basic concepts of 3D Graphics -Rendering

Page 30: CoDA Training - Basics of 3D Graphics

RENDERING ENGINES some 3D modelers have an internal renderer, but besides this they rely on third party modules for rendering

Final Render

Brazil

V-Ray

Mental-Ray

Render-Man (Pixar)

YafaRay...

- Basic concepts of 3D Graphics -Rendering

Page 31: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -Rendering

The same scene rendered with different engines will return different results in terms of material, light and color treatment;

http://yorik.uncreated.net/tutorials/blender-renderers.html

Page 32: CoDA Training - Basics of 3D Graphics

The way we make 3D models look realistic, conversely to gray cubes and shapes, is by means of materials and textures;

- Basic concepts of 3D Graphics -Materials and Textures

Page 33: CoDA Training - Basics of 3D Graphics

The way we make 3D models look realistic, conversely to gray cubes and shapes, is by means of materials and textures;

Materials control color and shading of objects, and detail the way they will react to light;

You can find samples of complex materials, such as human skin, on the web in 3D graphics blogs and repositories (see below for Blender resources);

- Basic concepts of 3D Graphics -Materials and Textures

Page 34: CoDA Training - Basics of 3D Graphics

Material and texture settings in Blender

- Basic concepts of 3D Graphics -Materials and Textures

Page 35: CoDA Training - Basics of 3D Graphics

A material can feature one or more textures, that is, raster images projected onto the faces of a 3D model;

2D textures need to be mapped on the 3D space of the object, this can be done through the modeler’s built-in projection functions (such as “cube”, “cylinder”, “sphere”...) ...

or through UVW mapping in a more detailed way

- Basic concepts of 3D Graphics -Materials and Textures

http://www.blender.org

Page 36: CoDA Training - Basics of 3D Graphics

UVW MAPPING: UVW is an alternative acronym to XYZ for a tridimensional cartesian space, used for describing the mapping process between the texture space and the model space;

- Basic concepts of 3D Graphics -Materials and Textures

http://www.blender.org

Page 37: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -Materials and Textures

UVW MAPPING: UVW is an alternative acronym to XYZ for a tridimensional cartesian space, used for describing the mapping process between the texture space and the model space;

Once a mesh is unfolded into a 2D texture space, every vertex w i l l b e a s s i g n e d a U V (2D)position besides its XYZ (3D)position;

http://www.blender.org

Page 38: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -Materials and Textures

PHOTOGRAPHIC VS PROCEDURAL TEXTURE;

Textures can be external raster images, such as photographs or drawings... (When modeling something existing in the real world, you may want to use photographs of the real object or building, whilst when modeling a project, a virtual world or archaeological features, plausible photographs form other contexts or drawings will work well);

Or they can be generated algorithmically inside the modeling software (Procedural textures guarantee non-repetitive, uniform coverage, but they hardly represent realistically real materials. However, they can be overlaid on photographic textures to create irregular pattern, such as dirt or rust);

Page 39: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -Realistic Texturing

Page 40: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -Realistic Texturing

Page 41: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -Materials and Textures

TEXTURES TO MODIFY OTHER VALUES;

Textures aren’t used to just modify color, but also other values’ intensity (grayscale);

BUMP and NORMALS

DISPLACEMENT

ALPHA

SPECULARITY-REFLECTIVITY-MIRROR

...

Page 42: CoDA Training - Basics of 3D Graphics

BU M P ( g ra y s c a le ) a n d NORMAL (RGB) textures simulate a detailed 3D surface on a flat face; they are used to increase detail of the model without increasing its geometric complexity;

- Basic concepts of 3D Graphics -Materials and Textures

Page 43: CoDA Training - Basics of 3D Graphics

BUMP (g raysca le) image s express the relative “height” (W coordinate in the UVW texture-space) of every pixel

They don’t actually modify geometry: such irregularities won’t cast a shadow or occlude other objects, they just modify the way light interacts with the surface.

A bump texture is often the b&w version of the full-color texture:;

- Basic concepts of 3D Graphics -Materials and Textures

Page 44: CoDA Training - Basics of 3D Graphics

NORMAL textures encode into an RGB value the direction of the normal (perpendicular) to the surface in every point;

They can be baked from a h i g h - d e ta i l m e s h a n d proj e cte d o n a lo we r -resolution model to simulate detailed surface;

* Sculpted Prims used in Second Life are a particular kind of normal texture, storing surface position instead of normal direction (XYZ space is mapped to RGB values);

- Basic concepts of 3D Graphics -Materials and Textures

http://www.blender.org

Page 45: CoDA Training - Basics of 3D Graphics

DISPLACEMENT textu re s actually modify the geometry creating bumps, creases and ridges, thus they need surfaces to be subdivided accordingly to the desired level of detail;

ALPHA affects transparency of object areas;

SPECULARITY, REFLECTIVITY, MIRROR change the way different areas react to light;

- Basic concepts of 3D Graphics -Materials and Textures

http://www.blender.org

Page 46: CoDA Training - Basics of 3D Graphics

In modeling software based on a 3D scene setup, cameras and lights are treated as virtual objects too;

Position, dimension, scale, direction, angle, light intensity and “lens” settings;

Lighting for a realistic result must simulate real world conditions (tr icks an d pr inc ip le s from photography lighting);

Similarly, animation requires some direction skills to move the internal camera around;

- Basic concepts of 3D Graphics -Lights and Cameras

Page 47: CoDA Training - Basics of 3D Graphics

RAYTRACING calculates casting rays from the light source and the reflected amount per pixel in the rendering; ver slow but precise, it allows sophisticated effects, transparency, mirroring...;

R. is also used to calculate rendering, that is, what is visible or occluded from camera position;

BUFFER is a “cheaper” effect, based on the Z-position of faces with respect to the source of light, faster to render, thus used mostly in real-time and video rendering;

- Basic concepts of 3D Graphics -Lights and Cameras

Page 48: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -Lights and Cameras

“Raytracing can be used to make a material reflect its surroundings, like a mirror. The principle of raytraced reflections is very simple: a ray is fired from the camera and travels through the scene until it encounters an object. If the first object hit by the ray is not reflective, then the ray takes the color of the object. If the object is reflective, then the ray bounces from its current location and travels up to another object, and so on, until a non-reflective object is finally met and gives the whole chain of rays its color. ”

http://wiki.blender.org/

Page 49: CoDA Training - Basics of 3D Graphics

Hierarchic structures;

Armatures;

Instances, Groups, Parents;

Fluids and particular systems;

Constraint and interactions between objects;

Game interactions (events responding to the user input);

http://www.blendswap.com/

- Basic concepts of 3D Graphics -Other entities

Page 50: CoDA Training - Basics of 3D Graphics

Autodesk AutoCAD (architecture, design and engineering)

Autodesk 3DS Max (architecture, animation and characters)

Autodesk Maya (imaging, animation and characters)

Maxon Cinema 4D (imaging and animation)

Google SketchUp (web-contents; architecture and interiors)

Blender (animation, characters, video games)

- Basic concepts of 3D Graphics -Software Overview: General

Page 51: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -Software Overview: Specialized

Rhino 3D (organic modeling)

V isual Nature (lan dscapes, ecosystems)

MeshLab (unstructured point-clouds and meshes; architecture and objects)

Procedural CityEngine (imaging; architecture and urban landscapes)

Chemical and medical industry...

http://commons.wikimedia.org

Page 52: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -Software Overview:

Game engines/scene managersBlender

OGRE

Open Scene Graph

Unity 3D

Virtools

...

http://unity3d.com/gallery/

Page 53: CoDA Training - Basics of 3D Graphics

- Basic concepts of 3D Graphics -Software Overview:

Viewers and web pluginAc robat Rea de r ( PDF-embedded U3D);

Google Earth + plugin

Unity 3D

Adobe Flash

HTML5

Java / Python-based plugin

Page 54: CoDA Training - Basics of 3D Graphics