Understanding overlayed transparent OpenGL polygons
-
When drawing a transparent box, its sides usually should overlay. This seems not to work reliably using the OpenGL methods. Does it depend on the graphics card?
Can someone test and tell me if this example looks the same?
(I've left the box open so it is easier to recognize the sides.)
class AlphaBox def initialize @color = Sketchup;;Color.new("red") @color.alpha = 0.2 @ps1 = [[1, 1, 1], [3, 1, 1], [1, 3, 1], [3, 3, 1], [1, 3, 3], [3, 3, 3], [1, 1, 3], [3, 1, 3], [1, 1, 1], [3, 1, 1]] @ps2 = [[1, 1, 1], [1, 3, 1], [1, 3, 3], [1, 1, 3], [3, 1, 1], [3, 3, 1], [3, 3, 3], [3, 1, 3]] end def draw(view) view.drawing_color = @color view.draw(GL_QUAD_STRIP, @ps1) 8.times{ |i| view.draw_text(view.screen_coords(@ps1[i]), i.to_s) } #view.draw(GL_QUADS, @ps2) end end Sketchup.active_model.select_tool(AlphaBox.new)
-
Same problem here. Damned! this pose some problems
Left and right side of box gets blown away.
IE when looking from the left the right-side-face doesent render, and vice versa.
Not from top or behind.
Graphics card. Geforce GTX 580.Are the Points in order ? Try GL_LINE_LOOP, maybe that result is suppose to happend.
-
I tried GL_QUADS with independent quads (instead of GL_QUAD_STRIP) and the same result, I tried reversing the orientation of some quads, and I tried using 4 method calls (on for each quad).
# Individual quads @ps1 = [ [1, 1, 1], [3, 1, 1], [3, 3, 1], [1, 3, 1], [3, 3, 1], [1, 3, 1], [1, 3, 3], [3, 3, 3], [1, 3, 3], [3, 3, 3], [3, 1, 3], [1, 1, 3], [3, 1, 3], [1, 1, 3], [1, 1, 1], [3, 1, 1]] 4.times{ |i| view.draw(GL_QUADS, @ps1[4*i...4*i+4]) }
Intel GM945
It's also not influenced by the transparency quality setting in Styles/Face Style.
-
Same here, I was creating 3d GL_POLYGON particle effects in SketchyPhysics, and got the unexpected results. Some 3d GL_POLYGONs did blend while the others did not, or some did blend with other GL_POLYGONs, but did not blend with all.
In SU7 the 3d GL_POLYGON was not being able to be colored. It always appeared in black color, not matter what color you set. The coloring of 3d GL_POLYGON was available in SU8+, but there was that blending issue.I hope SketchUp Team will consider to fix this little glitch.
-
I wonder if this has something to do with rendering backside faces and transparency ?
-
What is the Transparency Quality set to for your current Style?
-
The best (nicer) but it seems only to affect pngs.
The example should be fully working. Do you see the same phenomenon? -
Turning back edges on increases the general opacity, and the previousy missing overlayed part appeared (although with less opacity than expected).
However changing the opacity of the drawing color between 0 and 0.9 does not have the same effect, so the opacity increase is another not much related side effect. Drawing additional lines with line_stipple doesn't change anything. I don't know how back edges achieve the difference. -
@aerilius said:
The best (nicer) but it seems only to affect pngs.
The example should be fully working. Do you see the same phenomenon?I see the same on my nVidia 8800GT card. (SU8)
Advertisement