It looks like you're new here. If you want to get involved, click one of these buttons!
Thread 1, Queue : com.apple.main-thread
#0 0x00000001018d7565 in _orxDebug_Break at /Users/sergei/SWDev/CrossPlatform/orx/code/build/mac/xcode/../../../src/debug/orxDebug.c:306
#1 0x00000001018c3ff0 in orxClock_SetModifier at /Users/sergei/SWDev/CrossPlatform/orx/code/build/mac/xcode/../../../src/core/orxClock.c:1059
#2 0x000000010000119c in InputUpdate at /Users/sergei/SWDev/CrossPlatform/orx/tutorial/build/mac/xcode/../../../src/02_Clock.c:132
#3 0x00000001018c2f2a in orxClock_Update at /Users/sergei/SWDev/CrossPlatform/orx/code/build/mac/xcode/../../../src/core/orxClock.c:555
#4 0x000000010000169a in orx_Execute at /Users/sergei/SWDev/CrossPlatform/orx/tutorial/build/mac/xcode/../../../../code/include/orx.h:346
#5 0x0000000100001432 in main at /Users/sergei/SWDev/CrossPlatform/orx/tutorial/build/mac/xcode/../../../src/02_Clock.c:230
#6 0x0000000102ead7e1 in start ()
Thread 1, Queue : com.apple.main-thread
#0 0x00000001018da565 in _orxDebug_Break at /Users/sergei/SWDev/CrossPlatform/orx/code/build/mac/xcode/../../../src/debug/orxDebug.c:306
#1 0x000000010193eb64 in orxDisplay_GLFW_SetShaderBitmap(void*, int, __orxBITMAP_t const*) at /Users/sergei/SWDev/CrossPlatform/orx/code/build/mac/xcode/../../../include/../plugins/Display/GLFW/orxDisplay.c:3978
#2 0x00000001018db862 in orxDisplay_SetShaderBitmap at /Users/sergei/SWDev/CrossPlatform/orx/code/build/mac/xcode/../../../src/display/orxDisplay.c:361
#3 0x000000010197811c in orxShader_Start at /Users/sergei/SWDev/CrossPlatform/orx/code/build/mac/xcode/../../../src/render/orxShader.c:794
#4 0x000000010197afa1 in orxShaderPointer_Start at /Users/sergei/SWDev/CrossPlatform/orx/code/build/mac/xcode/../../../src/render/orxShaderPointer.c:481
#5 0x0000000101979f5d in orxShaderPointer_EventHandler(__orxEVENT_t const*) at /Users/sergei/SWDev/CrossPlatform/orx/code/build/mac/xcode/../../../src/render/orxShaderPointer.c:145
#6 0x00000001018dc390 in orxEvent_Send at /Users/sergei/SWDev/CrossPlatform/orx/code/build/mac/xcode/../../../src/core/orxEvent.c:379
#7 0x000000010196ea09 in orxRender_Home_RenderObject(__orxOBJECT_t const*, __orxBITMAP_t*, __orxFRAME_t*, __orxDISPLAY_SMOOTHING_t, __orxDISPLAY_BLEND_MODE_t) at /Users/sergei/SWDev/CrossPlatform/orx/code/build/mac/xcode/../../../include/../plugins/Render/Home/orxRender.c:1261
#8 0x0000000101969f05 in orxRender_Home_RenderViewport(__orxVIEWPORT_t const*) at /Users/sergei/SWDev/CrossPlatform/orx/code/build/mac/xcode/../../../include/../plugins/Render/Home/orxRender.c:1987
#9 0x00000001019520c0 in orxRender_Home_RenderAll(__orxCLOCK_INFO_t const*, void*) at /Users/sergei/SWDev/CrossPlatform/orx/code/build/mac/xcode/../../../include/../plugins/Render/Home/orxRender.c:2083
#10 0x00000001018c5f2a in orxClock_Update at /Users/sergei/SWDev/CrossPlatform/orx/code/build/mac/xcode/../../../src/core/orxClock.c:555
#11 0x0000000100002a0a in orx_Execute at /Users/sergei/SWDev/CrossPlatform/orx/tutorial/build/mac/xcode/../../../../code/include/orx.h:346
#12 0x00000001000027a2 in main at /Users/sergei/SWDev/CrossPlatform/orx/tutorial/build/mac/xcode/../../../src/12_Lighting.c:484
#13 0x0000000102eb07e1 in start ()
[11:26:44] [LOG]
- 'MOUSE_LEFT' will create a new light under the cursor
- 'MOUSE_RIGHT' will clear all the lights from the scene
- 'MOUSE_WHEEL_UP' will increase the radius of the current light
- 'MOUSE_WHEEL_DOWN' will decrease the radius of the current light
- 'KEY_SPACE' will toggle alpha on light (ie. make holes in lit objects)
[11:26:44] [DISPLAY] [orxDisplay.c:orxDisplay_GLFW_CompileShader():644] Couldn't compile fragment shader:
ERROR: 0:5: '/' does not operate on 'float' and 'int'
ERROR: 0:13: '^' does not operate on 'int' and 'int'
ERROR: 0:13: Use of undeclared identifier 'vNormalizer'
[11:26:46] [ASSERT] [orxDisplay.c:orxDisplay_GLFW_SetShaderBitmap():3978] [ASSERT] : <eError == GL_NO_ERROR && "OpenGL error code: 0x502">
(lldb)
Comments
As for the second one, it means your OpenGL driver isn't able to compile the shader used by the tutorial #12.
The message "ERROR: 0:13: '^' does not operate on 'int' and 'int'" let me think your driver isn't capable of GLSL 1.30, which means you're using an OpenGL version < 3.0.
Is there a way for you to update your OpenGL drivers and try again?
I'll try on a macbook tonight.
You are correct. I loaded free app "OpenGL Extension Viewer 4.0" on my mac and it reports:
Renderer: AMD Radeon HD 6750M.
Version: 2.1 ATI-1.6.37
Shading language version: 1.20
I am not sure what I can do to get an updated version. I am on the latest os 10.8.3 and my Mac software update is fully up to date. If I am missing an update I will do it, but I don't know what it would be. Otherwise, it is good to know the issue is with my hardware.
Have you looked directly on ATI website for more recent mac drivers?
Otherwise, it's only the shader that is not working, you can either rewrite them or remove them entirely (the one not working is for display the checkered background, maybe the light/bumpmap one works?).
With Core I get:
Renderer: AMD Radeon HD 6750M OpenGL Engine Vendor: ATI Technologies Inc. Memory: 1024 MB Version: 3.2 ATI-1.6.37 Device: MacBookPro8,2 Shading language version: 1.50
With Compatibility I get:
Renderer: AMD Radeon HD 6750M OpenGL Engine Vendor: ATI Technologies Inc. Memory: 1024 MB Version: 2.1 ATI-1.6.37 Device: MacBookPro8,2 Shading language version: 1.20
Is there a chance I could compile the code differently and don't enable something? I had to mess with XCode project settings quite a bit until I got it all working (mostly locations and architecture).
I don't really want to waste your time on the issue. I have no problem accepting the behavior for what it is.
Here is the full report for the core
I'm still on 10.6 (and on OpenGL 2.1 actually, so I was wrong), so I might just update the shader tutorial to use GLSL 1.20 instead.
I used to have the same shader issues with tutorial 12 as described earlier in this thread (bitwise ops fail/GLSL version). Now, after a recent repo update and rebuilding the orx lib, this seems to have been fixed by putting in some conditional GLSL 1.2 compatible code.
This is nice if you really do have an old GPU, but the problem is that even though my machine should be more than capable of post 1.3 shaders, it is not recognized. Even if set the newly added ShaderVersion param in the Display config section to 130, I get a “not supported” error.
As was also mentioned earlier, this is because OSX does not support a compatibility mode for OpenGL 3/4, so you can only choose either a OpenGL 2 or or a forward-compatible OpenGL 3.2 core profile context. In GLFW, if you don’t select the 3.2 core profile explicitly with glfwOpenWindowHint, it defaults to GL2.
So I tried adding the following lines to orxDisplay_GLFW_SetVideoMode:
glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
This worked fine in a separate GLFW sandbox project I have running, but in orx, I get an error somewhere in the subsequent code, resulting in a "Failed to init GLFW/OpenGL default video mode" message. Now of course, it was too optimistic to think that it would just work, and my OpenGL/GLFW fu is too weak to figure out everything that is going on in orxDisplay.
iarwain, have you looked into initializing the core profile on mac since the last post?
I've been looking into this tonight as I'm now on OS X 10.9.
The first step was to compile GLFW with a more recent SDK as the previous binaries were made with 10.6 and it wouldn't have supported OpenGL Core 3.2 init. This has been pushed on the repository.
Now there is a more deeper problem as you've noticed. It's not working because the GLFW display plugin is still using some old OpenGL features that have been removed from the 3.1+ Core profiles (matrix stack, client states, etc...). Things are much more comfortable on Windows/Linux were there's no such restriction.
I'll be working on migrating it to support core profile in the coming days, but I will also need to support backward compatibility which always makes things a bit more tricky, especially with OS X in the mix.
I'll be using the OpenGL ES display plugins (iOS/Android) as reference as they're not based on any of the old features still in use in the GLFW plugin, hopefully that will make the whole process less painful.
I'm taking december off to visit family and I'll only have a macbook with me, hopefully I'll get to do that by then.