Blended lines

Help
2010-12-29
2013-03-15
  • Klas Sanden

    Klas Sanden - 2010-12-29

    Dear all,

    I'm fairly new to glScene and I'm having problems with rendering blended lines.

    If my understanding is correct blending, in general, can be done using the blending parameters in the material property (I have done the for polygons and meshes). However, the TGLLines does not publish the Material property. (I have tried manipulating the material property in the source code but with no luck.)

    What is the correct way of rendering blended lines?

    Regards

    P4th

     
  • gaita

    gaita - 2010-12-30

    What Blend type do you want?
    antialiased?

    Use Lines.Antialiased := True;
    or use the
    SceneViewer.Buffer.Antialiasing  := aa4x;

     
  • gaita

    gaita - 2010-12-30

    Or if you want transparency, use the Lines.LineColor.Alpha := Value;

     
  • Klas Sanden

    Klas Sanden - 2010-12-30

    Thanks for your fast reply manelgoucha.

    I tried to keep the question as simple as possible and perhaps made it a bit to simple.

    I have a non flat _wall_ on which  I put  filled or unfilled polygons. There is no culling so the wall and the polygons should always be visible not matter from which side you are looking. I did not get the tesselation to work properly with TGLPolygon so I draw filled polygons with a TGLMesh and a custom Ear-Clipping tesselator.

    To get the filled polygons to be blended and always visible, I:
    1. Use a  the blending properties of the material.
    2. Disable the depth test in the depth properties of the material.
    3. Render blended objects last (by preordering my scene object correctly).

    My idea was to draw unfilled polygons using blended and not depth tested  TGLLines analogous to the way filled polygons are rendered..

    Note1: that the wall i rendered have an alpha value of 1 and I cannot change this easily.
    Note2: If I use TGLPolygon with PolygonMode = pmLines, the tesselation creates lots of triangles but I only want to draw the contour.

    regards

    P4th  

     
  • gaita

    gaita - 2010-12-30

    So what you want is filled or unfilled forms, but only in the outside?

    and you want that the border is also blended, right?
    it depends on what kind of type you are using to dra the borders, you can use the TGLLines, or the own mesh line mode.

    but I still didn't get what you wated to create.

    You can create an unfilled mesh with TGLLines, and filled mesh with what you are using.

    to use a transparent and blended unfiled mesh use this:

    object Triangle: TGLLines
      Position.Coordinates = {0000000000002041000000000000803F}
      AntiAliased = True
      LineColor.Color = {0000803F0000803F0000803FCDCC4C3E}
      LineWidth = 2.000000000000000000
      Nodes = <
        item
          Y = 10.000000000000000000
        end
        item
          X = 10.000000000000000000
          Y = -10.000000000000000000
        end
        item
          X = -10.000000000000000000
          Y = -10.000000000000000000
        end
        item
          Y = 10.000000000000000000
        end>
      NodesAspect = lnaInvisible
      Options =
    end

    to use a transparent and blended filed mesh use this:

    object Polygon: TGLPolygon
      Material.FrontProperties.Diffuse.Color = {CDCC4C3FCDCC4C3FCDCC4C3FDBF9BE3E}
      Material.BlendingMode = bmTransparency
      Position.Coordinates = {0000000000002041000000000000803F}
      Nodes = <
        item
          Y = 10.000000000000000000
        end
        item
          X = 10.000000000000000000
          Y = -10.000000000000000000
        end
        item
          X = -10.000000000000000000
          Y = -10.000000000000000000
        end
        item
          Y = 10.000000000000000000
        end>
    end

     
  • Klas Sanden

    Klas Sanden - 2011-01-04

    Sorry for not making myself clear. Here is the super simple way to put it:

    I want to be able to draw the border of a polygon such that it is always visible, That is, even if other non-transparent objects are placed between the camera and the polygon..

    I tried yot suggestion but it did not work in 'desgin mode' (delphi 2007 ide). I suspect that the lines will be hidden due to the depth test (both per pixel and per object) if they are behind something else.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks