Menu

TGLHiddenLineShader problem

Help
2018-09-13
2018-09-14
  • Alexander Dev

    Alexander Dev - 2018-09-13

    Hi guys. I'm using a shader. When the camera is away from the object
    (GLCamera1.AdjustDistanceToTarget(Power(1.1, -ZoomValue / 480));),
    artifacts appear.
    I think that this is due to the insufficient accuracy of the calculations. How to deal with this?

     
  • Jerome.D (BeanzMaster)

    Hi Alexender it is screenshot from your applications ? Can you put your sample please. I cannot answer with just that. Are you in Delphi or Lazarus ?

    Best regards

     
    • Alexander Dev

      Alexander Dev - 2018-09-14

      Delphi. Well, I'll make an example.

       
    • Alexander Dev

      Alexander Dev - 2018-09-14

      Example is ready

       
  • Jerome.D (BeanzMaster)

    Hi Alexander, ok , the problem is you must understanding better how opengl pipeline redering engine work.

    Let me explain a bit: an 3D objects depend of the structure , when is rendering, of the material and the shader

    I took your sample and changed colors for a better view of the problem and explain how rendering work

    Take a look at those screenchots and test attached sample

    1st : Is with your default setting
    2nd : By changy DummyCube objectsorting property to none
    3rd : By changy DummyCube objectsorting property (it's seems inverted with farthest)
    4th : in add, by changing Materail.DepthProperties

    ps : Open picture in you tab

    ps : ps : You'll probably need change project option s to compil. I'm on the community edition

    Best regards

     

    Last edit: Jerome.D (BeanzMaster) 2018-09-14
    • Alexander Dev

      Alexander Dev - 2018-09-14

      Hmm, thanks looked your decision. In the case of two cubes, this works (although it's also not always ideal). I tried on a complex scene - the render is wrong, some objects disappear, some objects appear.

       
  • Jerome.D (BeanzMaster)

    Can you post some screenshots ?

    have you check the others properties have changed like camera.nearplanebias ?

    If you have complex scene, you must take care of how your scene is organized and how objects are sorted. Like you've seen here the ObjectsSorting property is very important.
    And the materials to. See the Depthproperties, it can influence the final rendering. You must check and inspect all your scene's objects.

     
    • Alexander Dev

      Alexander Dev - 2018-09-14

      Thanks for the advice! camera.nearplanebias is something that I have overlooked. Increasing this value, I got what I wanted! This is amazing! Thank you!

       

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.