Texture with Alpha from Blender

Started by Varanda, March 23, 2016, 02:37:05 AM

Previous topic - Next topic

Varanda

Hello All,

I am having some problems with a texture with some transparent areas. The building model have its balconies with a glass fence. It seems to work fine. However, the opaque regions where alpha are 1 are also transparent. My scene is created based on Blender Importer project (JPCTBlendScene). Has anyone experienced similar issue?

Left side: rendered in Blender, Right side: Rendered in JPCt on Nexus 7





Settings:





Thanks,
Varanda


EgonOlsen

Transparent and opaque parts should be contained in at least two different objects. Is that the case? Try to set the transparency of the building to -1.
Sometimes, some exporters invent transparency where there actually is none...I don't know why.

Varanda

I have the texture with mixed opaque and transparent areas applied the the same mesh (building).
Interesting that seems to be working as the areas with alpha=0 are indeed 100% transparent. The opaque (alpha = 1) seem to be rendered with an alpha <100%.

anyways, thanks a lot, I will try the suggested transparency set to -1 tonight.

EgonOlsen

That depends on the transparency setting. The texture's alpha is just one component. You can try to increase the transparency value...BUT: Transparent objects don't write into the depth buffer. So for a complex model like this, you'll most likely end up with some unwanted overlapping. Opaque parts should be rendered as opaque objects whenever possible. It's faster as well.

Varanda

Thanks. I will make the building 100% opaque and cut off the geometry and so making the "glasses" 100% transparent.

Varanda

#5
Something else is going on. The base of the building is an independent mesh. It does not have transparency settings. However, it shows transparent. The pictures above (first post) had already the following settings:


EgonOlsen

Try to set it to -1 in code. As said, some exporters add transparency where it doesn't belong.

Varanda

Solution for now (override transparency after loading scene):

Enumeration<Object3D> objs = world.getObjects();
Object3D obj;
while (objs.hasMoreElements()) {
obj = objs.nextElement();
obj.setTransparency(-1);
}


A couple tips for those willing to use jpct Blender exporter addon:

- Even for meshes with Materials without file textures you need to unwrapp and add an image as texture. Make sure you load the image in UV Editor (only in material/texture property tab is not enough).
- Make sure that you do not have any mesh in edit mode when running the exporter. Otherwise, the exporter crashes.
- MOST IMPORTANT OF ALL: Always give a destination folder other than your project root. The first thing that the exporter does in to delete the destination directory (entire content). I lost my entire project when I run the exporter first time. JUST IN CASE MAKE A BACKUP before using this exporter.

Despite the problem I got so far this exporter and JPCt integration is VERY HANDY.