Menu

Freeform material problem related to TGLPoints

Help
lnebel
2015-06-02
2015-09-11
  • lnebel

    lnebel - 2015-06-02

    I have a scene with three objects: a freeform generated in code (purple), a freeform created from a 3ds file import (green), and a GLPoints object (red).

    If the scene is shown through a single camera everything is OK. However, if I show the same scene through a second camera the material properties of one of the freeforms are messed up by the GLPoints object.

    I have added four bitmaps to illustrate the problem. The list to the right shows the rendering order (bottom up) and visible state.

    Problem occurs if the points are visible and rendered in between the freeforms.

    Has anyone experienced this problem?

     
  • Maverick

    Maverick - 2015-06-03

    I had same kind of bug with another object...
    You can test push attrib at the begin of GLObjects.pas > TGLPoints build list and pop attrib at the end.

    Use the enum in GLState.pas:

    TGLStateType = (sttCurrent, sttPoint, sttLine, sttPolygon, sttPolygonStipple,
    sttPixelMode, sttLighting, sttFog, sttDepthBuffer, sttAccumBuffer,
    sttStencilBuffer, sttViewport, sttTransform, sttEnable, sttColorBuffer,
    sttHint, sttEval, sttList, sttTexture, sttScissor,
    sttMultisample);
    TGLStateTypes = set of TGLStateType;

    procedure TGLPoints.BuildList(var rci: TRenderContextInfo);
    var
    n: Integer;
    v: TVector;
    begin
    n := FPositions.Count;
    if n = 0 then
    Exit;

    rci.GLStates.PushAttrib([what need to be pushed]);

    ...
    

    rci.GLStates.PopAttrib();
    end;

     
  • lnebel

    lnebel - 2015-09-11

    I missed your reply long ago - thanks! - I still can't make it work though...

    I have created a demo project to illustrate the problem. The project contain one scene, one teapot, one lines object, two cameras, a light source, and two scene viewers.

    If the lines object is placed below the teapot, the teapot renders correctly. If the lines object is placed above the teapot, the teapot renders with the color of the lines object.

     

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.