GAM531 DPS931 – Week 10 Meshes and Buffers. Breaking Down An Image Actors Actors = Mesh + Material Mesh = Shape of the object.

Slides:



Advertisements
Similar presentations
Vertex Buffer Objects, Vertex Array Objects, Pixel Buffer Objects.
Advertisements

COMP 175 | COMPUTER GRAPHICS Remco Chang1/6103b – Shapes Lecture 03b: Shapes COMP 175: Computer Graphics February 3, 2015.
CMPE 466 COMPUTER GRAPHICS
CSC418 Computer Graphics n Polygon normals n Back Faces n Visibility Algorithms.
EECS 700: Computer Modeling, Simulation, and Visualization Dr. Shontz Chapter 2: Shader Fundamentals (continued)
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Building Models modified by Ray Wisman Ed Angel Professor of Computer Science,
1 Building Models. 2 Objectives Introduce simple data structures for building polygonal models ­Vertex lists ­Edge lists OpenGL vertex arrays.
3D Game Programming Geometric Transformations
Status – Week 257 Victor Moya. Summary GPU interface. GPU interface. GPU state. GPU state. API/Driver State. API/Driver State. Driver/CPU Proxy. Driver/CPU.
CS 4363/6353 BASIC RENDERING. THE GRAPHICS PIPELINE OVERVIEW Vertex Processing Coordinate transformations Compute color for each vertex Clipping and Primitive.
GAM531 DPS931 – Week 11 Render State. The Render State Render State BuffersShadersSamplers Rasterizer State Blend State.
GAM532 DPS932 – Week 7 Introduction to shadows. Shadow Effects Light Surface No Shadows Shadows.
GAM531 DPS931 – Week 12 Textures and Samplers.
Computer Graphics Programming: Matrices and Transformations CSE 3451 Matt Boggus.
As well as colors, normals, and other vertex data PUSHIN’ GEO TO THE GPU JEFF CHASTINE 1.
CS CS 175 – Week 4 Triangle Mesh Smoothing Discrete Differential Geometry.
OpenGL. Textures  Bind Textures similar to binding VBO’s  Create a texture for each object  Generate the texture similar how you generate a VBO buffer.
GAM532 DPS932 – Week 1 Rendering Pipeline and Shaders.
1 X file & Mesh Chapter 8. 2 What is X file? 1.X file is a file that is used to store D3D program's data. 2.Any X file has extension *.x. 3.X file could.
GAM531 DPS931 – Week 1 Introduction. Professors Joseph Hughes Info: scs.senecac.on.ca/~jp.hughes T2104 Roles: Primary Lecturer.
GAM531 DPS931 – Week 9 OpenGL 4.3 and Direct X 11.
Antigone Engine Kevin Kassing – Period
A Really (too) Short Introduction to OpenGL Peter Rautek.
CSE 381 – Advanced Game Programming Basic 3D Graphics
Kenneth Hurley Sr. Software Engineer
GAM531 DPS931 – Week 5 The Scene. Reviewing the Engine Engine DX11 Device GL 4.3 Device ControllerManagerModel DX11 Object GL 4.3 Object DX 11 API GL.
3D API By Clayton Azzopardi (Group 10). Introduction Android uses the OpenGL ES 1.0 API Android uses the OpenGL ES 1.0 API Open Graphics Library for Embedded.
Week 11 - Thursday.  What did we talk about last time?  Image processing  Blurring  Edge detection  Color correction  Tone mapping  Lens flare.
Buffers Textures and more Rendering Paul Taylor & Barry La Trobe University 2009.
Image Synthesis Rabie A. Ramadan, PhD 1. 2 About my self Rabie A. Ramadan My website and publications
CSE 690: GPGPU Lecture 6: Cg Tutorial Klaus Mueller Computer Science, Stony Brook University.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
GAM532 DPS932 – Week 2 Vertex Shaders. The Shader Pipeline Vertex Processing Primitive Assembly / Processing Rasterization Fragment Process Pixel Output.
OpenGL Buffer Transfers Patrick Cozzi University of Pennsylvania CIS Spring 2012.
MIRALab Where Research means Creativity SVG Open 2005 University of Geneva 1 Converting 3D Facial Animation with Gouraud shaded SVG A method.
Game Programming 06 The Rendering Engine
1 Manage Mesh Data Chapter 8. 2 How to manage Mesh data The most important two objects of mesh are VertexBuffer and IndexBuffer, which can obtained by.
Solid Modeling. Solid Modeling - Polyhedron A polyhedron is a connected mesh of simple planar polygons that encloses a finite amount of space. A polyhedron.
OpenGL Shader Language Vertex and Fragment Shading Programs.
Game Programming 07 OGRE3D Mesh in Action 2010 년 2 학기 디지털콘텐츠전공.
Vertices, Edges and Faces By Jordan Diamond. Vertices In geometry, a vertices is a special kind of point which describes the corners or intersections.
Surface Area of Triangular Prisms Greg Morrison. Definition: The sum of the areas of all of the faces of a three-dimensional figure. Ex. How much construction.
1 OGRE Programming Intermediate Tutorial: Volume Selection.
Mesh Skinning Sébastien Dominé. Agenda Introduction to Mesh Skinning 2 matrix skinning 4 matrix skinning with lighting Complex skinning for character.
Introduction to Meshes Lecture 22 Mon, Oct 20, 2003.
GLSL Review Monday, Nov OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending.
CS 4722 Made by Dr. Jeffrey Chastine Modified by Dr. Chao Mei
Pushin’ Geo to the GPU As well as colors, normals, and other vertex data Made by Jeff Chastine, Modified by Chao Mei Jeff Chastine.
Interactive Computer Graphics CS 418 – Fall 2017 Indexed Meshes Transformations Background Imagery:
Week 12 - Thursday CS361.
Constructing Objects in Computer Graphics
Real-Time Rendering Geometry and Buffers
Constructing Objects in Computer Graphics By Andries van Dam©
Rotate the triangle, 900 clockwise, about the centre of rotation.
How to transform a shape with a rotation
Class 17 front and back lighting convex sets, convex hull
Chapter VI OpenGL ES and Shader
Lecture 3 : Isosurface Extraction
Chapter III Modeling.
Volume Graphics (lecture 4 : Isosurface Extraction)
Computer Graphics Practical Lesson 8
Game Programming Algorithms and Techniques
Mickaël Sereno Graphics Memory Mickaël Sereno 11/07/2019 Mickaël Sereno -
Class 18 front and back lighting convex sets, convex hull
Last Time B-splines Project 3 was made available
CIS 6930: Chip Multiprocessor: GPU Architecture and Programming
Presentation transcript:

GAM531 DPS931 – Week 10 Meshes and Buffers

Breaking Down An Image Actors Actors = Mesh + Material Mesh = Shape of the object

Breaking Down an Actor Mesh + Advanced Material Wireframe Mesh

Breaking Down A Mesh Triangle Face Vertices X Y Z

What Is A Vertex? Class Vertex { }; [ 0, 10, 0 ] Vector<> normal; Vector uv; float weight; int boneID; Vector<> pos; [ 7, -7, 0 ][ -7, -7, 0 ]

Vertex Buffer Triangle How Do Vertices Make A Mesh [ [ 0, 10, 0 ], [ 7, -7, 0 ], [ -7, -7, 0 ], [ 0, 10, 0 ], [ 7, -7, 0 ], [ 7, -7, -7 ] ] Vertex

How Do Vertices Make Triangles? [ 0, 10, 0 ] [ 7, -7, 0 ][ -7, -7, 0 ] Winding Order Clock-Wise (Front) Vs Counter Clock-Wise (Back)

Triangle Face Culling No CullingBack Face CullingAll Face Culling

Vertex Buffer Optimizations [ [ 0, 10, 0 ], [ 7, -7, 0 ], [ -7, -7, 0 ], [ 0, 10, 0 ], [ 7, -7, 0 ], [ 7, -7, -7 ] ] Vertex 1 Vertex 2 Vertex 3 Vertex 1 Vertex 2 Vertex 4 Vertex Buffer Vertex Index Buffer Triangle Index

Index Buffer Vertex Buffer (No Index Buffer) [ [ 0, 10, 0 ], [ 7, -7, 0 ], [ -7, -7, 0 ], [ 0, 10, 0 ], [ 7, -7, 0 ], [ 7, -7, -7 ] ] Index Buffer [ 0, 1, 2, 0, 1, 4 ] Vertex Buffer [ [ 0, 10, 0 ], [ 7, -7, 0 ], [ -7, -7, 0 ], [ 7, -7, -7 ] ]

Primitive Types

Programming Buffers bSize = //Size of buffer glGenVertexArrays(1, &vID); //vertex buffer only glBindVertexArray(vID); //vertex buffer only glGenBuffers(1, &bufferID); glBindBuffer(GL_ARRAY_BUFFER,bufferID); //constructs a vertex definition (vertex buffer only) _initVertex(*(const VertexFormat *)&v); D3D11_BUFFER_DESC bd; ZeroMemory(&bd, sizeof(D3D11_BUFFER_DESC)); bd.Usage = //how it will be used (static vs dynamic) bd.CPUAccessFlags = //cpu access bd.ByteWidth = //Size of the buffer bd.BindFlags = //type of buffer dev->CreateBuffer(&bd, 0, &buffer));

Writing to Buffers //set buffer to be written glBindVertexArray(vID); glBindBuffer(GL_ARRAY_BUFFER, bufferID); //write to the buffer glBufferData(GL_ELEMENT_ARRAY_BUFFER, dataSizeInBytes, someData, GL_STATIC_DRAW);//GL_DYNAMIC_DRAW glBindBuffer(GL_ARRAY_BUFFER, 0); //sets the buffer to be written to con->Map(buffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &sub) //write to the buffer Memcpy(sub.pData, someData, dataSizeInBytes); //unmap buffer Con->unmap(buffer, 0);

Binding Buffers //set vertex buffer glBindVertexArray(vID); glBindBuffer(GL_ARRAY_BUFFER, bufferID); //don’t forget to bind the vertex attributes... //set index buffer glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufferID); //bind uniform glBindBufferBase(GL_UNIFORM_BUFFER, slot, bufferID); //set vertex buffer con->IASetVertexBuffers(0,1, &buffer, &vSize, &offset); //set index buffer con->IASetIndexBuffer(buffer, DXGI_FORMAT_R32_UINT, 0); //set uniform con->PSSetConstantBuffers(slot, 1, &buffer); con->VSSetConstantBuffers(slot, 1, &buffer);

To Do Continue work on engine enhancement Read this week’s lab Read this week’s notes Re-implement OpenGL Device functions