ICG 2018 Fall Homework1 Guidance

Slides:



Advertisements
Similar presentations
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Advertisements

Graphics Pipeline.
2 COEN Computer Graphics I Evening’s Goals n Discuss the fundamentals of lighting in computer graphics n Analyze OpenGL’s lighting model n Show.
3D Graphics Rendering and Terrain Modeling
1. What is Lighting? 2 Example 1. Find the cubic polynomial or that passes through the four points and satisfies 1.As a photon Metal Insulator.
(conventional Cartesian reference system)
GLSL I Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New Mexico.
IN4151 Introduction 3D graphics 1 Introduction to 3D computer graphics part 2 Viewing pipeline Multi-processor implementation GPU architecture GPU algorithms.
Status – Week 277 Victor Moya.
IAT 3551 Computer Graphics Overview Color Displays Drawing Pipeline.
Mohan Sridharan Based on slides created by Edward Angel GLSL I 1 CS4395: Computer Graphics.
REAL-TIME VOLUME GRAPHICS Christof Rezk Salama Computer Graphics and Multimedia Group, University of Siegen, Germany Eurographics 2006 Real-Time Volume.
COMP 261 Lecture 14 3D Graphics 2 of 2. Doing better than 3x3? Translation, scaling, rotation are different. Awkward to combine them. Use homogeneous.
Shading (introduction to rendering). Rendering  We know how to specify the geometry but how is the color calculated.
GPU Programming Robert Hero Quick Overview (The Old Way) Graphics cards process Triangles Graphics cards process Triangles Quads.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Programmable Pipelines. 2 Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Shading. What is Shading? Assigning of a color to a pixel in the final image. So, everything in shading is about how to select and combine colors to get.
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
Computer Graphics I, Fall 2010 Shading in OpenGL.
Shading Examples shaderSphere1, 2, 3 & 4 of Chapter 6.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CSE Real Time Rendering Week 2. Graphics Processing 2.
Shadow Mapping Chun-Fa Chang National Taiwan Normal University.
CSE 381 – Advanced Game Programming GLSL Lighting.
Programmable Pipelines Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group computer graphics & visualization 3D Rendering Praktikum: Shader Gallery The.
Shading in OpenGL Ed Angel Professor Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E.
CSE 381 – Advanced Game Programming GLSL. Rendering Revisited.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
Jens Krüger & Polina Kondratieva – Computer Graphics and Visualization Group computer graphics & visualization GameFX C# / DirectX 2005 The Rendering Pipeline.
Chris Mayer & Nic Shulver Shading Definitions Light emanating from small surfaces is called a Point light sourcee.g. the sun (not really small though!)
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
Programming with OpenGL Part 3: Shaders Ed Angel Professor of Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive.
GLSL I.  Fixed vs. Programmable  HW fixed function pipeline ▪ Faster ▪ Limited  New programmable hardware ▪ Many effects become possible. ▪ Global.
Revision Sheet Computer Graphics and Human Interaction By Dr. HANY ELSALAMONY1.
GLSL Review Monday, Nov OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending.
Lecture Cameras and lights 1Elias Holmlid.  First part  Cameras  Lights ▪ Light types ▪ Light models ▪ How light is computed  Second part 
Applications and Rendering pipeline
Graphics Pipeline Bringing it all together. Implementation The goal of computer graphics is to take the data out of computer memory and put it up on the.
Implementing Phong Lighting
Shaders, part 2 alexandri zavodny.
Computer Graphics Overview
Introduction to Computer Graphics with WebGL
ICG Syllabus 1. Introduction 2. Viewing in 3D and Graphics Programming
Tips for Shading Your Terrain
Programmable Pipelines
3D Graphics Rendering PPT By Ricardo Veguilla.
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
GLSL I Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New Mexico.
Day 05 Shader Basics.
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Chapter IX Lighting.
Illumination and Shading
Programming with OpenGL Part 3: Shaders
Mickaël Sereno Shaders Mickaël Sereno 25/04/2019 Mickaël Sereno -
Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Computer Graphics Shading in OpenGL
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Shading in OpenGL Ed Angel Professor Emeritus of Computer Science
CS 480/680 Fall 2011 Dr. Frederick C Harris, Jr. Computer Graphics
Presentation transcript:

ICG 2018 Fall Homework1 Guidance 20181011 網媒所碩一 周家宇

Requirements (Due to 20181108) Flat, Gouraud, and Phong shading with Phong reflection model in shaders. You can demonstrate the three shading computation in a single object. Enable multiple shaders and transformation on multiple objects in a scene. You are free to use those provided model files and arrange them to form the scene on your own style. You must show the three shading simultaneously on different objects in your scene. At least 3 objects & at least 3 light sources Bonus: Special effects on shading / lighting / animation, …

Phong Reflection Model Phong reflectionis is composed of three kinds of lights. Specular light means reflecting a small part of the light hitting the surface to eyes Diffuse is the most common light Ambient means environment light

Shading Flat Shading: Constant normal on the whole surface Gouraud Shading: Different vertex normal, interpolated vertex color on a fragment Phong Shading: Different vertex normal, interpolated vertex normal on a fragment Flat shading, use the same normal on the whole surface Gouraud shading, use different vertex normal, and then interpolate vertex color on a fragment Phong shading, use different vertex normal, and then interpolate vertex normal on a fragment and calculate color

Rendering Pipeline Rendering pipeline is a procedure from scene description to image on the screen First, there are many vertices(p, p1, p3), transfer to vertex processor to calculate their final positions(screen positions) These points will move on next two steps. After rasterization, the triangle(p, p1, p3) will be cut as fragments, and the attribute of each fragment is interpolated by origin three points (p, p1, p3) So in this homework, you need to write these two processors (vertex shader & fragment shader) Vertex shader will change vertex’s position Fragment shader will calculate fragment(pixel) color

Shaders // gl_FragColor is a built-in variable, it is the output of the fragment shader It is an example framework we provide, you can modify these two shaders to show shadings These two shaders are written by GLSL, you need to follow the rules. There are some built-in variables, such as gl_Position and gl_FragColor, etc. // gl_Position is a built-in variable, it is the output of the vertex shader // another output pass to fragment shader

Shader data These are variables from CPU to GPU (to shader) Uniform means each vertex has the same value Attribute means each vertex has different value Varying means value from vertex shader to fragment shader

Shader data Take vertex shader for example Because each vertex has its own position, normal, or colors, we use Attribute to build these variables There are some variables that each vertex have the same, such as transform matrix, we use Uniform to build these variables

You can search other built-in variables on the Internet

Load models 已經將大部分課程網的 tri 模型轉成 json 檔 Example Teapot.json

World transform y x z Model coordinates Each model has its own model coordinates, it sets origin with itself. Model data uses its own coordinates. Model coordinates

World transform World coordinates When you put a model in the scene, you need to transfer model coordinate to world coordinate You need to product a ModelViewMatrix If you want to do some transforms, such as translation, rotation, scale, shear, you need to modify this matrix World coordinates

World transform Camera coordinates Last, camera also has its own coordinate So you need to more product a ProjectionMatrix Camera coordinates

Transformations Homogeneous Coordinates We use homogeneous coordinates to calculate transform matrix

Translation It is translation matrix

Scale

Rotate

Shear Different order of matrix product will produce different result

Requirements Again (Due to 20181108) Flat, Gouraud, and Phong shading with Phong reflection model in shaders. You can demonstrate the three shading computation in a single object. (3pts) Enable multiple shaders and transformation on multiple objects in a scene. You are free to use those provided model files and arrange them to form the scene on your own style. You must show the three shading simultaneously on different objects in your scene. (3pts) At least 3 objects & at least 3 light sources Bonus: Special effects on shading / lighting / animation, …

Requirements Again

Reference https://webglfundamentals.org/ http://learningwebgl.com/blog/?page_id=1217 https://learnopengl.com/

TA Hours CSIE R506 周家宇 楊子由 r07944038@csie.ntu.edu.tw 星期五 10:00 ~ 12:00 mukyu99@cmlab.csie.ntu.edu.tw 星期二 10:00 ~ 12:00

Q & A