Game Development Community

Torque3D OSX Status

by Luis Anton Rebollo · in Torque 3D Professional · 01/20/2014 (11:55 am) · 26 replies

imagizer.imageshack.us/v2/800x600q90/194/ohhc.png

You can find the code at: github.com/LuisAntonRebollo/Torque3D/tree/dev_osx_opengl

This branch is a fork on Linux/OpenGL with UPDATED project generator for Xcode 5 and MINIMAL changes for allow compilation. All the merit is for the people of GG.

Currently am sorry to say that I can only give a very limited support by not having easy access to an Apple computer.

Reporting bugs:

If possible, Github is a great place to post issues to a forum.

Torque3D Crowdfunding for Linux, SteamOS, OSX, iOS, Android

I appreciate any donation to help the project. https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif.
Page «Previous 1 2
#1
01/20/2014 (11:59 am)
Quote:Writing...
Waiting...
#2
01/20/2014 (2:34 pm)
I submitted a pull request with this code and this code.
#3
01/21/2014 (3:58 am)
@Thomas, It seems that has compiled correctly :D

Thank you for your contributions, note that you have far more experience than i am in OSX. I've left a few comments on Github.

I will ask the Mac this weekend to merge with your commits.
#4
02/19/2014 (3:59 am)
(continuing from linux thread...)

@JeffH Which graphics card do you have that you get those weird render issues in advanced lighting?
#5
02/19/2014 (12:01 pm)
Jeff's parter in crime here, I'm the OSX guy. Currently using an Intel Iris Pro 1024MB graphics card. I laid out most of my specs in my GitHub issue.
#6
02/19/2014 (2:49 pm)
Ive done some digging and some work on opengl in mac. It using 2.x so Ive been trying to upgrade it to 3.2 but hit a road block so far. I got the shaders converted over and changed a few things with setting up opengl but right now it's not producing any errors but it's also not rendering anything at all. So gonna spend a bit more time on it to see if i can figure out the issue. Id rather have opengl 3.2.
#7
02/19/2014 (3:05 pm)
Believe me I'd rather have opengl 3.2 also. However, not gonna complain about it because we wouldn't have any opengl without Luis. Thanks again for looking into this Tim, Glenn and myself really appreciate it. Take your time, maybe 3.2 might auto fix this rendering issue in itself? haha.
#8
02/20/2014 (10:33 am)
I made some progress this morning. Using apple's tool OpenGL Profiler, I was able to find out what was causing nothing to render. OpenGL 3.2 Core requires VAOs, so I updated the code with a VAO and now the main menu is rendering although I am still getting some others errors so working on tracking those down next. I think the VAO code is still not 100% which is causing some other issues so I am going to work on refactoring that code next.
#9
02/20/2014 (11:59 am)
Awesome to hear tim!
#10
02/20/2014 (4:29 pm)
So its gonna take a good bit of refactoring of GFX to fix this VAO issue. The problem is the same VAO needs to contain both the VBO and the IBO. Since GFX was written for DirectX, its not setup to handle that. So Im gonna have to figure out best way to extend it
#11
02/23/2014 (3:57 am)
@Tim
A non-zero Vertex Array Object must be bound (though no arrays have to be enabled, so it can be a freshly-created vertex array object).

A simple solution is to create a VAO and bind it at startup, fixes errors:
OPENGL: GL_INVALID_OPERATION error generated. Array object is not active.
OPENGL: GL_INVALID_OPERATION error generated. Invalid VAO/VBO/pointer usage.

Do not know if you'll get some kind of penalty to performance.
#12
02/23/2014 (5:04 am)
I was working on trying to replace the VBO and IBO calls with a BufferManager that would set the VAO, VBO, and IBO but it is a lot of work to modify GFX for that so I have put the 3.2 port on hold for now. Im gonna focus instead on the errors in 2.x. I may revisit 3.2 later.
#13
02/24/2014 (5:02 am)
So as I worked further on opengl 3.2 port, the more and more work it was requiring to do what I wanted to. So I archived the port and decided to just get the current opengl 2.1 working. I have all the issues fixed (including sound) so far except for 1. The imposters on the forest code is not rendering correctly. Ill start to post some of my fixes here soon for the mac port.

Screenshot of Dark Horizons: Mechanized Corps running on my mac in advanced lighting.

www.playmech.com/images/DHMac.png
-Tim
#14
02/24/2014 (7:08 am)
Excellent work Tim!

Lookin' fiiiiiine.

How's performance?
#15
02/24/2014 (8:31 am)
Performance is not very good. Gonna try some optimization next. on this macbook pro (lowend) from 2011. If i boot into windows and run the game on DX, I get 20 to 22 fps with advanced lighting. On the mac build I get 8fps.
#16
02/24/2014 (10:41 am)
I implemented triple buffering for the VBO and IBO and it seems like its not stalling as much (opengl profiler now shows a different GL call taking up most of the time). The one now that seems to be the problem is glBlitFramebuffer. It is taking up 75% of the time according to the profiler. So I am looking now into trying to optimize it to see if I can get the framerate up.
#17
02/24/2014 (2:15 pm)
Awesome work Tim, please do keep us up to date. For the osx 3.2 port, are you going to eventually MIT it if you ever get it done? Obviously finishing the 2.x port to be stable is priority though. Thanks so much!
#18
02/24/2014 (4:59 pm)
Yeah I will
#19
02/25/2014 (4:12 am)
First of fixes. Fix fonts and sound.

1. Download this zip - http://www.playmech.com/macfixes.zip

2. Replace sfx/openal/mac/LoadOAL.mac.cpp with the one included in the zip.

3. I am dynamically loading the openal from the system, but we still need headers, so in engine/lib/openal/macosx, open the framework bundled with torque and copy the headers and put them in engine/lib/openal/macosx/include/OpenAL. You should be able to remove the openal framework from that folder now. Next you need to add engine/lib/openal/macosx/include path to the headers search path in xcode.

4. copy osxFont.h/.cpp from the zip into platformMac and add them to your xcode project.

5. delete macCarbFont.h/.cpp from platformMac and remove them from your project.

6. Add this function to source/math/mMathFn.h
inline F32 mRound(const F32& value, const F32 epsilon = 0.5f)
{
    return value > 0.0f ? mFloor(value + epsilon) : mCeil(value - epsilon);
}

I believe that is all of the changes for fonts and sound. Let me know if someone tries it and it does not work.
#20
02/25/2014 (4:21 am)
I cant remember how different our guiObjectView is from stock, but here is my fix for it rendering in wrong location.

Add include at top of file: #include "gui/core/guiCanvas.h"

in void GuiObjectView::renderWorld(const RectI &updateRect)

replace
SceneRenderState state
   (
      gClientSceneGraph,
      SPT_Diffuse,
	  SceneCameraState( GFX->getViewport(), frust, MatrixF::Identity, GFX->getProjectionMatrix() ),
      renderPass,
      false
   );

with

RectI viewport = GFX->getViewport();
    
#ifdef TORQUE_OS_MAC
    Point2I screensize = getRoot()->getWindowSize();
    viewport.point.y = screensize.y - (viewport.point.y + viewport.extent.y);
#endif
    
    GFX->setViewport( viewport );
    
   SceneRenderState state
   (
      gClientSceneGraph,
      SPT_Diffuse,
	  SceneCameraState( viewport, frust, MatrixF::Identity, GFX->getProjectionMatrix() ),
      renderPass,
      false
   );
Page «Previous 1 2