timscaffidi / ofxVolumetrics

Simple volumetric rendering addon for openFrameworks.
Other
53 stars 15 forks source link

Update for oF 0.11.0 #10

Closed mimetikxs closed 3 years ago

mimetikxs commented 3 years ago

Hi,

Thanks for sharing this addon :)

I've made some changes to make it work in OF 0.11.0 and be compatible with the programmable renderer.

Here's a list with the most relevant:

Best wishes, Nestor

timscaffidi commented 3 years ago

Hey Nestor, Many thanks for taking this on! Apologies I have note gotten around to reviewing this PR till now.

Just pulled it down on macOS and noticed the example fails to load the gl3 shaders:

setting up volume data buffer at 256x256x99
[verbose] ofShader: checkAndCreateProgram(): creating GLSL program
[ error ] ofShader: setupShaderFromSource(): GL_VERTEX_SHADER shader failed to compile
[ error ] ofShader: GL_VERTEX_SHADER shader reports:
ERROR: 0:1: '' :  version '130' is not supported
ERROR: 0:2: '' :  #version required and missing.

[ error ] ofShader: GL_VERTEX_SHADER, offending line 1 :
        1   #version 130
        2   
        3   in vec4 position;

[ error ] ofShader: setupShaderFromSource(): GL_FRAGMENT_SHADER shader failed to compile
[ error ] ofShader: GL_FRAGMENT_SHADER shader reports:
ERROR: 0:1: '' :  version '130' is not supported
ERROR: 0:2: '' :  #version required and missing.

[ error ] ofShader: GL_FRAGMENT_SHADER, offending line 1 :
        1   #version 130
        2   //#extension GL_ARB_texture_rectangle : enable
        3   

[verbose] ofShader: linkProgram(): attaching GL_FRAGMENT_SHADER shader to program 28
[verbose] ofShader: linkProgram(): attaching GL_VERTEX_SHADER shader to program 28
[ error ] ofShader: checkProgramLinkStatus(): program failed to link
[ error ] ofShader: ofShader: program reports:
ERROR: One or more attached shaders not successfully compiled

I was able to fix this by replacing the version with 150, which is the GLSL version corresponding to OpenGL 3.2, which the example uses. This could be down to platform and driver compatibility, but I think version 150 is the safer choice. So I'm merging this but also making that change post-merge.

Again, thank you so much!

mimetikxs commented 3 years ago

Hey Tim,

You're right about glsl version. I also had to change it to 150 when I used my branch on a mac but forgot to commit the changes.

Glad I could help a bit, your addon's been very useful :)