XNA 和 FBX 着色问题
我的问题是,如果我使用 BasicEffect (并设置 VertexColorEnabled = true)或我自己的着色器,并且仅使用彩色(非纹理!)模型,它会给出 Color0 丢失的错误...这不是很奇怪吗? fbx 型号没有 COLOR0 通道吗?
My problem is that, if I use BasicEffect (and setup VertexColorEnabled = true) or my own shader, and use only colored (not textured!) models, it gives the error that Color0 is missing...Isn't it weird that .fbx models do not come with COLOR0 channel ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是我发现的......(Marshall Belew @forums.create.msdn.com/forums/p/16066/553792.aspx#553792)拯救了我的一天......
解决方案很简单:BasicShader 有一个 DiffuseColor财产。我只是在卡通着色器中添加了一个新字段,并且每当没有纹理时,我都会替换颜色值。
我对这个解决方案很满意,因为现在我不必编写大量的顶点声明/绘制原始逻辑。
从 .fx 文件:
替换效果(这是 NonPhotoRealistic 示例的修改片段)。
Here is what I found..... (Marshall Belew @ forums.create.msdn.com/forums/p/16066/553792.aspx#553792) Saved my day...
The solution is simple: the BasicShader has a DiffuseColor property. I merely added a new field into the Toon shader, and any time there was no texture, I substituted the color value.
I am happier with this solution because now I don't have to write a ton of vertex declaration / draw primitive logic.
From the .fx file:
Replacing the effects (this is a modified snipet from the NonPhotoRealistic sample).