Help with SDL 1.3 and OpenGL 3.3/GLSL3.3core

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

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 :slight_smile:

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

So, i just put in a crap load of glGetError checks, and here is the problem
(glshader.cpp:77-78):

this->shader_vp = glCreateShader(GL_VERTEX_SHADER);
undeadland::logEnterFromGlError( glGetError(),

“(glshader.cpp:77->glCreateShader)” );

I get an error about the enumeration value, GL_VERTEX_SHADER, which is the
correct value, according to
http://www.opengl.org/sdk/docs/man/xhtml/glCreateShader.xml

Did I miss something to be able to use GL_VERTEX_SHADER?

Any help would be appreciated,
-AlexOn Thu, Nov 17, 2011 at 3:17 PM, Forest Hale wrote:

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 :slight_smile:

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/**procworldhttps://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/ 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.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


LordHavoc
Author of DarkPlaces Quake1 engine - http://icculus.org/twilight/**
darkplaces 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

_____________**
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

So, the shader issue was glew’s experimental option gone wrong, so I
stopped using that, (the call was glewExperimental = GL_TRUE; in
sdlapp.cpp:51, for those interested). I was still getting rendering
issues, but it turns out the issue is that I need a bound VAO (vertex array
object), so I got that, and I think I have it sorted out.

Thanks for the help, Forest,
-AlexOn Thu, Nov 17, 2011 at 6:22 PM, Alex Barry <@Alex_Barry> wrote:

So, i just put in a crap load of glGetError checks, and here is the
problem (glshader.cpp:77-78):

this->shader_vp = glCreateShader(GL_VERTEX_SHADER);
undeadland::logEnterFromGlError( glGetError(),

“(glshader.cpp:77->glCreateShader)” );

I get an error about the enumeration value, GL_VERTEX_SHADER, which is the
correct value, according to
http://www.opengl.org/sdk/docs/man/xhtml/glCreateShader.xml

Did I miss something to be able to use GL_VERTEX_SHADER?

Any help would be appreciated,
-Alex

On Thu, Nov 17, 2011 at 3:17 PM, Forest Hale wrote:

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 :slight_smile:

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/**procworldhttps://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/ 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.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


LordHavoc
Author of DarkPlaces Quake1 engine - http://icculus.org/twilight/**
darkplaces 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

_____________**
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hi, me again,

So, now I’ve debugged the crap out of my OpenGL code, and rooted out all
the errors, but I still have the misfortune of having nothing rendered to
my screen.

Any help reviewing my code would be greatly appreciated. If this is out of
scope for the SDL mailing list, I understand, and I’ll repost in a more
appropriate forum.

Thanks ladies and gents,
-AlexOn Fri, Nov 18, 2011 at 12:50 PM, Alex Barry <@Alex_Barry> wrote:

So, the shader issue was glew’s experimental option gone wrong, so I
stopped using that, (the call was glewExperimental = GL_TRUE; in
sdlapp.cpp:51, for those interested). I was still getting rendering
issues, but it turns out the issue is that I need a bound VAO (vertex array
object), so I got that, and I think I have it sorted out.

Thanks for the help, Forest,
-Alex

On Thu, Nov 17, 2011 at 6:22 PM, Alex Barry <@Alex_Barry> wrote:

So, i just put in a crap load of glGetError checks, and here is the
problem (glshader.cpp:77-78):

this->shader_vp = glCreateShader(GL_VERTEX_SHADER);
undeadland::logEnterFromGlError( glGetError(),

“(glshader.cpp:77->glCreateShader)” );

I get an error about the enumeration value, GL_VERTEX_SHADER, which is
the correct value, according to
http://www.opengl.org/sdk/docs/man/xhtml/glCreateShader.xml

Did I miss something to be able to use GL_VERTEX_SHADER?

Any help would be appreciated,
-Alex

On Thu, Nov 17, 2011 at 3:17 PM, Forest Hale wrote:

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 :slight_smile:

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/**procworldhttps://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/ 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.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


LordHavoc
Author of DarkPlaces Quake1 engine - http://icculus.org/twilight/**
darkplaces 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

_____________**
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Have you tried running your program under gDEBugger?? It’s a specialized debugger specifically for OpenGL, and it can help you catch a lot of stuff.________________________________
From: alex.barry@gmail.com (Alex Barry)
Subject: Re: [SDL] Help with SDL 1.3 and OpenGL 3.3/GLSL3.3core

Hi, me again,

So, now I’ve debugged the crap out of my OpenGL code, and rooted out all the errors, but I still have the misfortune of having nothing rendered to my screen.

Any help reviewing my code would be greatly appreciated. ?If this is out of scope for the SDL mailing list, I understand, and I’ll repost in a more appropriate forum.

Thanks ladies and gents,
-Alex

On Fri, Nov 18, 2011 at 12:50 PM, Alex Barry <alex.barry at gmail.com> wrote:

So, the shader issue was glew’s experimental option gone wrong, so I stopped using that, (the call was?glewExperimental = GL_TRUE; in sdlapp.cpp:51, for those interested). ?I was still getting rendering issues, but it turns out the issue is that I need a bound VAO (vertex array object), so I got that, and I think I have it sorted out.

Thanks for the help, Forest,
-Alex

On Thu, Nov 17, 2011 at 6:22 PM, Alex Barry <alex.barry at gmail.com> wrote:

So, i just put in a crap load of glGetError checks, and here is the problem (glshader.cpp:77-78):

? ? this->shader_vp = glCreateShader(GL_VERTEX_SHADER);
? ? undeadland::logEnterFromGlError( glGetError(), “(glshader.cpp:77->glCreateShader)” );

I get an error about the enumeration value, GL_VERTEX_SHADER, which is the correct value, according to?http://www.opengl.org/sdk/docs/man/xhtml/glCreateShader.xml

Did I miss something to be able to use GL_VERTEX_SHADER?

Any help would be appreciated,
-Alex

On Thu, Nov 17, 2011 at 3:17 PM, Forest Hale wrote:

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 :slight_smile:

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


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I’ve never heard of that, but it looks promising, thanks Mason :)On Sat, Nov 19, 2011 at 8:58 AM, Mason Wheeler wrote:

Have you tried running your program under gDEBugger? It’s a specialized
debugger specifically for OpenGL, and it can help you catch a lot of stuff.


From: Alex Barry <@Alex_Barry>
****Subject: Re: [SDL] Help with SDL 1.3 and OpenGL 3.3/GLSL3.3core

Hi, me again,

So, now I’ve debugged the crap out of my OpenGL code, and rooted out all
the errors, but I still have the misfortune of having nothing rendered to
my screen.

Any help reviewing my code would be greatly appreciated. If this is out
of scope for the SDL mailing list, I understand, and I’ll repost in a more
appropriate forum.

Thanks ladies and gents,
-Alex

On Fri, Nov 18, 2011 at 12:50 PM, Alex Barry <@Alex_Barry> wrote:

So, the shader issue was glew’s experimental option gone wrong, so I
stopped using that, (the call was glewExperimental = GL_TRUE; in
sdlapp.cpp:51, for those interested). I was still getting rendering
issues, but it turns out the issue is that I need a bound VAO (vertex array
object), so I got that, and I think I have it sorted out.

Thanks for the help, Forest,
-Alex

On Thu, Nov 17, 2011 at 6:22 PM, Alex Barry <@Alex_Barry> wrote:

So, i just put in a crap load of glGetError checks, and here is the
problem (glshader.cpp:77-78):

this->shader_vp = glCreateShader(GL_VERTEX_SHADER);
undeadland::logEnterFromGlError( glGetError(),

“(glshader.cpp:77->glCreateShader)” );

I get an error about the enumeration value, GL_VERTEX_SHADER, which is the
correct value, according to
http://www.opengl.org/sdk/docs/man/xhtml/glCreateShader.xml

Did I miss something to be able to use GL_VERTEX_SHADER?

Any help would be appreciated,
-Alex

On Thu, Nov 17, 2011 at 3:17 PM, Forest Hale wrote:

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 :slight_smile:

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/**procworldhttps://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

_____________**
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

So, I’ve ran that, and I have no OpenGL errors from my own code, so I’m
completely confused.
I’ve stepped through my code a number of times, and everything checks out,
but I’m still not getting any thing on my screen. I’m sure it’s just a
one-liner issue somewhere, but I can’t seem to find that one line.
I’ll start a thread over at
gamedevhttp://www.gamedev.net/topic/615416-trying-to-render-a-set-of-point-data/to
see if anyone there can help, too.

Thanks,
-AlexOn Sat, Nov 19, 2011 at 11:34 AM, Alex Barry <@Alex_Barry> wrote:

I’ve never heard of that, but it looks promising, thanks Mason :slight_smile:

On Sat, Nov 19, 2011 at 8:58 AM, Mason Wheeler wrote:

Have you tried running your program under gDEBugger? It’s a specialized
debugger specifically for OpenGL, and it can help you catch a lot of stuff.


From: Alex Barry <@Alex_Barry>
****Subject: Re: [SDL] Help with SDL 1.3 and OpenGL 3.3/GLSL3.3core

Hi, me again,

So, now I’ve debugged the crap out of my OpenGL code, and rooted out all
the errors, but I still have the misfortune of having nothing rendered to
my screen.

Any help reviewing my code would be greatly appreciated. If this is out
of scope for the SDL mailing list, I understand, and I’ll repost in a more
appropriate forum.

Thanks ladies and gents,
-Alex

On Fri, Nov 18, 2011 at 12:50 PM, Alex Barry <@Alex_Barry>wrote:

So, the shader issue was glew’s experimental option gone wrong, so I
stopped using that, (the call was glewExperimental = GL_TRUE; in
sdlapp.cpp:51, for those interested). I was still getting rendering
issues, but it turns out the issue is that I need a bound VAO (vertex array
object), so I got that, and I think I have it sorted out.

Thanks for the help, Forest,
-Alex

On Thu, Nov 17, 2011 at 6:22 PM, Alex Barry <@Alex_Barry> wrote:

So, i just put in a crap load of glGetError checks, and here is the
problem (glshader.cpp:77-78):

this->shader_vp = glCreateShader(GL_VERTEX_SHADER);
undeadland::logEnterFromGlError( glGetError(),

“(glshader.cpp:77->glCreateShader)” );

I get an error about the enumeration value, GL_VERTEX_SHADER, which is
the correct value, according to
http://www.opengl.org/sdk/docs/man/xhtml/glCreateShader.xml

Did I miss something to be able to use GL_VERTEX_SHADER?

Any help would be appreciated,
-Alex

On Thu, Nov 17, 2011 at 3:17 PM, Forest Hale wrote:

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 :slight_smile:

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/**procworldhttps://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

_____________**
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/**listinfo.cgi/sdl-libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org