2D graphics 3D graphics Segoe UI Fonts, text analysis, layout Image & video decoding GPGPU Too.

Slides:



Advertisements
Similar presentations
EECS 700: Computer Modeling, Simulation, and Visualization Dr. Shontz Chapter 2: Shader Fundamentals (continued)
Advertisements

As well as colors, normals, and other vertex data PUSHIN’ GEO TO THE GPU JEFF CHASTINE 1.
GLSL I May 28, 2007 (Adapted from Ed Angel’s lecture slides)
GLSL I Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New Mexico.
Introduction to Geometry Shaders Patrick Cozzi Analytical Graphics, Inc.
Mohan Sridharan Based on slides created by Edward Angel GLSL I 1 CS4395: Computer Graphics.
Computer Science – Game DesignUC Santa Cruz Adapted from Jim Whitehead’s slides Shaders Feb 18, 2011 Creative Commons Attribution 3.0 (Except copyrighted.
GAM532 DPS932 – Week 1 Rendering Pipeline and Shaders.
Michael Robertson Yuta Takayama. WebGL is OpenGL on a web browser. OpenGL is a low-level 3D graphics API Basically, WebGL is a 3D graphics API that generates.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
WebGL: Hands On Zhenyao Mo Software Engineer, Google, Inc. Chrome GPU Team.
Basic Graphics Concepts Day One CSCI 440. Terminology object - the thing being modeled image - view of object(s) on the screen frame buffer - memory that.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Geometric Objects and Transformations. Coordinate systems rial.html.
Programming with OpenGL Part 2: Complete Programs Ed Angel Professor of Emeritus of Computer Science University of New Mexico.
Programming with OpenGL Part 2: Complete Programs Ed Angel Professor of Emeritus of Computer Science University of New Mexico.
CS 418: Interactive Computer Graphics Introduction to WebGL: HelloTriangle.html Eric Shaffer.
OpenGL Shading Language (Advanced Computer Graphics) Ernest Tatum.
WebGL: in-browser 3D graphics Nick Whitelegg Maritme and Technology Faculty Southampton Solent University.
1 Graphics CSCI 343, Fall 2015 Lecture 4 More on WebGL.
Lecture by: Martin Deschamps CSE 4431
CSE Real Time Rendering Week 2. Graphics Processing 2.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Graphics CSCI 343, Fall 2015 Lecture 2 Introduction to HTML, JavaScript and WebGL.
GAM532 DPS932 – Week 2 Vertex Shaders. The Shader Pipeline Vertex Processing Primitive Assembly / Processing Rasterization Fragment Process Pixel Output.
GRAPHICS PIPELINE & SHADERS SET09115 Intro to Graphics Programming.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
OpenGL Shader Language Vertex and Fragment Shading Programs.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CSE 381 – Advanced Game Programming GLSL. Rendering Revisited.
OpenGL-ES 3.0 And Beyond Boston Photo credit :Johnson Cameraface OpenGL Basics.
OpenGL Shading Language (GLSL)
1 Graphics CSCI 343, Fall 2015 Lecture 5 Color in WebGL.
1 Graphics CSCI 343, Fall 2015 Lecture 3 Introduction to WebGL.
Week 3 Lecture 4: Part 2: GLSL I Based on Interactive Computer Graphics (Angel) - Chapter 9.
1 Graphics CSCI 343, Fall 2015 Lecture 25 Texture Mapping.
 Learn how you can use the shader through OpenGL ES  Add texture on object and make the object have a different look!!
 Learn some important functions and process in OpenGL ES  Draw some triangles on the screen  Do some transformation on each triangle in each frame.
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.
OpenGL Shading Language
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.
Computer Science – Game DesignUC Santa Cruz Tile Engine.
Graphics Programming. Graphics Functions We can think of the graphics system as a black box whose inputs are function calls from an application program;
Pushin’ Geo to the GPU As well as colors, normals, and other vertex data Made by Jeff Chastine, Modified by Chao Mei Jeff Chastine.
The Basics: HTML5, Drawing, and Source Code Organization
Chapter 6 GPU, Shaders, and Shading Languages
Building beautiful and interactive apps with HTML5 & CSS3
The Graphics Rendering Pipeline
Revision.
Models and Architectures
Introduction to Computer Graphics with WebGL
GLSL I Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New Mexico.
.NET and .NET Core 7. XAML Pan Wuming 2017.
Introduction to Computer Graphics with WebGL
Introduction to Computer Graphics with WebGL
Day 05 Shader Basics.
Graphics Processing Unit
Introduction to Computer Graphics with WebGL
Introduction to Shaders
HW for Computer Graphics
Introduction to Computer Graphics with WebGL
Programming with OpenGL Part 3: Shaders
Mickaël Sereno Shaders Mickaël Sereno 25/04/2019 Mickaël Sereno -
Computer Graphics Introduction to Shaders
Introduction to Computer Graphics with WebGL
CS 480/680 Computer Graphics GLSL Overview.
Introduction to Computer Graphics with WebGL
OpenGL-Rendering Pipeline
CS 480/680 Fall 2011 Dr. Frederick C Harris, Jr. Computer Graphics
Presentation transcript:

2D graphics 3D graphics Segoe UI Fonts, text analysis, layout Image & video decoding GPGPU Too

HTML5, CSS3 & Direct2D Direct3D Segoe UI HTML5, CSS3 & DirectWrite HTML5, Direct2D effects, WIC & Media Foundation DirectCompute & C++AMP

Javascript // get the canvas and the 2D context for it var canvasElement = document.getElementById("myCanvas"); var context = canvasElement.getContext("2d"); // set the font and size context.font = "20px Georgia"; // clear an area and render hello world at position (10,50) context.clearRect( ,150); context.fillText("Hello World!", 10, 50); HTML // define the canvas size with the tag in the HTML doc

XAML // Set rendering location and text style C# // Set text private void YourFunction(object sender, Windows.UI.Xaml.RoutedEventArgs e) { greetingOutput.Text = "Hello World!"; }

Where’s ?? Where’s DirectX??

//The incoming vertex' position attribute vec4 position; //And its color attribute vec3 color; //The varying statement tells the shader pipeline that this variable //has to be passed on to the next stage (to the fragment shader) varying vec3 colorVarying; //The shader entry point is the main method void main() { colorVarying = color; //Pass the color to the fragment shader gl_Position = position; //Copy the position }

// Define the vertex and pixel shader structs struct VertexShaderInput { float3 pos : POSITION; float4 color : COLOR; }; struct PixelShaderInput { float4 pos : SV_POSITION; float4 color : COLOR; }; // Pass position and color values from Vert struct to Pixel struct (adding W and Alpha) PixelShaderInput SimpleVertexShader(VertexShaderInput input) { PixelShaderInput vertexShaderOutput; vertexShaderOutput.pos = float4(input.pos, 1.0f); vertexShaderOutput.color = float4(input.color, 1.0f); return vertexShaderOutput; }

varying vec3 colorVarying; void main() { //Create a vec4 from the vec3 by padding a 1.0 for alpha //and assign that color to be this fragment's color gl_FragColor = vec4(colorVarying, 1.0); }

// Collect input from vertex shader struct PixelShaderInput { float4 pos : SV_POSITION; float4 color : COLOR; }; // Set the pixel color value for the specified Renter Target float4 SimplePixelShader(PixelShaderInput input) : SV_TARGET { return input.color; }

// Bind shaders to pipeline (both VS and FS are in a program) glUseProgram(m_shader->getProgram()); // (Input Assembly) Get attachment point for position and color attributes m_positionLocation = glGetAttribLocation(m_shader->getProgram(), "position“); glEnableVertexAttribArray(m_positionLocation); m_colorLocation = glGetAttribColor(m_shader->getProgram(), “color“); glEnableVertexAttribArray(m_colorLocation); // Bind the vertex buffer object glBindBuffer(GL_ARRAY_BUFFER, m_geometryBuffer); glVertexAttribPointer(m_positionLocation, 4, GL_FLOAT, GL_FALSE, 0, NULL); glBindBuffer(GL_ARRAY_BUFFER, m_colorBuffer); glVertexAttribPointer(m_colorLocation, 3, GL_FLOAT, GL_FALSE, 0, NULL); // Draw a triangle of 3 vertices! glDrawArray(GL_TRIANGLES, 0, 3);

// Binding Shaders to pipeline (VS and PS) m_d3dDeviceContext->VSSetShader(vertexShader.Get(),nullptr,0); m_d3dDeviceContext->PSSetShader(pixelShader.Get(),nullptr,0); // Declaring the expected inputs to the shaders m_d3dDeviceContext->IASetInputLayout(inputLayout.Get()); m_d3dDeviceContext->IASetVertexBuffers(0, 1, vertexBuffer.GetAddressOf(), &stride, &offset); // Set primitive’s topology m_d3dDeviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); // Draw a triangle of 3 vertices! m_d3dDeviceContext->Draw(ARRAYSIZE(triangleVertices),0);

Dr. Seuss Collection Little Critter Collection Smithsonian 5 Little Monkeys Berenstain Bears Oceanhouse Media book titles

// Get the user application data folder Windows::Storage::StorageFolder^ localFolder = ApplicationData::Current- >LocalFolder; // Create an asynch task to open the file concurrency::task getFileOperation(localFolder- >GetFileAsync(fileName)); // Read the contents of the file asynchronously getFileOperation.then([this, m_d2dContext](StorageFile^ file){ return FileIO::ReadBufferAsync(file); }).then([this, m_d2dContext](concurrency::task previousOperation) {... }

// In Direct2D/DirectWrite, manipulating text is // equivalent to manipulating bitmaps // Set up scale, rotation & translation transforms // These can be animated each frame D2D1::Matrix3x2F r = D2D1::Matrix3x2F::Rotation(angle); D2D1::Matrix3x2F s = D2D1::Matrix3x2F::Scale(scale.x, scale.y); D2D1::Matrix3X2F t = D2D1::Matrix3X2F::Translate(x, y); m_d2dContext.SetTransform(s*r*t); // If bitmap m_d2dContext->DrawBitmap(bitmap.Get(), args); // If text m_textLayout.Get()->Draw(m_d2dContext, args);