Transparency in OpenGL geometry rendering of "Tubs" surface

Hi,

I have been trying to render a simple geometry with transparency aspects for an event display. At the moment I have two cylindrical surfaces (created with “tubs”) inside one another with transparency turned on. I find that when I render this geometry into the ROOT GL viewer I see that along the theta=0 (or, theta=360 too I guess) line the object appears darker than in all the other places. It should appear uniform.

I have attached the code below. I include a picture of this effect as well, which is produced using ROOT version 5.26.


Thanks,
Anthony
drawGeantFluka_OpenGL.C (1.57 KB)

[quote]Hi,

I have been trying to render a simple geometry with transparency aspects for an event display. At the moment I have two cylindrical surfaces (created with “tubs”) inside one another with transparency turned on. I find that when I render this geometry into the ROOT GL viewer I see that along the theta=0 (or, theta=360 too I guess) line the object appears darker than in all the other places. It should appear uniform.

[/quote]

Hi.

Correct transparency with OpenGL is a very non-trivial thing, in general it’s simply always more or less incorrect (to have it correct, you need to sort polygons by depth and even probably split intersecting/overlapping polygons in 3d and sort them, which is not an option for event display). In your case, these darker polygons are results of blending: blue polygon + another blue polygon give you slightly darker blue area (or green).
Another question, why do we have these polygons (at 360) at all if your tube is closed.

Ok, thanks for that info. I am not sure why polygons appear at theta=360. The “tubs” method takes an angular range at the end which seems by definition to be a closed range. Therefore if you want the shape to close, and the only inputs you have are the initial and final angle it seems logical to have the end value be 360 and hope that for that special case the range is interpreted as [0,360), not [0,360], as it would be in all other cases (I suppose). There is no finite decimal I can use for “a” such that the range [0,a] closes but does not overclose the shape.

I would actually rather there be some syntax where I could just specify directly that it is to be closed. I am new to this type of rendering and I guess I don’t really know how to use it properly yet, so what I was looking for especially is if someone could point out an error in the way I am making cylinders, or even just a better way.

It seems that this method “tubs” is meant to be more general by taking the range inputs, but in some sense I want it to be less general and just use the base case which (I would think) is a closed surface.

Thanks,
Anthony