Page 1 of 1

LOD sphere mesh uses NV extensions

Posted: 27.03.2003, 13:39
by Broken
1.3.0pre4 was crashing on my machine with a Radeon 9700 so I decided to have a look.
In LodSphereMesh::Render you've got:


glEnableClientState(GL_VERTEX_ATTRIB_ARRAY6_NV);
glx::glVertexAttribPointerNV(6, 3, GL_FLOAT, 0, tangents);

with a nice assume NV extensions comment :roll: which of course will crash on any pc with an ati card as glVertexAttribPointerNV will be a null pointer. I had a look for the equivalent ARB extensions but I didn't have a clue. There are some nasty looking function names in there.

LOD sphere mesh uses NV extensions

Posted: 27.03.2003, 19:26
by chris
Broken wrote:1.3.0pre4 was crashing on my machine with a Radeon 9700 so I decided to have a look.
In LodSphereMesh::Render you've got:


glEnableClientState(GL_VERTEX_ATTRIB_ARRAY6_NV);
glx::glVertexAttribPointerNV(6, 3, GL_FLOAT, 0, tangents);

with a nice assume NV extensions comment :roll: which of course will crash on any pc with an ati card as glVertexAttribPointerNV will be a null pointer. I had a look for the equivalent ARB extensions but I didn't have a clue. There are some nasty looking function names in there.


Oops! When attempting to add a standard OpenGL 1.4 render path to Celestia, I neglected to convert that function to use glVertexAttribPointerARB when the NVIDIA extension isn't used. This is obviously what's been preventing bump-mapping and other effects from from working on ATI cards. I'll fix this ASAP and put out another prerelease. For now, you can uncomment this line:

IgnoreGLExtensions [ "GL_ARB_vertex_program" ]

in celestia.cfg. This will disable the advanced rendering effects, but it will at least prevent crashing.

--Chris

Posted: 28.03.2003, 14:35
by Broken
Good stuff. Thanks.

Posted: 28.03.2003, 19:28
by chris
I believe that I've fixed the problem. Give 1.3.0pre5 a try:

http://www.shatters.net/celestia/files/celestia-win32-1.3.0pre5

--Chris

Posted: 29.03.2003, 19:40
by Broken
:D Fixed!
Yay for shiny bumpy planets!