I'm trying to get a blender model that I've exported to display properly, but it appears as though the texture for the leaves isn't being blended correctly as an alpha ( though the trunk itself work fine ). Here's what I'm seeing:
我试图得到一个我出口的搅拌机模型,但它看起来好像叶子的纹理没有被正确地混合成一个字母(尽管箱子本身工作的很好)。这就是我看到:
Notice how the leaves aren't aliased through correctly ( i.e. it should look like a tree with leaves, not with gray sheets of paper ).
注意这些叶子没有被正确地通过(也就是说,它应该看起来像有叶子的树,而不是灰色的纸)。
In Blender the tree looks fine, but I've had a few people tell me that it looks like my alpha is inverted ( I'm not totally sure what that means ). My guess is that, with a bit of file tweaking and conversion, I could get the attached images to work fine. Here are the image resources I've got:
在Blender中,这棵树看起来很好,但是我有一些人告诉我,它看起来像我的alpha是颠倒的(我不完全确定这是什么意思)。我的猜测是,通过一些文件调整和转换,我可以让附加的图像正常工作。这里是我得到的图像资源:
I don't think it's necessary, but in case you want to see the exported JSON, I've dumped it here: https://gist.github.com/funnylookinhat/5062061
我不认为有必要,但如果您想看到导出的JSON,我将它转储到这里:https://gist.github.com/funnylookinhat/5062061。
I'm pretty sure that the issue is the black and white image of the oak leaves - given that it's the only difference between the two packed textures. Is there a way I can work with it or convert it so that it applies correctly to the layers of leaves?
我很确定这个问题是关于橡树叶的黑白图像——因为这是两种包装纹理之间唯一的区别。有没有一种方法,我可以使用它或转换它,使它正确地适用于叶子层?
UPDATE
更新
I'm able to get something that looks mostly right ( minus some weird transparency layering issues ) - but I'm pretty sure that it isn't being done correctly... any help would still be much appreciated.
我能得到看起来大部分是正确的东西(减去一些奇怪的透明的分层问题)——但是我很确定它没有正确地完成……任何帮助都是值得感激的。
I added in transparency on the white/black and green images resulting in these:
我增加了白色/黑色和绿色图像的透明度,结果如下:
Which resulted in the following:
结果如下:
Then I flipped the references to the two of them in the JSON - which resulted in this:
然后,我将这些引用转换为JSON中的两个引用,结果如下:
I'm 99% sure this isn't working as intended, it appears as though the Diffuse map isn't working correctly... any suggestions?
我百分之九十九肯定这不是故意的,看起来漫反射贴图不能正常工作……有什么建议吗?
1 个解决方案
#1
3
Three.js has no mask textures (the black and white texture), so you need to bake it into the alpha channel of the diffuse texture (so use .png format as .jpg does not support alpha - as you are currently doing).
三。js没有掩码纹理(黑白纹理),所以你需要将它放入到扩散纹理的alpha通道中(所以使用.png格式。jpg不支持alpha——就像你目前正在做的那样)。
Your update is on the right track although the diffuse alpha is poorly done (holes in leaves). This can be done right e.g. in Gimp by decomposing the diffuse color channels and then recomposing with the added mask layer as alpha (note however that white is assumed to be opaque and black transparent so inversion might be needed).
你的更新是在正确的轨道上,尽管弥漫的阿尔法是做的很差(叶子上的洞)。这可以通过在Gimp中通过分解漫反射色通道来实现,然后用添加的掩码层作为alpha重新组合(注意,白色被假定为不透明和黑色透明,因此可能需要反转)。
In the material, don't use the mask texture at all. There might also be problems with leaves overlapping each other which is a difficult problem to solve as transparency in general is quite the PITA. You can try disabling the material's depthWrite
and/or playing with alphaTest
values (e.g. setting it to 0.1) to get different kind of artifacts.
在材料中,不要使用掩模纹理。也可能会有树叶重叠的问题这是一个很难解决的问题一般来说,透明度是很重要的。您可以尝试禁用该材料的depthWrite和/或使用alphaTest值(例如将其设置为0.1)来获得不同类型的工件。
#1
3
Three.js has no mask textures (the black and white texture), so you need to bake it into the alpha channel of the diffuse texture (so use .png format as .jpg does not support alpha - as you are currently doing).
三。js没有掩码纹理(黑白纹理),所以你需要将它放入到扩散纹理的alpha通道中(所以使用.png格式。jpg不支持alpha——就像你目前正在做的那样)。
Your update is on the right track although the diffuse alpha is poorly done (holes in leaves). This can be done right e.g. in Gimp by decomposing the diffuse color channels and then recomposing with the added mask layer as alpha (note however that white is assumed to be opaque and black transparent so inversion might be needed).
你的更新是在正确的轨道上,尽管弥漫的阿尔法是做的很差(叶子上的洞)。这可以通过在Gimp中通过分解漫反射色通道来实现,然后用添加的掩码层作为alpha重新组合(注意,白色被假定为不透明和黑色透明,因此可能需要反转)。
In the material, don't use the mask texture at all. There might also be problems with leaves overlapping each other which is a difficult problem to solve as transparency in general is quite the PITA. You can try disabling the material's depthWrite
and/or playing with alphaTest
values (e.g. setting it to 0.1) to get different kind of artifacts.
在材料中,不要使用掩模纹理。也可能会有树叶重叠的问题这是一个很难解决的问题一般来说,透明度是很重要的。您可以尝试禁用该材料的depthWrite和/或使用alphaTest值(例如将其设置为0.1)来获得不同类型的工件。