返回「计算机、信息技术与工程」

CubeMap & Skybox

更多
Markdown 结构化数据
本文目录 11 个章节

CubeMap & Skybox

创建时间:2021/3/8 11:46

Cubemap

A Cubemap is a collection of six square textures that represent the reflections on an environment. The six squares form the faces of an imaginary cube that surrounds an object; each face represents the view along the directions of the world axes (up, down, left, right, forward and back).

可以使用方向向量对它们索引和采样

string s1 = "Hello ";
string s2 = s1;
s1 += "World";

System.Console.WriteLine(s2);
//Output: Hello

制作方法

Legacy Cubemap Assets

Alt text

Cubemap texture

Alt text

PanoramaToCubemap

Alt text

Shader实现

使用Texture2D格式,在Shader当中组织,而不使用Unity的Cubemap格式。

Alt text

Skybox的实现

使用Cubemap

制作Cubemap资源 。Buitin Shader当中的Skybox/Cubemap可以对Cubemap采样

Alt text

在Shader中对6张图采样

Builtin Shader: Mobile-Skybox

Alt text

Panorama(全景画)

Builtin Shader: Skybox/Panoramic 可以直接Texture2D格式的对全景图进行采样。

Ref

https://blog.csdn.net/v_xchen_v/article/details/79474193