Menu

Background (TGLHUDSprite) corrupt TGLLines content

Help
2019-03-22
2019-03-25
  • shine world

    shine world - 2019-03-22

    Hi all,

    I'm using a TGLHudSprite to load a fixed background image in my scene, but when used the CNC toolpath lines (TGLLines) is partially corrupted and I'm not able to understand why.

    The background are PNG files loaded dinamically to HUD Sprite with this code:

      procedure UpdateBackgroundImage;
      begin
        try
          if not FileExists(FBackgroundImageFileName) then Abort;
          SceneBackground.Material.Texture.Image.LoadFromFile(FBackgroundImageFileName);
          with (SceneBackground.Material.Texture.Image as TGLPictureImage).Picture do
          begin
            SceneBackground.SetSize(Width, Height);
            SceneBackground.Position.X := Width / 2;
            SceneBackground.Position.Y := Height / 2;
          end;
        end;
        SceneBackground.Visible := True;
        except
          SceneBackground.Visible := False;
        end;
      end;
    

    In the scene stack the Background TGLHudSprite is placed how first object and TGLLines are added dynamically below in Word root.

    Have you any idea about this behavior ?

     

    Last edit: shine world 2019-03-22
  • Jerome.D (BeanzMaster)

    Hi, check the TGLLines Material properties's FaceCulling, Depthproperties and BlendingMode
    Try to put SceneBackground HudSprite as first child of World DummyCube

     
  • shine world

    shine world - 2019-03-25

    Hi Jerome.D,

    inspecting elements I saw:

    TGLLines.Material.FaceCulling = fcBufferDefault
    TGLLines.Material.BlendingMode = bmOpaque

    I've tried to change to fcNoCull without results.
    Moving scenebackground in top of World Dummy Cube, same result.

    I don't find Depth property in matrial or TGLLine object.

    I need to create a simple demo program...

    ISSUE is when different color/size lines are drawn one below another...

     

    Last edit: shine world 2019-03-25
  • shine world

    shine world - 2019-03-25

    Hi Jermome D.
    I will take a look to you suggested post.
    At moment I was not able to simplify my program parts to place a zip with code here.
    I've reached over 1 milions lines of code and the "extract part" is a little bit complicated :)

     

    Last edit: shine world 2019-03-25
  • shine world

    shine world - 2019-03-25

    Seem the wrong behavior is only in my used glscene library (RC 1.0.0.0714) because using the more updated (1.8.0.x) I can get all working. Unfortunately 1.8.0.x run perfectly on XP but get a lot of Access violations error in W10.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.