Unity3D应用纹理-模型变为黑色 [英] Unity3D Applying Texture - Model turns black

查看:930
本文介绍了Unity3D应用纹理-模型变为黑色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习一门学习Unity3D的课程.

I am following a course to learn Unity3D.

使用Unity iPhone教程为iPhone/iPad开发游戏

Game Development for iPhone/iPad Using Unity iPhone Tutorials

http://www.vtc.com/products/Game-Development-for-iPhone-iPad-Using-Uni​​ty-iPhone-Tutorials.htm

我正在追踪屏幕上任何作者的行为.他正在使用Unity 1.6,而我正在使用Unity 3.40f5

I am following along whatever author is doing on the screen. He is using Unity 1.6 and I am using Unity 3.40f5

当我尝试像在电影中那样应用纹理时,我的模型变成黑色.我在这里缺少一些琐碎的东西吗?

When I try to apply the texture as he does in the movie, my model turns black. Is there something trivial that I am missing here?

也可以找到随附的屏幕截图.

Also find the screenshot attached.

  1. 作者与电影发生了什么-

  1. Whats happening in the movie with author -

我的屏幕上发生了什么-

Whats happening on my screen -

推荐答案

很难从屏幕抓图中分辨出来,但是您的材质看起来是正确的,假设着色器后显示凹凸不平".

It's hard to tell from screen grabs but your material looks correct, assuming it says "Bumped Diffuse" after shader, I can't tell.

当您第一次将模型拖到场景中时,在应用纹理之前,它应该自阴影.如果不是,则需要通过单击模型来重新生成模型的法线,然后在检查器中查找法线和切线".在法线选择计算"后,单击底部的应用",看看会发生什么.我不知道您的模型类型,但是Unity过去用Wavefront .obj文件预定义了它们的法线给我带来了麻烦.

When you first drag your model the scene, before applying a texture, it should self shade. If it doesn't, you need to regenerate your model's normals by clicking on the model and then in the inspector look for "Normals and Tangents." After Normals choose "Calculate" the click "Apply" at the bottom, see what happens. I don't know your model type but Unity has given me trouble in the past with Wavefront .obj files predefining their normals.

另一个可能的问题是UV导入错误.如果该教程来自v1.6,则该教程随附的模型可能无法正确导入.我遇到了类似的问题,其中UV都设置为"0 0",因此仅使用了纹理的最低角像素. Unity在那里无法为您做任何事情.您可以通过创建新材料进行测试.将着色器设置为漫反射.将基本(RGB)"纹理设置为无",并将主色"设置为类似蓝色的颜色.将其应用于您的模型.如果未定义纹理,则模型应显示为蓝色.如果是这样,则意味着您可能存在UV导入问题.

The other possible issue is a faulty UV import. If the tutorial is from v1.6 it is possible the model included with the tutorial isn't importing correctly. I've had a similar issue where the UV's were all set to '0 0' so only the lowest corner pixel of my texture was used. Unity can't do anything for you there. You can test this by creating a new material. Set the shader to diffuse. Set 'Base(RGB)' texture to 'none', and set 'Main Color' to something like blue. Apply it to your model. If you don't define a texture then your model should appear blue. If it does, it means you likely have a UV import problem.

这篇关于Unity3D应用纹理-模型变为黑色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆