[SDL] Help with SDL 1.3 and OpenGL 3.3/GLSL3.3core
Forest Hale
havoc at ghdigital.com
Thu Nov 17 12:17:12 PST 2011
I briefly glanced at the code and don't notice anything out of the ordinary at a glance, but why are you not checking glGetError() after each gl call? It is often the first step in debugging OpenGL
problems.
If you were not targeting GL3.3core I would suggest doing some simpler debugging tests with glBegin and such.
In any case these are the usual suspects:
glClear - make sure your glDepthMask and glColorMask and glStencilMask and such are TRUE before you clear the corresponding buffer bit or it won't work.
glScissor - make sure your glScissor includes the area you wish to render into, if GL_SCISSOR_TEST is enabled at least.
glUniformMatrix - make sure your matrix is good, and not transposed.
glColorMask/glDepthMask/glStencilMask - make sure you have the write masks enabled that you think you do :)
When in doubt I often fall back to reproducing the same intended result by other means, like doing a screen coordinate transform in software (equivalent to gluProject stuff) to make sure I have
everything right (checking if the pixel coords are in bounds, etc).
On 11/17/2011 08:41 AM, Alex Barry wrote:
> Hi,
> I don't know if this is the right place to post this, as it's not necessarily an SDL issue, but I'm stuck trying to render a land-mesh, which for some reason just won't render.
> I have the project on github, and it can be found here: https://github.com/mrozbarry/procworld (if you see any code you like, you can steal it - I currently don't have a license for this source, so
> while the getting is good... :P)
>
> So, I was originally doing a huge triangle mesh to try and render that, and I got frustrated with it, so I re-coded it into a point cloud, just to get the rendering done, and it still doesn't work.
> The opengl/sdl code is spread between a few different files:
>
> * sdlapp.* has most of the SDL centric code in it - I don't think the issue is here, but maybe I'm wrong...
> * glshader.* has the shader loading/validation routines, which also seems to work fine
> * landscape.* generates the landscape, and has the rendering routine in it
> * camera.* has most of the matrix transforms in it
>
> I've been banging my head over this for a few days, and can't get anything to render at all. What's more frustrating is that I am helping convert some of the tutorials from
> http://www.opengl-tutorials.org/ , and I'm using a similar sdlapp setup, and it works perfectly, and everything displays.
>
> I'll be the first to admit that I'm not a guru or anything in OpenGL, and especially GLSL (the only opengl i've done up to this point has been OpenGL 1.1), so any help would be great.
>
> Take care, gents,
> -Alex
>
>
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
--
LordHavoc
Author of DarkPlaces Quake1 engine - http://icculus.org/twilight/darkplaces
Co-designer of Nexuiz - http://alientrap.org/nexuiz
"War does not prove who is right, it proves who is left." - Unknown
"Any sufficiently advanced technology is indistinguishable from a rigged demo." - James Klass
"A game is a series of interesting choices." - Sid Meier
More information about the SDL
mailing list