[英]WebGL texture rendering partially
I am facing a very obscure issue. 我面临一个非常模糊的问题。
I am loading .obj 3d models into a WebGL application I am working on. 我正在将.obj 3d模型加载到我正在处理的WebGL应用程序中。 I am parsing them using a custom function.
我正在使用自定义函数解析它们。 I know it works correctly.
我知道它可以正常工作。 Because I get this:
因为我得到这个:
Granted the texture is stretched way too much. 授予纹理太多的拉伸。 But that's the way the UVs are mapped.
但这就是UV映射的方式。
But, when I load a goose model here's what I get: 但是,当我加载鹅模型时,我得到的是:
An untextured goose. 没纹理的鹅。 I am using the same texture.
我正在使用相同的纹理。
Weirder still is the fact that the texture renders only around the eyes. 奇怪的是,纹理仅在眼睛周围呈现。 If I don't draw the wireframe, I get this:
如果不绘制线框,则会得到以下信息:
Those two tiny specs that I've circled are the eyes. 我盘旋的那两个微小的规格就是眼睛。
Just to make sure that it wasn't this model, I tried another one: 为了确保不是这个模型,我尝试了另一个模型:
I have no idea why it won't render the texture everywhere else. 我不知道为什么它不能在其他地方渲染纹理。
Here's what I've tried: 这是我尝试过的:
I am totally out of ideas. 我完全没有主意。 If someone has had similar experiences, I'd appreciate pointers as to where to look next.
如果有人有类似的经历,我将很高兴为您提供下一步的指导。
I generally don't like to ask questions without posting the code, but the code is very convoluted because I'm using sweet.js for custom javascript syntax. 我通常不喜欢在不发布代码的情况下提问,但是代码非常复杂,因为我将sweet.js用于自定义javascript语法。 Let me know if anyone would like to look at the code and I could try and clean up some code and upload somewhere.
让我知道是否有人想看一下代码,我可以尝试清理一些代码并上传到某个地方。
From your images i was wondering if you did not draw a constant number of polygon, or if the draw started then silently failed on its road because of some bug. 从您的图像中,我想知道您是否没有绘制恒定数量的多边形,或者是否开始绘制,然后由于某些错误而悄悄地失败了。 That's why i asked if the drawn polygons were the first of the models.
这就是为什么我问绘制的多边形是否是第一个模型。
And so it seems that indeed there was a hard coded limit to the number of drawn polygons. 因此,似乎确实对绘制的多边形数量存在硬编码限制。
Glad you found it ! 很高兴您找到了它!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.