Texture Transparency


#1

So I have a model with glass. I’ve beat myself over head long enough and wish to know if I’m doing something incorrectly or there is an issue with mesh entities and texture transparency.

I have the following cubes built. Seem nice clones, right? Wrong. From left to right the front facing texture is 80%, 60%, 40% and lastly 20% transparent. I’ve tried everything I can think of and I end up with 100% transparent or 0% with nothing possible in between.

I’m perfectly happy to accept it’s my error, if it is. But - someone show me a transparent window somewhere in HF that’s not 100% transparent… I’ve seen no such thing yet.

Here’s the model elsewhere.


#2

This problem i have seen weeks ago and told about. but it where a problem on my mesh possible. never changed anything. not tried it anymore to. But good to see you have the same porblem that a transparent window (it worked efore on my door) dissapeared later.


#3

Back early on - maybe 1st week of October… I swear I was able to create water using 3 planes with normals and diffuse with transparency - more or less the same setup as SL/OS water users, but without the texture animation. So I tried scaling it up to make some bodies of water… never was able to get it to work again. I thought I had imagined ever seeing a transparency work properly here after so many months of not being able to make a simple window. It’s just 90% transparent with some coloration so it doesn’t look like an opening vs glass. So… maybe I did see my water I was so excited about… maybe I’ll even see it again someday. But first I want glass. Just simple, basic everyday glass. And maybe not to crash every time I move my AV, but, I’d settle for glass. I’m a huge fan of open builds with lots of glass and play with light… it’s been very frustrating trying to implement much of my style (or lack of as some would say) here.


#4

This the day that glass still worked. except for avatars.

https://alphas.highfidelity.io/t/magic-glass-transparent-is-not-transparant-for-avatar/955

And here i lost the glass in the door.


#6

https://dl.dropboxusercontent.com/u/10483952/gradiant%20box.fbx
that’s it to try in hifi

i see half f the top invisible and half kinda sunglasses opaque, no gradiant


#7

In trying to code something else - I stumbled across a find relating to this!

That ugly transparency on the glass is intentional - I had rendered my glass to be ugly and stand out trying to see if I could see any alpha action in HF… well… In the course of doing something else I rewrote my images using GD library in PHP and suddenly BOOM I have transparency as expected. Something about how blender is writing the transparency in PNG is not playing well, but reading that file in and rewriting it with GD fixes. Will investigate more, but this is a interesting find.


#8

Another experiment - this is an identical pair of models with exception of; left model was processed through my asset manager (work in progress) and had the transparent texture re-written while right model is the direct FBX output from blender with embedded textures.

My asset manager takes the FBX, extracts any textures and (to insure optimal compression) rewrites at maximal PNG compression value along with assigning each texture a UUID name vs human readable (the uuid name is referenced in database so I can know what some_uuid.png is). I’m still digging but there’s several things it could be - an error in blender’s FBX writer that I’m somehow “fixing” by re-writing the FBX with Autodesk’s SDK, an error in Blender’s PNG texture writer where rewriting image fixes (seems highly unlikely seeing as I have no issue with them elsewhere), or error in HiFi’s FBX reader where it, for whatever reason, is seeing transparent textures as all or none.

Actually I can almost certainly discount an error with the HiFi FBX reader. That leaves Blender’s FBX writer or some process error I’m somehow cleaning up with my conversion code.


#9

Might be interesting to export both the fbx as ascii’s one from autodesk and one from blender then we can have a look in the file in a txt editor and check for differences
just spent a hour trying random things looking for a weird setting like with the “waa everything’s gone shiny” spec colour prob, but got nowhere


#10

Yeah - that would be good for anyone who has the tech. It’s clear, no pun intended, that it’s something in Blender FBX format leading to issue. I When I first began I was exporting Collada then using Autodesk’s FBX tool to convert… then Blender updated and FBX seemed to be good to go direct. This is likely why I remembered having made some things work in early September then… got distracted and found later I could no longer make work.

If you need transparency - export Collada (dae), convert to FBX with FBX Tool then push to HiFi. Also, since you’re applying a texture containing transparency you need to be sure the material has its transparency tick box disabled or it applies additional transparency over that in texture source. This also may be where the bug is in Blender’s FBX writer…


#11

Zombie resurrection time…

Has anyone found best practices for importing a model with some alpha-transparent textures included, from Blender or straight from 3DS Max?

I’m having textures arrive with no transparency alpha effects, just solid backgrounds. I’ve been mucking about with it all day and figured it might be smart to just ask.


#12

i show how i do transparency about half way through this


#13

Thanks! I will check this out.


#14

Still no joy. It’s basically what I’ve already been doing, and I followed step by step to be sure - the textures look great in Blender, but any texture with an alpha imports into the Sandbox as gray. The regular textures look fine.

We’re getting close to the hair-rending stage :smiley:


#15

Hi Fiona,
Theres a few points to be aware of with alpha textures and HIfi.

Let me re-iterate what I think is the most important point in Judas’s video, according to recent changes.
(Assuming you use Blender)
Ensure the “influence” for the “Diffuse” section of the texture properties is checked for BOTH color and alpha, and leave the levels at 1.

Other notes of note, dont use TGA, use PNG images for alpha.
Hifi alpha is of a Binary type not a gradiential type. This means each pixel does not have a level of transparency, each pixel is either transparent or opaque.
The result is it will not correctly render an alpha texture that has levels of transparency or semi opacity, It will render as completely transparent up to a point at which it will render completely opaque.

So I dont use alpha textures for say tinted windows or green bottles, I only use alpha texture for things like leaves or objects that require transparent edges and such.
If I want semi-trans like a green bottle, I use no texture, use material color and material alpha set to less than 1.


#16

Yes, I’m using .png, and the idea is to cut background away entirely from lines that are 100% opaque. Both color and alpha are checked and at level 1. I select Binary for the output.

I’m quite sure that the issue is that somewhere in the long list of things that have to be ‘just so’, one thing is wrong. But I’ve not found out that one thing yet.

Thank you for helping me to walk through it. It’s the only way to find that one thing that’s wrong.


#17

Interesting development… if I turn off the “use Alpha” from the parts of the model where the textures don’t use alphas, and leave “use Alpha” checked for the areas that use alpha textures, suddenly the whole model tries to use only the non-alpha based texture for all the parts, even the ones that are set to use different textures with transparency.

This only shows up upon upload to HiFi, it looks fine and renders in Blender.

As a test, I went ahead and clicked all the textures to ‘use alpha’ whether they needed it or not, and that causes every single part to use the texture from the transparency part of the model.

I can’t seem to get them to behave separately at this point, even though all the maps are listed on the entity’s properties as if they imported properly.

EDIT TO ADD: I chatted briefly with Adrian about this and apparently this effect often happens when there is part of the model that is not mapped. I’m not at all sure how that would have happened as I wasn’t messing with the maps or vertex painting or anything other than export and setting toggles, but if I find out how this may have happened I’ll certainly post about it here. Unfortunately, it may just be one of those things where I reset everything from scratch and it works without clear explanation. :confused: We shall see.


#18

It works now and here’s what I did:

Exported the model from 3DS Max as an OBJ with no material information whatsoever.

Built the materials solely in Blender.

Exported as before.

Fixed.

I think there was some collision happening between layers of material information with the import information.

Thanks all for your patience in walking through the steps. I hope this thread will be helpful for other people getting started in HiFi :slight_smile:


#19

If anyone on this thread can provide links to a broken and working version of an FBX with transparency, I can take a look inside the rendering system and try to find out exactly where the problem is happening on the broken version. That could lead to a fix or workaround inside our code for dealing with the situation.


#20

Will do. I am finding a similar problem this morning, once I rigged the working model to bones. Now it’s doing the same thing as before (using the same texture over the entire model.)