3d建模整个流程-完整工作流总结(Maya + Marmoset Toolbag 八猴 + Substance Painter + Unity URP)

本文系统梳理游戏实时渲染3D道具建模完整工作流:Maya中模定型→高模雕刻→低模拓扑与UV展开;Marmoset Toolbag烘焙法线/AO等辅助贴图;Substance Painter基于辅助贴图绘制PBR材质并导出BaseColor、Normal、Metallic、Occlusion四张Unity URP成品贴图;Unity中正确设置贴图参数、挂载URP Lit材质并微调法线与AO强度。强调白模原则、贴图职责分离及高频避坑点。

马克杯道具作为案例,全程为游戏实时模型流程,所有环节、细节、规则、坑点全部整理在内。

核心逻辑:先在 Maya 做几何白模(中模→高模→拓扑低模)→ 八猴烘焙,把高模的凹凸信息转为辅助贴图 → Substance Painter 利用辅助贴图绘制 PBR 质感,输出成品贴图 → Unity URP 中挂载成品贴图、微调参数,用于游戏渲染。 重要原则:烘焙之前全部是白模,不上最终材质;八猴烘出来的贴图是 SP 画画用的辅助贴图;SP 导出的贴图才是给 Unity 使用的成品贴图;Unity 只做贴图装配,不绘制磨损、划痕、颜色

阶段一:Maya 建模(全部白模,默认 Lambert 灰色,不做材质)

1. 制作中模 Mid-Poly

目标:定好大形、比例、结构,布线干净规整,为雕刻 / 细分平滑做准备

  1. 创建基础几何体,调整出杯子主体、杯口厚度、杯底、把手整体轮廓
  2. 使用【Insert Edge Loop 循环边】在硬转折位置卡线,保证 3 号键平滑预览时结构不变形
  3. 布线要求:优先四边面,尽量少三角面,无废面、重叠顶点,合并焊接重合点
  4. 面数:杯子这类简单道具几百~一千多面
  5. 特点:只有大型结构,没有磕碰、划痕、磨损、微小凹凸细节
  6. 命名:cup_mid

中模不是最终低模,它是高模的 “骨架底座”

2. 制作高模 High-Poly

两种路线:

  • 路线 A(简单道具,本案例):复制一份中模,Maya 细分,使用雕刻笔刷增加细节(杯口崩口、边缘磨损、细小划痕)
  • 路线 B(行业标准,复杂道具 / 角色):中模导出 OBJ,导入 ZBrush 雕刻细节,雕刻完成后回 Maya 导出
  1. 高模和中模空间位置完全重合
  2. 特点:大形和中模一模一样,网格密度极高;把所有微小凹凸做成真实几何体;依旧是白模,不上色
  3. 用途:唯一作用 —— 提供凹凸细节,用来烘焙贴图,高模永远不进游戏引擎、不进 SP
  4. 命名:cup_high

重点误区:单纯加密面、没有雕刻凹凸细节,那不叫高模,只是加密后的中模

3. 拓扑低模 Low-Poly + 展开 UV(最终进引擎的模型)

  1. 基于中模 / 高模的外形,重新拓扑,大幅减少面数,满足游戏性能要求
  2. 布线精简,优先保证关键结构;
  3. 展开 UV:UV 不能重叠、拉伸,合理排布,为贴图绘制做准备;
  4. 检查:UV 无重叠、无严重拉伸,模型没有废面、反转法线;
  5. 命名:cup_low

✅ 后续所有流程(烘焙、SP、Unity),只用这个低模!

阶段二:Marmoset Toolbag 八猴烘焙(生成辅助贴图,供给 SP 使用)

烘焙定义:把高模上雕刻出来的几何凹凸信息,“拍照” 保存成贴图文件;烘焙≠上材质,烘焙完模型依旧是白模

  1. 导出:Maya 导出 cup_low.obj、cup_high.obj,导出时两个模型位置保持重合
  2. 新建 Bake Project 烘焙项目,低模放入 Low 槽,高模放入 High 槽
  3. 勾选贴图(就是你截图里的选项,本案例标准勾选组合)

    表格

    选项贴图类型作用是否给 Unity 渲染
    Normals切线空间法线贴图(紫蓝色)记录高模凹凸方向,SP 里用来预览凹凸❌ 辅助贴图,不直接给 Unity,SP 会重新输出成品法线图
    Normals(Object)物体空间法线模型旋转后凹凸会错乱,角色道具几乎不用,不勾选-
    Curvature 曲率黑白图凸起边缘亮、凹槽暗,SP 用来做边缘磨损、掉漆智能遮罩❌ 辅助贴图
    Ambient Occlusion (AO) 环境闭塞黑白图缝隙、物体交接处变暗,增加立体感❌ 辅助贴图
    Material ID 材质 ID彩色分区图不同色块对应模型不同部件,SP 一键选区(杯身 / 把手分开选择)❌ 辅助贴图
  4. 烘焙参数:调整包裹距离,防止黑斑、穿插、烘焙撕裂;点击 Bake 烘焙
  5. 输出 4 张辅助贴图:Normal、Curvature、AO、Material ID

⚠️ 划重点:这四张是辅助工具贴图,只在 Substance Painter 里面画画、做遮罩用,不是最后贴到 Unity 的贴图

阶段三:Substance Painter(SP)绘制 PBR 材质,导出 Unity 成品贴图

  1. 导入:导入 cup_low 低模;再导入八猴烘好的 4 张辅助贴图,放到资源库
  2. 开始绘制材质(核心创作环节)
    1. 使用 Material ID 贴图做颜色选区,分离杯身、把手,分开赋予材质
    2. 使用 Curvature 曲率贴图做遮罩,自动生成杯口边缘磨损、掉漆效果
    3. 把八猴烘焙的法线、AO 贴图导入图层,作为底层凹凸和阴影基础
    4. 分层绘制:固有色(奶白陶瓷)、粗糙度(杯身光滑、把手哑光)、金属度、污渍、划痕
  3. 导出设置(关键!适配 Unity URP)
    • 导出预设选择:Unity Universal Render Pipeline (Metallic Standard)
    • 输出 4 张Unity 成品贴图(这才是最后给 Unity 挂载的贴图) | 成品贴图名称 | 存储内容 | | ---- | ---- | | BaseColor | 固有色,包含颜色、污渍、磨损颜色 | | Normal | 法线凹凸信息(SP 整合后的成品法线) | | Metallic | RGB 通道 = 金属度;Alpha 通道 = 光滑度 Smoothness | | Occlusion (AO) | 环境闭塞缝隙阴影 |

注意:曲率、Material ID 不会导出到 Unity,它们只是画画的辅助,绘制完成后就完成使命

阶段四:Unity URP 挂载贴图、微调参数(装配环节,整条流程最简单一步)

规则:Unity 不画画、不新增磨损划痕,只把 SP 导出好的成品贴图挂载到材质对应通道,少量微调参数

第一步:贴图导入设置(贴图拖进 Unity 后,先改设置,再建材质!)

表格

贴图Texture TypesRGB额外设置
BaseColor(颜色图)Default✅ 开启颜色图必须 sRGB
Normal(法线凹凸图)Normal map❌ 关闭凹凸反向就勾选 Flip Green Channel
Metallic(金属光滑图)Default❌ 关闭线性贴图
Occlusion AO(闭塞图)Default❌ 关闭线性贴图

第二步:新建材质球

右键 → Create → Material,Shader 选择:Universal Render Pipeline/Lit

第三步:贴图挂载(你记住的这一组)

  • Base Map → BaseColor(颜色贴图)
  • Normal Map → Normal(凹凸法线贴图)
  • Metallic Map → Metallic(金属 + 光滑度贴图)
  • Occlusion Map → AO(闭塞阴影贴图)

第四步:参数核对 + 微调(只调这些,不新增效果)

  1. Smoothness source:确认选项为 From Metallic Alpha(从 Metallic 贴图 Alpha 读取光滑度,SP 导出预设已经配套)
  2. Normal Scale:法线强度,推荐 0.8~1.2,控制凹凸强弱
  3. Occlusion Strength:AO 强度,0.8~1.2,控制缝隙阴影深浅
  4. Metallic 滑块:陶瓷这类非金属,金属度为 0

第五步:赋予模型

把调好的材质球,直接拖给场景里的 cup_low 低模,完成!

全流程一句话极简串联

Maya 建中模定型 → 复制雕刻高模做凹凸细节 → 拓扑精简低模 + 展 UV → 八猴烘焙,把高模凹凸转为 4 张辅助贴图 → SP 导入低模 + 辅助贴图,分区、做磨损、画 PBR 质感,导出 4 张 Unity 成品贴图 → Unity 导入贴图、修正贴图设置,URP 材质挂载贴图,微调法线、AO 强度,给到低模渲染。

高频避坑汇总

  1. 高模不要导入 SP、Unity,全程只用低模进入绘制和引擎
  2. 区分两套贴图:八猴烘焙 = 辅助贴图(SP 画画用);SP 导出 = 成品贴图(Unity 挂载用),不要把八猴的贴图直接贴 Unity
  3. sRGB 开关不能乱:颜色图开 sRGB,法线、AO、金属图关闭 sRGB
  4. Unity 法线贴图必须把 Texture Type 改成 Normal map,否则凹凸失效
  5. URP Lit 默认光滑度取自 Metallic 贴图 Alpha 通道,SP 导出预设不要选错
  6. 烘焙前高低模必须重合,不然烘出来错位、黑斑
  7. Material ID、Curvature 只用来做选区和遮罩,不会在 Unity 里渲染显示

如果你想要,我可以再给你一份可直接复制的检查清单,以后做任何道具都按这个逐项核对。

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值