Damn, I tested one more time, just to be sure it doesn't work, and it does indeed work using & and < :)
My bad. Maybe I forgot the ; yesterday. Thanks Christoph.

This being said, I never succeeded in running a geometry shader. The program starts without error, so the shaders are built and added in the repository, but when I add a FiberBundleX in the data manager, I always get the same Visual Studio error "Unhandled exception at 0x6916B759 (atioglxx.dll) in MI-Brain.exe: 0xC0000005: Access violation reading location 0x00000010."
File vtkOpenGLDisplayListPainter.cxx
Line 181 glCallList(iter->second);

I tried with 3 versions to be sure, but none of them works. I'm pretty sure 2) should work. 1) The shader I actually want to use, which keeps vertices only in a specific zone
2) Simple pass-through
#version 120
#extension GL_EXT_geometry_shader4 : enable
void main(void) {
  for (int i = 0; i < gl_VerticesIn; ++i) {
    gl_Position = gl_PositionIn[i];
    EmitVertex();
  }
}
3) Empty main() (not sure it's valid though)

Le 2014-08-21 06:05, Christoph Kolb a écrit :
Hi Nil,

for me, the entity references & < and > are working. can you give me the error message?

On 08/20/2014 07:55 PM, Nil Goyette wrote:
Hi Christoph,

Thanks for the fast answer and the fix! I wonder though, it seems impossible to write '<' and '&' in the xml shader files. The vtkXMLParser write an error on
parser->Parse(content.c_str());// VtkShaderRepository.cpp, line 198

If it was real xml, I would use &lt; and &amp;, but I can't. The parser refuses even a single &. I know I can avoid '<' using ! >= and '&&' using inner if, but it's not really an interesting solution. How am I supposed to write
for (i = 0; i < gl_VerticesIn; i++) {
and
if ((xMax > gl_PositionIn[i].x && xMin < gl_PositionIn[i].x)|| ...
?

Thanks for your time.

Le 2014-08-20 07:33, Christoph Kolb a écrit :
Hi Nil,

you are right, geometry shaders are not supported by mitk yet.
I just tried to implement them but I am not sure if it works or if we will support them in the near future:
http://bugs.mitk.org/show_bug.cgi?id=18026

Regards
Christoph


On 08/19/2014 04:15 PM, Nil Goyette wrote:
Hi all,

I tried replacing the Fragment shader in mitkShaderFiberClipping.xml with a Geometry shader, but I haven't been able to do it. One of the error was "Invalid scope for shader: GeometryShader", which lead me to vtkXMLMaterial.cpp where we can see this code:
switch (shader->GetScope()) {
case vtkXMLShader::SCOPE_VERTEX:
this->Internals->VertexShaders.push_back(shader);
  break;
case vtkXMLShader::SCOPE_FRAGMENT:
this->Internals->FragmentShaders.push_back(shader);
  break;
default:
  vtkErrorMacro("Invalid scope for shader: " << shader->GetName());
}

Is it possible that MITK doesn't accept geometry shader?

--
Logo Imeka <http://imeka.ca/>     Nil Goyette, M.Sc.
www.imeka.ca <http://imeka.ca/>



        

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to