OpenGL 3+ RenderSystem

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: OpenGL 3+ RenderSystem

Post by masterfalcon »

From the looks of things, on linux at least, you can't have both the GL and GL3+ plugins installed at the same time. We'll have to look into that. But you can just do a build with GL disabled for now.
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 538

Re: OpenGL 3+ RenderSystem

Post by Kojack »

I haven't looked at the gl code, but windows will probably have that too. I'd guess it's because of the way ogre handles rendersystem plugins. Every rendersystem is initialised before a rendersystem is chosen. It's the same reason why you can't have the dx11 plugin present (even if you don't pick it in the config dialog) on an os without dx11 support (I assume that's still the case, it used to be).
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: OpenGL 3+ RenderSystem

Post by masterfalcon »

You're right, I just checked. I'll have to disable GL if GL3+ is enabled.
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 220

Re: OpenGL 3+ RenderSystem

Post by scrawl »

Wouldn't it be sufficient to not load the GL rendersystem .so/.dll at runtime?
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 220

Re: OpenGL 3+ RenderSystem

Post by scrawl »

Got it to build using the correct repo. make install aborts with:

Code: Select all

-- Installing: /usr/include/OGRE/RenderSystems/GL3Plus/GLX/OgreGL3PlusUtil.h
CMake Error at RenderSystems/GL3Plus/cmake_install.cmake:219 (FILE):
  file INSTALL cannot find
  "/home/scrawl/ogre/RenderSystems/GL3Plus/include/GL3Plus".
Call Stack (most recent call first):
  RenderSystems/cmake_install.cmake:37 (INCLUDE)
  cmake_install.cmake:122 (INCLUDE)
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: OpenGL 3+ RenderSystem

Post by masterfalcon »

Ah. Make install hasn't even been tried yet.
User avatar
holocronweaver
Google Summer of Code Student
Google Summer of Code Student
Posts: 273
Joined: Mon Oct 29, 2012 8:52 pm
Location: Princeton, NJ
x 47

Re: OpenGL 3+ RenderSystem

Post by holocronweaver »

I am on Ubuntu 12.04 and am using the official 1.9 branch of the Mercurial repository. I actually was a little hasty earlier in thinking that my error was the same as scrawl. Similar error, different file, and the problem only occurs when I have tests enabled. I can build with GL and GL3+ simultaneously enabled, no problem, so long as tests are disabled.

Code: Select all

-- Configuring done
CMake Error at CMake/Utils/OgreAddTargets.cmake:121 (add_executable):
  Cannot find source file:

    /src/ogre/Samples/Browser/src/FileSystemLayerImpl_Unix.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx
Call Stack (most recent call first):
  Tests/VisualTests/Context/CMakeLists.txt:48 (ogre_add_executable)
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: OpenGL 3+ RenderSystem

Post by masterfalcon »

Thanks. I'll have to try building with the tests(hasn't been done yet).
User avatar
boyamer
Orc
Posts: 459
Joined: Sat Jan 24, 2009 11:16 am
Location: Italy
x 6

Re: OpenGL 3+ RenderSystem

Post by boyamer »

I'm getting compilation problem with:

Code: Select all

 glDebugMessageCallbackARB(&GLDebugCallback, NULL);
Error says:

Code: Select all

Error	12	error C2664: 'void (GLDEBUGPROCARB,const GLvoid *)' : cannot convert parameter 1 from 'void (__cdecl *)(GLenum,GLenum,GLuint,GLenum,GLsizei,const GLchar *,GLvoid *)' to 'GLDEBUGPROCARB'	K:\Alimer\Wrappers\Ogre\RenderSystems\GL3Plus\src\OgreGL3PlusRenderSystem.cpp	2225	1	RenderSystem_GL3Plus
Seams that the callback has wrong signature.
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: OpenGL 3+ RenderSystem

Post by masterfalcon »

Ah yes, I have that fixed locally. I'll push the change today.
User avatar
holocronweaver
Google Summer of Code Student
Google Summer of Code Student
Posts: 273
Joined: Mon Oct 29, 2012 8:52 pm
Location: Princeton, NJ
x 47

Re: OpenGL 3+ RenderSystem

Post by holocronweaver »

I am trying once more to test out OpenGL tessellation shaders, but I cannot even get the basic tutorial or the samples to work when using GL3Plus. What is the easiest way to get a small test system up and running so I can help test and debug the GL3Plus code? I want to get it prime time ready. :)
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: OpenGL 3+ RenderSystem

Post by masterfalcon »

What kind of problem are you having?
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 220

Re: OpenGL 3+ RenderSystem

Post by scrawl »

Yeah I had the same problem with the sample browser crashing. I thought that was sort of expected, but since you're asking, I guess it is supposed to work?
User avatar
holocronweaver
Google Summer of Code Student
Google Summer of Code Student
Posts: 273
Joined: Mon Oct 29, 2012 8:52 pm
Location: Princeton, NJ
x 47

Re: OpenGL 3+ RenderSystem

Post by holocronweaver »

Using the Tutorial Framework and first tutorial on the wiki, all I get is a black screen using GL3+. Plain GL works fine, showing the Ogre head and GUI.

To my knowledge, the only way to run the samples is using the sample browser application. The browser runs in GL3+, but everything appears garbled. I have attached a screenshot in case it helps.

Getting both the tutorial and the sample browser working would definitely be a good start.
You do not have the required permissions to view the files attached to this post.
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 220

Re: OpenGL 3+ RenderSystem

Post by scrawl »

Well I think the tutorial won't work because it does not use shaders. And the RTSS FFP emulation is not done automatically (and can't, because RTSS is a component).

I will retry running sample browser and see what I get. Last time I had a segfault, I think.
User avatar
holocronweaver
Google Summer of Code Student
Google Summer of Code Student
Posts: 273
Joined: Mon Oct 29, 2012 8:52 pm
Location: Princeton, NJ
x 47

Re: OpenGL 3+ RenderSystem

Post by holocronweaver »

Well I think the tutorial won't work because it does not use shaders.
The GL3+ render system does not allow the compatibility profile? Interesting. I am not planning on using fixed functions, but worth knowing nontheless.
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 220

Re: OpenGL 3+ RenderSystem

Post by scrawl »

holocronweaver wrote:
Well I think the tutorial won't work because it does not use shaders.
The GL3+ render system does not allow the compatibility profile? Interesting. I am not planning on using fixed functions, but worth knowing nontheless.
First page:
Core profile only. Meaning that no legacy functionality is supported. Most notably, fixed function rendering
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: OpenGL 3+ RenderSystem

Post by masterfalcon »

Ah, ok. I've seen that texture issue and am working on resolving it. Just to be certain, what are your OS and GPU specs?
User avatar
holocronweaver
Google Summer of Code Student
Google Summer of Code Student
Posts: 273
Joined: Mon Oct 29, 2012 8:52 pm
Location: Princeton, NJ
x 47

Re: OpenGL 3+ RenderSystem

Post by holocronweaver »

@scrawl
Whoops, sorry, should have thought to check the front page. :oops:

@masterfalcon
Ubuntu 12.04 + AMD HD 6950 (latest proprietary drivers)
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 220

Re: OpenGL 3+ RenderSystem

Post by scrawl »

Ok nevermind. I pulled the latest code and the sample browser works now (and most of the samples, even :) )
User avatar
holocronweaver
Google Summer of Code Student
Google Summer of Code Student
Posts: 273
Joined: Mon Oct 29, 2012 8:52 pm
Location: Princeton, NJ
x 47

Re: OpenGL 3+ RenderSystem

Post by holocronweaver »

What is your OS & graphics card?
scrawl
OGRE Expert User
OGRE Expert User
Posts: 1119
Joined: Sat Jan 01, 2011 7:57 pm
x 220

Re: OpenGL 3+ RenderSystem

Post by scrawl »

Same OS, Nvidia binary blob.
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: OpenGL 3+ RenderSystem

Post by Transporter »

I have to add

Code: Select all

FileSystem=../../media/materials/programs/GLSL
to resources.cfg (https://ogre3d.atlassian.net/browse/OGRE-140). Now I can start the Sample_Browser. But I have a black screen and it's freezing after a few seconds.
You do not have the required permissions to view the files attached to this post.
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: OpenGL 3+ RenderSystem

Post by masterfalcon »

Unfortunately my windows install is hosed again. So I won't be able to help you with that. Perhaps someone else can step up?
TheSHEEEP
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 972
Joined: Mon Jun 02, 2008 6:52 pm
Location: Berlin
x 65

Re: OpenGL 3+ RenderSystem

Post by TheSHEEEP »

I had a look and figured out (with the help of wise GDB) that the crash with the GL3+ system (at least on my machine (Win 7 64 bit, NVidia GTX 580) and built with MinGW GCC 4.7.2), is due to this line (OgreWin32GLSupport.cpp:664):

Code: Select all

PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormat = (PFNWGLCHOOSEPIXELFORMATARBPROC)wglGetProcAddress("wglChoosePixelFormatARB");
It doesn't crash there, but wglGetProcAddress returns NULL and then it crashes in the next line when trying to execute wglChoosePixelFormat.

According to this thread, this is due to the context not being valid.

Hope that helps someone more experienced in "raw" OpenGL to fix this problem, but my guess is that the selectPixelFormat is called too early (no context yet) for some reason, or the context became invalid for some other reason.
I'll also file a bug report for this.
My site! - Have a look :)
Also on Twitter - extra fluffy