I've been developing a 3D scene modelization tool with GLScene for a little while and I noticed that the hardware limitation was not taken into account when displaying a silhouette in GLShadowVolume.
This leads to OpenGL crashes when a complex object silhouette has more indices than the hardware allows.
In TGLShadowVolume.DoRender , calls are made to GL.DrawElements for both sil.Indices and sil.CapIndices without checking if sil.Indices.Count is less or equal to GL_MAX_ELEMENTS_INDICES .
I think it would be better to check it and split it into multiple calls to GL.DrawElements. Do you agree ?
I will try to fix it now because I need it to work quickly. If you agree and want to implement the fix, just tell me.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I may be wrong about DrawElements limitation, as GL_MAX_ELEMENTS_INDICES seems to be a performance advice only for DrawRangedElements.
But I'm still getting an unknown error at some point thrown by DrawElements for a big object.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I managed to fix it, but this was not related to GLScene (good news ;)).
There was a memory corruption in another part of the software and I was using a wrong method when generating my objects silhouettes.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello there,
I've been developing a 3D scene modelization tool with GLScene for a little while and I noticed that the hardware limitation was not taken into account when displaying a silhouette in GLShadowVolume.
This leads to OpenGL crashes when a complex object silhouette has more indices than the hardware allows.
In TGLShadowVolume.DoRender , calls are made to GL.DrawElements for both sil.Indices and sil.CapIndices without checking if sil.Indices.Count is less or equal to GL_MAX_ELEMENTS_INDICES .
I think it would be better to check it and split it into multiple calls to GL.DrawElements. Do you agree ?
I will try to fix it now because I need it to work quickly. If you agree and want to implement the fix, just tell me.
I may be wrong about DrawElements limitation, as GL_MAX_ELEMENTS_INDICES seems to be a performance advice only for DrawRangedElements.
But I'm still getting an unknown error at some point thrown by DrawElements for a big object.
Hi have you try many big objects, not just one ? it is loaded un a TGLFreeForm ? can you post th error message ?
Yes do the job and post the result, any improvments are welcome ! :)
Hi,
I managed to fix it, but this was not related to GLScene (good news ;)).
There was a memory corruption in another part of the software and I was using a wrong method when generating my objects silhouettes.