ZKX'S Blogs
  • ZKX'S BLOG
  • action
    • road-map
    • todo-list
    • temp
  • 游戏技术
    • 物理
    • algorithm
      • obstacle-avoidance
      • path-finding
    • Assets
      • 解包资源
      • Sound
      • text
      • 动画
      • image
        • image-tools
        • maple-story
        • 项目图
        • SD
        • AI
          • ai-model
          • Novel ai
          • transformer
          • ComfyUI
            • start
          • sd
            • four-view
            • image-assets
            • icon
              • working-flow
            • tutorials
              • introduction
              • model-traning
        • ui
          • ui-todo
          • work
          • ui-tutorials
            • 一颗豆Studio
            • image-process
              • 8-minute
              • 1. 现代图形绘制流水导论
            • xiao-long-bao
              • game-ui
              • ps-skill
      • model
        • Houdini
        • Blender
          • animation
          • 配合 Unity 建模流程
          • common-use
          • Blender 配置
          • plugins
          • Words
          • tutorials
            • Imphenzia
            • blender-4.0
              • 建模篇
              • 10. role-anim
              • 11. room-anim
              • 2. lighting
              • 3. material
              • 场景动画
              • 5. item-animation
              • 6. engrave
              • 7. role
              • 8. face
              • 9. bone
      • vfx
        • vfx-assets
        • vfx
      • 视频录制
    • README_冲突文件_zkx_20240828215908
      • 计算机科学
      • 代码写法
        • functional-programming
        • programing-driven
      • data-structure
        • tree
      • multi-threads
        • consistent-hash
        • I/O 多路复用
        • reactor-proactor
        • zero-copy
      • 操作系统
        • cpu-cache_冲突文件_zkx_20240828215908
        • soa_冲突文件_zkx_20240828215908
        • memory
          • memory-allocation
          • memory-recycle_冲突文件_zkx_20240828215908
          • 预读机制
          • virtual-memory_冲突文件_zkx_20240828215908
        • 进程线程
          • base_冲突文件_zkx_20240828215908
          • communicate_冲突文件_zkx_20240828215908
    • 笔记
      • Bevy 引擎研究
      • render-pass
      • usd
      • Interview
      • breaking
        • multi-threads
      • GPU
        • multi-threads
        • DirectX 12 3D 游戏开发实战
        • Analyze
        • vulkan
          • Vulkan 应用
          • Vulkan 坐标系
          • Vulkan 创建 CubeMap
          • 渲染器流程
          • Vulkan 对象
          • vulkan-learn
            • Vulkan tutorials
              • Comparison of graphics apis
              • Official Vulkan Tutorial
              • brendan-galea
                • Vulkan Game Enggine
              • Vulkan-lecture-series
                • Vulkan Essentials
                • Swap chain
                • 03. Resources & Descriptors
                • Commands and Command Buffers
                • pipeline and stages
                • 07. Synchronization
      • projects
        • fbx
        • 动画
          • animation-graphs_冲突文件_zkx_20240828215918
          • animation-programming-basics_冲突文件_zkx_20240828215918
          • README_冲突文件_zkx_20240828215918
            • 1. Intro to Physics-Based Animation_冲突文件_zkx_20240828215918
            • Vector
            • 3. Rigid body dynamic_冲突文件_zkx_20240828215918
            • 4.Rigid Contacts_冲突文件_zkx_20240828215918
            • 5.Cloth Simulation_冲突文件_zkx_20240828215918
          • arm
            • 1. Introduction to Character Animation_冲突文件_zkx_20240828215918
          • 程序动画
            • 程序动画
        • GLTF
          • 皮肤
        • 网格生成
          • Mesh Gen
          • 网格
          • 程序化地形
          • games-202-几何建模和处理
            • 1. 课程介绍
            • 2. 数据拟合
      • 渲染
        • 渲染器
        • 管线和引擎
          • 颜色空间
          • 法线映射
          • Render Graph
          • 渲染管线
        • 游戏引擎
          • font
          • gpu-instance
          • 光照纹理
          • 光线追踪
          • 蒙皮动画
          • Skybox
          • 文字
          • texture-compress
          • UI
          • view-port-mode_冲突文件_zkx_20240828215919
          • 虚拟纹理
        • performance
          • HLOD
          • tools
        • controller
          • 2d 后处理和光照
          • 抗锯齿
          • buffer
          • 延时渲染
          • hclip
          • 后处理
          • 阴影
          • transparency
          • culling
            • Culling
            • hiz
        • 技术美术
          • 艺术表达
            • 各向异性
            • 一些特效
            • 非真实感渲染(卡通渲染)
            • Outline
            • 次表面散射
            • Tone Mapping
          • Filament 渲染器里的算法
            • 2 Overview
            • Notation
            • 4 Material System
            • 5. Lighting
          • 自然模拟
            • BRDF
            • 全局光照 GI
            • 光照
            • 物理真实的渲染
            • Blogs
            • 反射
            • UE 中的物理光照系统
            • 体渲染
            • water
            • 天气系统
        • 渲染教程
          • apex-legends-mobile
          • Shader 入门精要笔记
          • 庄懂-美术向 TA 课程
          • games-202
            • Introduction and Overview
            • Real-Time Physically-Based Materials
            • real-time-physically-based-materials-2
            • 实时光线追踪 1
            • 实时光线追踪 2
            • A Glimpse of Industrial Solusion
            • 2. Recap of CG Basics
            • Real time Shadows 1
            • Real time shadows 2
            • 实时环境光 上
            • 实时环境光 下
            • 实时全局光照 1
            • 实时全局光照 2
            • Realtime global illumination 3
      • 渲染笔记
      • tutorials
        • mobile-optimize
        • modern-mobile-rendering-note
        • README_冲突文件_zkx_20240828215908
          • 7. 游戏循环及实时模拟_冲突文件_zkx_20240828215908
          • multi-threads
          • multi-threads
          • 12. 碰撞和刚体动力学
          • multi-threads
          • cargo-mobile
          • 15. 运行时游戏性基础系统
          • multi-threads
          • C/ C++ 的数据、代码及内存
          • 4. 游戏所需要的三维数学
          • 5. 游戏支持系统_冲突文件_zkx_20240828215908
          • base
          • cargo-mobile
          • projects
          • multi-threads
        • GAMES104-现代游戏引擎: 从入门到实践
          • 第一节:游戏引擎导论
          • 第二节:引擎架构分层
          • 第三节:如何构建游戏世界
          • 第四节:游戏引擎中的渲染实现
          • 第五节:光和材质
          • 第六节:游戏中大气和云的渲染
          • 第七课:游戏中渲染管线、后处理和其他
          • 第八课:引擎中的动画技术基础
          • Advanced Animation Technology
          • Physics System
          • 物理系统应用
          • 粒子系统和音效系统
          • 玩法
          • 基础 AI 上
          • 基础 AI 下
          • 高级 AI 上
          • 高级 AI 下 Machine Learning
          • 网络架构基础 上
          • 网络架构基础 下
          • 网络架构进阶 上
          • 网络架构进阶 下
          • Data-Oriented Programming and Job System 面向数据编程
          • Data Oriented 下
          • 动态全局光照和 Luman
          • 全局光照和 lumen 下
          • GPU-Driven Geometry pipeline - Nanite
          • Nanite - 2
        • games-106
          • multi-threads
          • 2. 图形绘制流水的基本原理和实践 (1)
          • 3. 图形绘制流水的基本原理和实践 (2)
          • 4. 图形绘制流水的基本原理和实践 (3)
          • 绘制管线中的计算频率
          • 6. 性能分析
    • game-ai
      • game-ai-book
      • behaviour
      • base
      • goap
      • sli97
    • 游戏设计
      • battle-system
      • 新手引导
      • character-controller
      • game-designer-books
      • game-theory
      • 关卡策划
      • 模块化设计
      • simple-note
      • player-behaviour
      • skill
      • 缝合怪和肉鸽
      • 顶视角
      • tps-vs-fps
      • 策划实用网站
      • culture
      • 游戏数值
        • battle-numerical
        • 战斗数值
        • 装备数值
      • 游戏设计教程
        • 超简短的独立游戏开发教学第一季
        • 超简短的独立游戏开发教学第二季
        • zelda-phisics-sound
    • 游戏引擎编程语言
      • english
      • CPP
        • cmake-tutorial
        • 编译
        • 包管理
        • cpp 工程结构
        • 智能指针
      • C#
        • GC
        • Web
        • 语言执行原理
        • weak-reference_冲突文件_zkx_20240828215917
      • Rust
        • base
        • cargo
        • macro
        • Rust android
        • rust-async_冲突文件_zkx_20240828215917
        • 跨平台
        • FFI
        • 文件操作
        • Rust Macros
        • Rust 内存管理
        • Rust Option 和 Result 的处理
        • Rust 中的引用
        • Rust 正则表达式
        • 学习 Rust
          • Rust 笔记
        • 使用 Rust 写 Vulkan
          • 开源中间件和项目
          • Rust 光线追踪
    • 数学
      • Fractal
      • 机器学习
      • 元胞自动机
      • 曲线
      • 半球积分
      • 线性代数的本质
      • 低差异序列
      • 噪声
      • 四元数
      • 有向距离场
      • 空间变换
      • 球谐函数
      • physics
        • Games 401
        • soft-body
  • 游戏
    • 赛博朋克 2077
    • 艾尔登法环
    • 密室逃脱
    • 日式
    • 冒险岛国际服
    • no-oxygen
    • oil-game
    • text-game
  • 工具
    • shell
    • 博客搭建
      • 基础
      • 美化
      • 使用 Markdown 做博客
      • my-blogs
    • controller
      • sofunny
    • 游戏引擎使用
      • 虚幻引擎
      • Unity
        • plugins
        • client
          • life-time
          • 网络
          • weixin
          • 3c
            • input
            • animator
              • Reference
            • games-105-计算机角色动画基础
              • Motion
            • golden-rush
              • cargo-mobile
              • 工程技术
            • input
              • input-system
          • 代码
            • 协程
            • 事件系统
            • 游戏框架
            • projects
              • JobSystem
              • unitask
          • DOTS
            • ai_冲突文件_zkx_20240828215923
            • Entity component system
            • errors_冲突文件_zkx_20240828215923
            • SubScene
            • ecs-sample-note
              • advance
              • bake
              • base-practice
              • graphical
              • render
              • resource
          • Unity 编辑器使用技巧
            • 自定义模块
            • 下载
            • android
              • 调试安卓机
              • install-apk
            • Unity 工具
              • Editor UI
              • OnGUI
          • memory
            • 安卓内存
            • Unity 内存分布
            • native-memory
          • performance
            • accelerate
            • game-performance-note
            • performance-optimize
            • plugins
          • Unity UI
            • 设计
            • layout
            • shader-ui
            • Reference
        • others
          • Mod for Unity Game
          • weixin-game
          • xr
          • interview
            • junior-unity-client_冲突文件_zkx_20240828215923
          • 会议笔记
            • Unity 开放日 - 厦门分享总结
          • render-pipeline
            • ET Framework
            • DOTS-training-samples
              • 蚂蚁模拟
            • ECSSample
              • Advanced
              • Boids
              • hellocube_冲突文件_zkx_20240828215923
        • render
          • baking
          • gpu-driven
          • 粒子系统
          • Visual Effect Graph
          • 渲染管线
            • batch-render-group
            • inverse-z
            • platform-shader
            • scriptable-renderer
            • Universal Render Pipeline
            • HDRP
              • HDRP 中的 Anti-Aliasing
              • HDRP 自定义渲染阶段
              • 曝光
              • Lit 光照
              • SimpleLit
            • SRP
              • SRP Batch
              • SRP 概览
          • Unity shader 使用
            • Compute Shader
            • Draw Procedural
            • macro
            • 顶点坐标
            • Shader graph
            • 着色器语法
            • variant
            • Shader 预热
        • 资源管理
          • Addressable
          • config
          • 商业化的资源管理和热更新
          • AssetBundle
            • problems
            • skills
            • tutorials
          • asset
            • asset-live-time
            • Asset 简介
    • Git 进阶使用
      • git 常用方法
      • Git 使用出问题时的解决办法
      • git-submodule
      • basic
        • Git 基础
        • Github
        • Git 同步
    • IDE
      • Rider
      • 主题
    • 语法格式
      • 正则化
    • Windows
      • Windows 应用
由 GitBook 提供支持
在本页
  • Participants of Rendering Computation
  • The Rendering Equation
  • Three Main Challenges
  • Simple Light Solution
  • Simple Light
  • Environment Map Reflection
  • Blinn-Phone Materials
  • ShadowMap
  • Basic Shading Solution
  • Precompute global illumination
  • Physicaly base rendering (PBR)
  • Microfacet Theory 微表面理论
  • BRDF Model Based on Microfacet
  • Normal Distribution Function : D 法线分布函数,表示高光强度曲线
  • Geometric attenuation term (self-shadowing) :G,几何遮挡,表示能量损失
  • Fresnel Equation :
  • Physical Measured Material 实际上去测量真实物理材质的 BRDF
  • Disney Principled BRDF 迪士尼原则的 BRDF 模型
  • PBR Specular Glossiness
  • PBR Metallic Roughness
  • PBR Pipeline MR vs SG
  • Image-Based Lighting(IBL) 基于图像的光照
  • Basic Idea of IBL
  • Diffuse Irradiance Map
  • Specular
  • Quick shading with precomputation
  • Classis Shadow Solution
  • Big World and Cascade Shadow
  • Hard Shadow vs Realistic Shadow
  • Summary of Popular AAA Rendering
  • Moving Wave of High Quality
  • More Complex Material Model
  • Virtual Shadow Maps
  • Ocean of Shader
  • Cross Platform Shader Compile
  • Pilot Engine

这有帮助吗?

在GitHub上编辑
  1. 游戏技术
  2. 笔记
  3. tutorials
  4. GAMES104-现代游戏引擎: 从入门到实践

第五节:光和材质

上一页第四节:游戏引擎中的渲染实现下一页第六节:游戏中大气和云的渲染

最后更新于8个月前

这有帮助吗?

Participants of Rendering Computation

The Rendering Equation

image-20220413220314499

实时解渲染方程

Three Main Challenges

  • Light Challenges 光的表现

    • visibility to Lights

    • Light Source Complex

  • How to do Integral Efficiently on Hardware 对光的积分

  • Any matter will be light source 全局光照

    • Indirect illumination

    • Global illumination

Simple Light Solution

Simple Light

  • Using simple light source as main light

  • Using ambient light to hack others

  • Supported in graphics API

Environment Map Reflection

  • Using environment map to enhance glossary surface reflection

  • Using environment mipmap to represent roughness of surface

Blinn-Phone Materials

  • 基于光叠加原理,光的线性叠加

  • 漫反射 + 高光 + 环境光

  • 能量不守恒

    • Unstable in ray-tracing

    • non-energy conserving

  • 无法表达真实材质

    • 都是塑料质感

ShadowMap

  • 使用纹理记录距离光源最近像素的深度

  • Resolution limit ,纹理精度导致阴影锯齿

  • Depth precision ,自遮挡,加 bias 和提高纹理精度解决

Basic Shading Solution

  • Simple light + Ambient

    • dominent light solves

    • ambient and EnvMap solve

  • Blinn-Phong material

  • Shadow map

Precompute global illumination

  • 空间换时间

  • Good compression rate,存储百万个 probes

  • do integration with material function

  • Fourier Transform 傅里叶变换

    • 任何频谱都是不同频率的波长的叠加,

    • 图片由时域转到频域,去掉高频信息或低频信息,再转回时域,能对图片保留相应信息

  • Convolution Theorem 卷积

  • Spherial Harmonics 球谐函数

    • 1阶 SH 只需要 9 个值,压缩后是 4 Bytes 就能存储一个 Diffuse 光场

  • SH Lightmap :Precomputed GI

    • LightMap 是预计算的,对静态物体的表面的每个点的环境光照存储

    • 基于上面 SH 的理论,规定 LIghtMap 中一个 4 Bytes 颜色块定义了空间中的一个静态物体表面中的一个点接收到的全局光照

    • 全局静态物体的表面需要二维展开到 LightMap 上,所以 LightMap 也是一个 Altas

  • Light Probe: Probes In Game Space

    • Probe 在玩家感知强的地方,在环境光变换大的地方密集

    • LightProbe 可以看作定义在 3 维空间的 LightMap,但不需要逐像素体素,所以可以实时预计算

    • LIght Probe Point Generation 工业上需要自动化生成 LIghtProbe 采样点

    • Reflection Probe:反射探针可以看作高精度的,做了范围限定的 LightProbe

  • 现代游戏入射光

    • 直接光照:光源类型 + shadowmap

    • 静态间接光照:LightMap

    • 实时间接光照:LightProbe,Reflection Probe

    • 后处理光照:SSAO,SSR

Physicaly base rendering (PBR)

Microfacet Theory 微表面理论

BRDF Model Based on Microfacet

  • 常用 GGX 模型

Normal Distribution Function : D 法线分布函数,表示高光强度曲线

  • 相比 Phone 高光,高频波峰足够抖,高光逐渐消失的时候是柔和过度

Geometric attenuation term (self-shadowing) :G,几何遮挡,表示能量损失

Fresnel Equation :

F 菲涅尔现象,视线越垂直,折射越明显,反之反射越明显

Physical Measured Material 实际上去测量真实物理材质的 BRDF

Disney Principled BRDF 迪士尼原则的 BRDF 模型

  • 每个参数必须符合迪士尼原则

  • 参数需要尽可能的少

  • 数值参数需要归一化到在 0 ~ 1

  • 参数的任意组合不能出现 BUG

  • 引擎不是真实世界模拟器,而是游戏程序创造工具

  • Disney Principle Material Parameters 迪士尼材质参数

PBR Specular Glossiness

SG 模型,全部参数都用纹理表达

PBR Metallic Roughness

convert MR to SG,MR 是对于 SG 的封装,依赖 SG,参数相对 SG 对艺术家更友好

PBR Pipeline MR vs SG

MR 在金属与非金属过度容易出现白边

Image-Based Lighting(IBL) 基于图像的光照

Basic Idea of IBL

cube map,提前预处理环境光

Diffuse Irradiance Map

提前知道卷积,模糊的结果

Specular

  • 使用 MipMap 存储不同粗糙度的 Specular

  • LUT,提前存储这个 BRDF roughness 和 cosθ 的关系

Quick shading with precomputation

Classis Shadow Solution

Big World and Cascade Shadow

级联阴影,视线所达到的地方,用多张 ShadowMap 表示,分辨率一样,表示的范围越来越大,精度越来越低

阴影是渲染管线中的最耗时的部分,场景中每个物体需要重画,同时存储量高

Hard Shadow vs Realistic Shadow

软阴影

  • Percentage Closer Soft Shadow , PCF

  • PCSS

  • Variance Soft Shadow Map

Summary of Popular AAA Rendering

  • LIghtmap + Lightprobe

  • PBR + IBL

  • Cascade shadow + VSSM

Moving Wave of High Quality

  • quick evolving of GPU

  • Real-Time Ray-Tracing on GPU

  • Real-Time Global Illumination

    • SCreen-space GI

    • SDF Based GI

    • Voxel-Based GI (SVOGI / VXGI)

    • RSM / RTX GI

More Complex Material Model

  • BSDF (Strand-based hair)

  • BSSRDF

Virtual Shadow Maps

ue5 的方法,平均分布 Shadow Map ,动态加载

Ocean of Shader

  • 海量的不同的 Shader

  • Artist Create Infinite More Shaders

  • Uber Shader and Variants 使用宏定义产生不同的 Shader

Cross Platform Shader Compile

同一个 shader 可能可以编译到不同的 Graphics API

Pilot Engine

image-20220414184304102
image-20220414184837548
image-20220414185056386
image-20220414190145246
image-20220414190714663
image-20220415103912206
image-20220415104120942
image-20220415104525286