Menu

Texture3D demo and shaders

Help
Ronald
2022-01-16
2022-01-25
  • Ronald

    Ronald - 2022-01-16

    Hello,

    Refer to attached modified Texture3D demo. I added support for shaders, hopefully allowing to implement transfer function via shaders. For that, I need to be able to modify RGBA value of texture voxels being displayed.

    However, does not work as expected.

    I am unable to access texture index of voxels being rendered via shader (tried both vertex and fragment).

    Any ideas? Am I on the right track or not?

    Regards, Ronald

     
  • Ronald

    Ronald - 2022-01-22

    Hi Pavel,

    I did use the latest version. (Error message was caused by vertex shader, where uniform was declared, but not used.)

    Refer to attached zip for working version, in the sense that texturecolor is applied via shaders.

    However, I wonder if there is a more "GLScene way of doing things":

    1. 3D texture. In demo is setup outside GLScene. Would it be possible to use TGLFreeForm for handling vertices drawing, and/or material lib rfor handling texture?
    2. Shaders. I was unable to use TGLSLShader component, as I had no material to connect the component to.

    Suggestions to use more GLScene functionality instead of direct OpenGL functionality are highly appreciated.

    Regards, Ronald

     
  • Pavel Vassiliev

    Pavel Vassiliev - 2022-01-25

    Ronald,
    Yes, instead of DirectOpenGL there is a raw unit GLS.Texture3D with class TGLTexture3D to LoadFromFile a 3dtex to TGLFreeForms or TGLPoints after volume rendering, but it's not ready now. So may be next month or later, if you will not help.
    Pavel.

     

Log in to post a comment.