09-27-2008 12:47 PM
Dear comunity,
The problem: semi transparent mesh in 3D Picture control how to?
I also tried semi transparent boxes spheres ... I't seem that the alpha canal is not working
thx
Martin
09-28-2008 01:06 AM
" I't seem that the alpha canal is not working"
I don't understand this.. Can you post code and a better explaination of what you mean by it doesn't work?
Jeff Peters
LabVIEW R&D
09-28-2008 06:10 AM
Hi Jeff, atttatched an example.
I would expect that the lower half of the cylinder to be shining through the disk.
and by the way creating the new objekts within the while loop seems not to be the best way as memory gets cluttered but if I put them outside the loop I get a invalid reference ( maybe I should use local variables?)
thanks
Martin
09-29-2008 08:24 AM
There are a few things that you didn't do that will help.
1. You have to turn blending on for the scene, otherwise semi-transparent objects won't be blended.
2. You have to depth sort your objects... that is, you should ensure that objects that are behind another semi-transparent object are drawn first. In general, we draw the root object, then the children objects.
This isn't strictly necessary in all cases. The transparent bin (blending.bin) can do some of this for you, but it doesn't handle objects that intersect each other very well.
3. You will probably see artifacts when rotating the scene around. This is because the cylinder is blending with itself. You can fix this by setting the face culling mode to back faces, meaning back faces are not rendered.
Blending is very complicated and it involves a lot of options that you have to set in order to for things to look right. Here is an updated version of your scene that I think accomplishes what you wanted. I will be filing a documentation CAR that will describe how to configure blending so that others might not be confused in the future.
If you have any questions about what I did, please respond. I will go into more detail if necessary.
Jeff Peters
LabVIEW R & D.
09-29-2008 11:52 AM
Hi Jeff,
I have tryed to understand what you have been doing --- more documentation would help so it's like trying to hunt in a dark and foggy night.
The example does something: The two cylinders get transparent (the background shines trough) but still the disk completly obscures the pillar
Still my problem seems to be solved
see attached file
but now the monster has grown an other head: why is the sphere not a sphere or why does the aspect ratio of the 3D control distort the content
Martin Burger
09-29-2008 12:59 PM
You didn't attach the file whoops.
I was under the assumption that you wanted the large cylinder to obscure the smaller.
If you need both to be semi-transparent, you will probably need to turn the depth test off. What will happen when you draw the small cylinder is that the renderer will realize that it has drawn an object at a particular pixel closer, thus it will not need to render the cylider at that pixel. Of course, that isn't true if the object in question is semi-transparent.
Here is your example doing that.
Now about the sphere. You probably have a warped viewport. You should try using autoprojection on the scenegraph control which will automatically maintain proportions if you grow/size the control.
09-29-2008 01:08 PM
09-29-2008 11:59 PM
09-30-2008 01:35 PM
Sorry
but tried some more experiments and came up with strange things
SemitransperancyTest looks OK
Semi transperancyTest1 looks crapy
Why
with a lot of thanks
Martin
09-30-2008 01:53 PM
I don't know exactly what you meant, but I think it might look bad because you have lighting turned on, but haven't supplied normals for your mesh.
Try turning lighting off.
Here is an example that does just that. (Drop it in the semitransparencytest1 folder)