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 提供支持
在本页
  • 地形概述
  • Environment Components in Games
  • Terrain Rendering
  • 地形的几何
  • Heightfield 高度图,地形渲染的主力
  • 使用 Mesh Grid 生成网格
  • Triangle-Based Subdivision 三角形抛分算法
  • QuadTree-Based Subdivision 基于四叉树的地形表达
  • Triangulated Irregular Network (TIN)
  • GPU-Based Tessellation
  • Real-Time Deformable Terrain
  • Non-Heightfield Terrain
  • Volumetric Representation
  • Terrain Materials
  • Sampling from Material Texture Array
  • Parallax and Displacement Mapping
  • Expensive Material Blending
  • Virtual Texture
  • VT Implementation, DirectStorage & DMA
  • Floating-point Precision Error
  • 植被道路贴花
  • Tree Rendering
  • Decorator Rendering
  • Road and Decals Rendering
  • Procedure Terrain Creation
  • Atmosphere 大气散射
  • Analytic Atmosphere Appearance Modeling
  • Participating Media
  • How Light Interacts with Participating Media
  • Volume Rendering Equation
  • Real Physics in Atmosphere
  • Scattering Types
  • Variant Air Molecules Absorption
  • Single Scattering vs Multi Scattering
  • Ray Marching
  • Precomputed Atmospheric Scattering
  • Production Friendly Quick Sky and Atmosphere Rendering
  • 云的渲染
  • Cloud Type
  • Present Cloud

这有帮助吗?

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

第六节:游戏中大气和云的渲染

上一页第五节:光和材质下一页第七课:游戏中渲染管线、后处理和其他

最后更新于8个月前

这有帮助吗?

地形概述

Environment Components in Games

  • Sky and Cloud

  • Vegetation

  • Terrain

Terrain Rendering

地形的几何

Heightfield 高度图,地形渲染的主力

  • Height Map

  • Contour Map

  • Expressive Heightfield Terrains

使用 Mesh Grid 生成网格

  • Lod 近处密,远处稀疏

  • Adaptive Mesh Tessellation 网格细分

  • 当 FOV 越来越窄的时候,地面在屏幕上显示的会越来越大,所以网格远处的精度需要相应的增大。

  • Two Golden Rules of Optimizatioin

  • View-dependent error bounds

    • Distance to camera and fov

    • Error compare to ground truth

Triangle-Based Subdivision 三角形抛分算法

  • 正方形网格用四个等腰直角三角形组成

  • 永远切分等腰直角三角形最长一边

T-Junction

  • 相邻三角形需要切分的同样密,来防止裂边

summary

  • 使用无 T 分裂的等腰直角三角形组合成地形

  • 但是实际上游戏上用的不多

  • 效率、绘制都没有问题

  • 但是作为地形数据和保存,地形数据的序列化需要使用另外一种格式,反序列化后的渲染可以用这种格式

QuadTree-Based Subdivision 基于四叉树的地形表达

  • 最大范围有个上线,不会完全归一,比如 512 * 512 米

  • 用磁盘上的一块区域,比如一张纹理来表达

  • 这个地形数据组织是场景地形和资源管理的总和,可以搭配上上方三角形网格生成方案来渲染

Solving T-Junctions among Quad Grids

Stitching

四叉树管理的地形数据反序列化成为不同密度的三角形。为了保持连续,可以使用 Stitching 方法,退化密度高的三角形,出现面积为 0 的三角形。来粘合不同密度的地块解决 T-junction 问题。

Triangulated Irregular Network (TIN)

  • 直接从高度图生成三角形后,通过三角形简化生成三角形数量很少的地形

  • 根据游戏内容的不同,需要使用不同的算法

GPU-Based Tessellation

  • 借助 GPU 来程序化生成 LOD 地形

  • 即渐变的网格密度变化

  • Mesh Shader Pipeline DX12 以上

Real-Time Deformable Terrain

  • 实时的可变形的地形

  • 可以做出泥土,雪地的凹陷

  • 地型变化的效果,物理碰撞的更新更难做

Non-Heightfield Terrain

  • 不基于高度图的地型

  • 比如悬崖,洞穴,一般使用放置物体在上面,不属于地形一部分,属于场景一部分

  • 可以去掉地型上三角形的顶点,让 GPU 不渲染周围三角形,用物体填充来弥补

Volumetric Representation

基于体素的表示

Marching Cube

空间上划分体素,每一个体素里大概总共可能会有 15 种不同的近似平面,每个体素用一个字节的数据记录近似平面的表示的编号。

Transition Cell Lookup Table

Transvoxel Algorithm, voxel 也可以做 LOD

基于 volumetric 的表达,在未来有希望做出纯动态地型

Terrain Materials

材质混合

Simple Texture Splatting

简单的 Alpha 混合,并不自然

Advanced Texture Splatting

叠加高度后的混合

叠加 Bias,一点小 Hack

Sampling from Material Texture Array

  • 和 3D Texture 不一样,3D Texture 的采样需要三线性插值的采样。

  • Texture Array 每层之间没关系,是 Texture Index + 双线性插值采样

  • 使用 IndexMap + TextureArray 采样地面纹理

Parallax and Displacement Mapping

  • Color Mapping : Albedo 着色

  • Bump Mapping 法线纹理影响光照模型

  • Parallax Mapping 视差贴图 :使用 Ray Martching 的方式着色表面,出现遮挡

  • Displacement Mapping 曲面细分 :完全和细化网格是一致的

Expensive Material Blending

昂贵的材质混合

  • Many Texturing ,每个像素大量的 Texture Array 纹理采样和线性插值

  • Huge Splat map ,加载了很大张的纹理,但是大部分的像素是用不到的

Virtual Texture

最主流的地型绘制方案

VT Implementation, DirectStorage & DMA

  • CPU,内存,显卡,硬盘之间的数据交互

  • 现在一般是 CPU 调度内存和显存

  • 次世代的 DMA 可以支持硬盘和显存

Floating-point Precision Error

浮点数在大数字时,小数部分变短,精度变低

  • Camera-Relative Rendering ,基于摄像机空间的渲染运算,标准做法

  • SubLevel,基于子场景空间坐标系的渲染运算

植被道路贴花

Tree Rendering

Speed Tree ,植被渲染中间件

Decorator Rendering

Road and Decals Rendering

场景中的细节可以预烘培进入 Virtual Texture

Procedure Terrain Creation

Atmosphere 大气散射

Analytic Atmosphere Appearance Modeling

使用经验公式去拟合大气散射现象

Participating Media

How Light Interacts with Participating Media

大气散射通过一个介质分为四个阶段

Volume Rendering Equation

  • Transmittance :光线被介质的衰减

  • Increase factor :光线进入眼睛的能量

Real Physics in Atmosphere

  1. 太阳光是由不同波长即不同颜色的光线组合而成的白色

Scattering Types

Rayleigh Scattering 瑞丽散射

  • 介质直径小,光线波长越短散射越厉害

  • 蓝紫光波长短

  • 拟合方程

  • Rayleigh Scattering Equation

Mie scattering 米式散射

  • 散射对光的波长不敏感

  • 雾 Fog,光晕 Halo of Sun

  • Mie Scattering Equation

Variant Air Molecules Absorption

大气的吸收效应

  • 臭氧

  • 甲烷

Single Scattering vs Multi Scattering

Ray Marching

沿着视线的方向,对太阳光的积分

Precomputed Atmospheric Scattering

Challenges of Precomputed Atmospheric Scattering

  • Precomputation Cost

  • Authoring and Dynamic Adjustment of Environments

  • Runtime Rendering Cost

Production Friendly Quick Sky and Atmosphere Rendering

  • Simplify Multi-scattering Assumption

  • 假设对于空间上某个点四面八方的入射光是均匀的

  • Fixed view position and sum position to remove 2 dimensions out of LUT

  • Generated a 3D LUT to evaluate aerial-perspective effects by ray marching

云的渲染

Cloud Type

Present Cloud

  • Mesh-Based Cloud Modeling

  • Billboard Cloud

  • Volumetric Cloud Modeling

    • Weather Texture 存云的厚度

    • Noise Functions

    • Perlin Noise 棉花丝感觉

    • Worley Noise 泡泡感觉

    • Cloud Density Model

    • Rendering Cloud by Ray Marching

image-20220426214615701
image-20220426215321576
image-20220426220351731
image-20220426221350523
image-20220426221512303
image-20220426224113535
image-20220426224501295
image-20220426231148570
image-20220426231437730
image-20220426231351002
image-20220426231649827
image-20220426232055558
image-20220426234404170
image-20220427000307667
image-20220427000426246
image-20220427000733087
image-20220427225019614
image-20220427225255363
image-20220427231309822
image-20220427231524677

image-20220427232916397
image-20220427233253363
image-20220427233606867
image-20220429154220247
image-20220506101713410
image-20220506104023361