与USD一起工作(二)

作者:禮龍
声明:转发本文,请联系作者授权

USD本质

在这里插入图片描述

1. File Structure 文件结构

#usda 1.0
(
	upAxis = "Y"
)
def Xform “simpleMesh” (
	 kind = "component"
)
{
	def Mesh "cube"  // 属性定义
	{
		point3f[] points = [(0,0,0), (1,0,0), (1,1,0), (0,1,0)]  // simpleMesh/cube.normals
		normal3f[] normals = [(0,0,1)] (
		interpolation = "uniform" )
		...
	}
}

Prims

def Xform “simpleMesh”
{
	def Mesh "cube" 
	{
	
	}
}

Properties(属性)

point3f[] points = [(0,0,0), (1,0,0), (1,1,0), (0,1,0)] 
normal3f[] normals = [(0,0,1)]
...

MetaData(元数据)

(
	upAxis = "Y"
)

(
	 kind = "component"
)

(
	interpolation = "uniform" 
)

Object Access Through Paths (通过路径访问对象)

def Mesh “cube” ==> simpleMesh/cube

normal3f[] normals = [(0,0,1)] ==> /simpleMesh/cube.normals

2. Scene Graph(场景图)

  • 场景图定义了对象的层次
  • 父节点的变换也会影响子节点
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述

3. Mesh Data 网格数据

Mesh atrributes 网格属性
网格属性

Mesh connectivity 网格连接
网格连接

def Mesh "Tetrahedron"
{
	point3f[] points = [(-1,-1,1), (-1,1,-1), (1,-1,-1), (1,1,1)]
	int[] faceVertexCounts = [3, 3, 3, 3]
	int[] faceVertexIndices = [1,2,0, 3,2,1, 3,0,2, 3,1,0]
	
	normal3f[] normals = [(-0.58,-0.58,-0.58), (0.58,0.58,-0.58),
						  (0.58,-0.58,0.58), (-0.58,0.58,0.58)] (
		interpolation = "uniform"
	)
	float2[] primvars:st = [(0.75,0.43),(0.5,0.87),(0.25,0.43),
					        (1,0.87),(0,0.87),(0.5,0)] (
		interpolation = "faceVarying"
	)
	int[] primvars:st:indices = [0,1,2, 3,1,0, 4,2,1, 5,0,2]
	
	uniform token subdivisionScheme = "none"
}

point3f[] points = [(-1,-1,1), (-1,1,-1), (1,-1,-1), (1,1,1)]
在这里插入图片描述

int[] faceVertexCounts = [3, 3, 3, 3]
int[] faceVertexIndices = [1,2,0, 3,2,1, 3,0,2, 3,1,0]
在这里插入图片描述

normal3f[] normals = [(-0.58,-0.58,-0.58), (0.58,0.58,-0.58), (0.58,-0.58,0.58), (-0.58,0.58,0.58)] (
interpolation = “uniform” // per-face attribute
)
在这里插入图片描述

float2[] primvars:st = [(0.75,0.43),(0.5,0.87),(0.25,0.43),(1,0.87),(0,0.87),(0.5,0)] (
interpolation = “faceVarying” // per-face per-vertex attribute
)
int[] primvars:st:indices = [0,1,2, 3,1,0, 4,2,1, 5,0,2]
在这里插入图片描述

uniform token subdivisionScheme = “none”
在这里插入图片描述

4. Materials 材质

UsdPreviewSurface
  • 用于逼真的实时渲染的模式
  • 基于物理的材料描述
  • 支持工作流
  • 金属粗糙度
  • 镜面粗糙度
材质属性

物理材料描述
diffuseColor = (1,1,1)
normal = normals.png
occlusion = occlusion.png
在这里插入图片描述

金属材质
diffuseColor = (1,1,1)
normal = normals.png
occlusion = occlusion.png
metallic = 1
在这里插入图片描述

镜面粗糙度
diffuseColor = (1,1,1)
normal = normals.png
occlusion = occlusion.png
metallic = 1
roughness = roughness.png
在这里插入图片描述

样例
diffuseColor = diffuse.png
normal = normals.png
occlusion = occlusion.png
metallic = metallic.png
roughness = roughness.png
在这里插入图片描述

5. Shader Node Graph 着色器节点图

在这里插入图片描述

  • 简单的着色器节点图结构
  • 四个节点类型
    在这里插入图片描述
Constant material property 恒定材料属性

在这里插入图片描述
在这里插入图片描述

Texture material property 纹理材质属性

在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值