Attached is a modified version of GLScene Texture3D demo ( exploring the use shaders):
color is read from texture and applied via shaders, works ok. So, passing a 3D texture to shaders works.
option for raycasting via shaders :does not work.
For the raycasting via the fragment shader, I used the example glsl code from the OpenGl Development Cookbook, as found on github
However, I can't get the raycasting to work. as can be seen in the demo,
Slicing does work OK, so issue must be in shader code, or in uniforms sent to shader.
I tried several options (mainly camera positioning), but nothing works.
Hello Ronald,
Please, use current version of GLScene from trunk. Your project files in that case must be with the same names as in Texture 3d demo to campare it in Beyond Campare tool. And if your code based on third party sources use the GLDirectOpenGL object for the raycasting.
Sincerely
Paul
Refer to attached zip file for version from GLScene Trunk. Same issue, unfortunately.
In previous version, disabled Cadencer, which is unnecessary imho.
In this version, I left it enabled, in order to have the lease differences using Beyond Compare. Also for Beyond Compare, I saved dfm as text.
Any ideas tow to make single pass raycasting work are highly appreciated.
To answer your first question: I downloaded Texture3D demo yesterday from GLScene User Demos 2.1 on Sourceforge, https://sourceforge.net/projects/glscene/files/User%20Demos/User%20Demos%202.1/Textures.zip/download. The URL you mention is not listed under Files, for people who download GLScene latest version and/or demos and/or user demos from Sourceforge. Now you mentioned it, I found it under Code. This is not a place where I would have looked, as I would consider that "development stage", and expected a release stage under Files/User Demos.
Anyway, now I found it, I will provide a demo based on that later today.
I did look at MRIcroGL, and tried his shader code, but for some reason, this does not work with GLScene either.
I also studied the GLScene Raycast demo, but that does not use a shader.
So my issue remains the same: how to get single pass raycasting via shaders working with GLScene?
Best regards, Ronald
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Attached is a modified version of GLScene Texture3D demo ( exploring the use shaders):
For the raycasting via the fragment shader, I used the example glsl code from the OpenGl Development Cookbook, as found on github
However, I can't get the raycasting to work. as can be seen in the demo,
Slicing does work OK, so issue must be in shader code, or in uniforms sent to shader.
I tried several options (mainly camera positioning), but nothing works.
Ideas/suggestions are welcome.
Regards, Ronald
Hello Ronald,
Please, use current version of GLScene from trunk. Your project files in that case must be with the same names as in Texture 3d demo to campare it in Beyond Campare tool. And if your code based on third party sources use the GLDirectOpenGL object for the raycasting.
Sincerely
Paul
Hi Pavel,
Refer to attached zip file for version from GLScene Trunk. Same issue, unfortunately.
In previous version, disabled Cadencer, which is unnecessary imho.
In this version, I left it enabled, in order to have the lease differences using Beyond Compare. Also for Beyond Compare, I saved dfm as text.
Any ideas tow to make single pass raycasting work are highly appreciated.
Regards, Ronald
Last edit: Ronald 2022-02-24
Ronald,
Sorry, I don't know why you every time don't start from the original project code https://sourceforge.net/p/glscene/code/HEAD/tree/branches/Examples/Textures/Texture3D/fTex3D.pas and then improve it. I'm beaten of comparing your sources.
About ray cast look at
https://sourceforge.net/p/glscene/code/HEAD/tree/trunk/Demos/collisions/Raycast/
and for volume rendering try to search the very great project
https://github.com/rordenlab/MRIcroGL
Where there is also a PythonBridge.
Sincerely
Pavel
Last edit: Pavel Vassiliev 2022-02-25
Hi Pavel,
To answer your first question: I downloaded Texture3D demo yesterday from GLScene User Demos 2.1 on Sourceforge, https://sourceforge.net/projects/glscene/files/User%20Demos/User%20Demos%202.1/Textures.zip/download. The URL you mention is not listed under Files, for people who download GLScene latest version and/or demos and/or user demos from Sourceforge. Now you mentioned it, I found it under Code. This is not a place where I would have looked, as I would consider that "development stage", and expected a release stage under Files/User Demos.
Anyway, now I found it, I will provide a demo based on that later today.
I did look at MRIcroGL, and tried his shader code, but for some reason, this does not work with GLScene either.
I also studied the GLScene Raycast demo, but that does not use a shader.
So my issue remains the same: how to get single pass raycasting via shaders working with GLScene?
Best regards, Ronald
Hello,
Now I understood you, please find attached a project based on rev 7405. Still the same issue, no idea what I am doing wrong.
Ideas/suggestions welcome.
Regards, Ronald
Hello Ronald,
I'll look at your improvements a little bit later.
Sincerely, Pavel