【计算机图形学划重点】第一讲-Pipeline and Introduction

基础知识

Vertex(顶点)

define the location of primitives in space, and consists of vertex stream.

顶点用于定义空间中基本图形(primitives)的位置。它包含了一个顶点流(vertex stream),通常这个顶点流包含了多个顶点。每个顶点包括了定义其在三维空间中位置的坐标信息,以及可能包括颜色、纹理坐标和法线等其他属性。

Primitive

  1. the result of the interpretation of a vertex stream, as part of Primitive Assembly 作为图元装配(Primitive Assembly)的一部分,图元是顶点流解释的结果。简单地说,图元是由顶点通过特定的规则连接起来形成的基本图形,如点、线和三角形。

  2. the interpretation scheme used by opengl to determine what a stream of vertices represents when being rendered. 在OpenGL中,图元也指定了如何解释顶点流来渲染。OpenGL根据定义的图元类型(例如点、线段、三角形)来决定如何将一连串的顶点组合成图形。

Fragment

a fragment is a collection of values produced by the Rasterization. Each fragment represents a sample-sized segment of a rasterized primitive. 片元是光栅化(Rasterization)过程产生的值的集合。每个片元代表了光栅化图元的一个样本大小的部分。 片元包含了用于最终像素颜色计算的所有数据,比如颜色、深度以及其他可能的属性。在图形管线中,片元着色器(Fragment Shader)会处理这些片元,以生成最终在屏幕上显示的像素颜色。

Graphics Pipeline

There are three stages

• Application Stage

• Geometry Stage

• Rasterization Stage

Viewing process 视图处理过程

• Transform into camera coordinates.

• Perform projection into view volume.

Clip geometry outside the view volume.

• Perform Perspective-division into NDC.

Remove hidden surfaces

Local space -> world space -> camera space -> clipping space -> NDC -> viewport

1 Zooming

Adjusting the viewport can implement zooming 调整视口大小和位置可以实现缩放功能。缩放时,你实际上是改变了最终图像在屏幕上显示的尺寸。

Adjusting the clipping window can implement broadening or shrinking what we see 调整裁剪窗口(即在裁剪空间中决定哪些部分是可见的)可以实现对可见场景的扩大或缩小,从而改变用户看到的场景范围。

2 View Volume

术语“view volume”(视图体积)和“clipping volume”(裁剪体积)通常可以视为相同的概念,在某些情况下可以互换使用。

2.1 Orthographic view volume

• Preserves both distances and angles

• Shapes preserved

• Can be used for measurements

  • Building plans

  • Manuals

• Cannot see what object really looks like because many surfaces are hidden from view

• Often we add isometric

2.2 Perspective view volume

• Objects further from viewer are projected smaller than the same sized objects closer to the viewer (diminution) • Looks realistic

• Equal distances along a line are not projected into equal distances (nonuniform foreshortening)

• Angles preserved only in planes parallel to the projection plane

• More difficult to construct by hand than parallel projections (but not more difficult by computer)

3 Normalized Device coordinates (NDC)

4 Geometry vs Topology

geometry: locations of the vertices

topology: organization of the vertices and edges

Topology holds even if geometry changes.

Solid modeling

Surfaced based & volume based

1 Surface based

1.1 Mesh Based 边界表示(Boundary Representation, B-rep)

The size and shape is defined by the faces, edges and vertices which consists of its boundary.

(low-dimensional elements)

Pros: flexible and computers can render them quickly. The vast majority of 3D models today are built as textured polygonal models

Cons: polygons are planar and need approximate curved surfaces using many polygons, representation is not unique

很难闭合

1.2 Constructive solid geometry(CSG) 构造实体几何

A solid is defined as the result of a sequence of regularized Boolean operations.

• Pros: Computer-Aided Manufacturing: a brick with a hole drilled through it is represented as “just

that” and CSG can easily assure that objects are “solid” or water-tight

• Cons: Relationships between objects might be very complex (search the entire tree) Real world objects may get very complex

2 Volume based

Spatial decomposition: voxel octree BSP 体素(voxels)、八叉树(octree)和二叉空间分割(Binary Space Partitioning, BSP)等技术

2.1 Voxels: a volume element

Pros:

• Modelling continues phenomena: medicine, geology, body, etc.

• Regular data

• Easy to compute volume, make slices

Cons:

• Massive data for high resolution

• The surface is always somehow “rough”

3 Point based

3.1 Point cloud

• Easily accessed with laser scanning, range camera or

stereo image matching

• No connectivity

• Widely used!

GLSL

1 Vertex shader

• Transform vertices

• Model, View and projection transformations

• Custom transformation

  • Morphing

  • Wave motion

• Lighting

• Color

• Normal

• Other per-vertex properties

顶点着色器可以执行多种任务,比如变换顶点的位置、处理顶点的颜色和纹理坐标、计算光照等。

通常,它会将顶点从一个坐标系统转换到另一个坐标系统,例如从模型坐标转换到视图坐标。

2 Fragment shader

• Compute the color of a fragment/pixel

• The input data is from rasterization and textures and other values

确定每个片元的最终颜色和其他属性。这个过程可能包括纹理映射、光照和阴影计算、颜色混合等。

3 VAO VBO EBO

  1. VAO(顶点数组对象,Vertex Array Object):

    1. VAO是一个对象,它存储了所有的顶点属性状态(如顶点属性的布局)和与这些属性相关的VBO

    2. 使用VAO的目的是为了保存顶点属性的配置和数据源。当配置顶点属性指针时,这些配置会存储在当前绑定的VAO中。

    3. 在渲染时,只需绑定相应的VAO,就可以使用其中的顶点属性配置和数据。

  2. VBO(顶点缓冲对象,Vertex Buffer Object):

    1. VBO用于在GPU内存中存储大量顶点的数据,如顶点坐标、纹理坐标、法线、颜色等。

    2. VBO的使用可以大幅减少CPU到GPU的通信,提高渲染效率,因为顶点数据可以在渲染之前发送到GPU,然后在渲染时直接从GPU内存中获取。

    3. 在使用VBO时,顶点数据只需上传一次到GPU,之后可以多次用于渲染,这对于动画和复杂场景渲染非常有效。

  3. EBO(元素缓冲对象,Element Buffer Object):

    1. EBO也称为索引缓冲对象(Index Buffer Object),用于存储顶点索引

    2. 使用EBO可以重用顶点数据,定义哪些顶点会组成一个图元(如三角形)。这样,相同的顶点可以被多次引用,减少了内存的使用和数据传输。

    3. EBO通常与VBO一起使用,VBO存储顶点数据,EBO存储构成图元的顶点索引。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/324853.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

数字藏品如何赋能线下实体?以 BOOMSHAKE 潮流夜店为例

此篇为报告内容精华版,更多详细精彩内容请点击 完整版 在数字化浪潮的推动下,品牌和企业正在迎来一场前所未有的变革。传统市场营销策略逐渐让位于新兴技术,特别是非同质化代币(NFT)的应用。这些技术不仅改变了品牌资…

D-Link DES-108 交换机

D-Link DES-108 交换机 1. 百兆交换机 8 口References ​ D-Link Corporation is a Taiwanese multinational networking equipment manufacturing corporation headquartered in Taipei, Taiwan. Taiwanese:adj. 台湾的 n. 台湾人 headquarter [hedkwɔ:tə]&#…

计算机基础知识——数据的表示概述

目录 1 进制转换 1.1 二进制、十进制和十六进制等常用数制及其相互转换 1.2 十进制和二进制之间转换 1.3 二进制数与八进制数、十六进制数之间的转换 2 码值:原码、反码、补码 2.1 原码 2.2 反码 2.3 补码 3 浮点数表示 3.1 浮点数的运算 1 进制转换 1…

【mac-m1 docker 安装upload-labs靶场】

1.搜索upload-labs docker search upload-labs 2.下载upload-labs docker pull c0ny1/upload-labs 3.启动 docker run -it -d --name uploadlabs -p 80:80 c0ny1/upload-labs --platform linux/amd64 4.访问127.0.0.1:80 注意点:后续使用的时候会报错 需要手动创…

selenium 用webdriver.Chrome 访问网页闪退解决方案

1.1.1. 解决方案: 1.1.1.1. 移动插件到谷歌的安装目录下 1.1.1.2. 设置环境变量 1.1.1.3. 重启电脑检查成功 解决时间:5min

J2 - ResNet-50v2实战

🍨 本文为🔗365天深度学习训练营 中的学习记录博客🍖 原作者:K同学啊 | 接辅导、项目定制 目录 环境步骤环境设置数据准备图像信息查看 模型设计ResidualBlock块stack堆叠resnet50v2模型 模型训练模型效果展示 总结与心得体会 环境…

CommonJS 和 ES6 Module:一场模块规范的对决(下)

🤍 前端开发工程师(主业)、技术博主(副业)、已过CET6 🍨 阿珊和她的猫_CSDN个人主页 🕠 牛客高级专题作者、在牛客打造高质量专栏《前端面试必备》 🍚 蓝桥云课签约作者、已在蓝桥云…

OpenAI 拟每年投入 100-500 万美元,以获取新闻使用许可

最近两位媒体公司高层透露,OpenAI正积极与新闻出版公司进行谈判,提出每年投入100万至500万美元的费用,以获取将新闻文章用于训练大型语言模型的授权。 OpenAI目前正与大约十几家媒体公司进行谈判,但有报道称,即使对于…

免费部署私人 ChatGPT的项目:LobeChat 14K+

前言 随着ChatGPT的快速风靡,所有人都对AI高度关注,那么你想不想部署一个属于自己的私人ChatGPT,用更美观,更高效,更好玩的方式来体验AI呢? 今天我们推荐的就是可以帮你实现在本地部署私人ChatGPT&#x…

软件测试|一篇文章带你深入理解SQL约束

深入理解SQL约束:保障数据完整性和一致性的重要工具 SQL约束是在关系型数据库中用于保障数据完整性和一致性的重要工具。本文将深入探讨SQL约束的概念、类型以及应用,以帮助读者更好地理解和使用SQL约束来确保数据库中的数据质量。 SQL约束 约束&…

Vue中break关键字

Change() {//每次触发该事件,都要讲data重新赋值一次this.data JSON.parse(JSON.stringify(this.data1));// 根据选中的等级更新数据switch (this.selectedlevel) {case 1:// 更新数据为一级数据this.data this.data.filter(item > item.level "1"…

炫酷的倒计时引导页

文章目录 文件分布介绍效果预览代码css样式Locationplayer.css js样式player.js 文件分布介绍 效果预览 代码 css样式 Location html {height: 100%;}body {font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", Tahoma, "Hirag…