Topic: Free Perspective, OpenGL and CastAR
MartenR Topic Opener |
Posted at: 2013-11-06, 07:49
@Tino Thanks for the clarification.
@adamant I do not get your point either. OpenGL ES is a subset of OpenGL and widelands should work fine with mobile hardware. The engine of widelands only uses OpenGL function, which are very basic and can be easily handled by OpenGL ES. It only means instead of supplying a vertex one by one using vertex buffers. The second thing is that quads are not supported. But converting them to triangle strip etc. is not a big deal, your driver will do it anyway for normal OpenGL. Not using opengl es will be bad for mobile devices, since the cpu is normally not as powerful as the gpu. Marten Top Quote |
MartenR Topic Opener |
Posted at: 2013-11-11, 07:32
Just an update, I got widelands compiled over the weekend for windows (especially recompiling boost was horror).. So I start next weekend with the actual coding. Top Quote |
fawi |
Posted at: 2013-11-22, 17:36
WTF!
Top Quote |
MartenR Topic Opener |
Posted at: 2013-11-23, 08:40
Well, I want to play an old style building game, where you can play multiplayer like an playing a cardboard game with your opponent just in front of you. Together with little workers walking over the table... Therefore I searched for an open source game, which I like and with an engine, which is capable to have this view added with not too much work. The software for the glasses will be just a bunch of low level apis and drivers. This is normally considered to be part of the os with respect to GPL.
This will not be a massive rewrite. I have just to move the projection code to 2D from the top of the drawing calls down to the interface calls to opengl. The different perspective is just a different matrix.
I think the developers here will be wise enough to inspect my changes and ask for changing it in a way, that it is easy to maintain. Also the changes will be very gentle and I am trying to stick to the coding spirit of widelands.
I am sorry, but your suggestions is a complete rewrite, orders of magnitude more than that what I am doing. Anyway last weekend I already converted the rendering of the objects to 3D coordinates. It is in the moment buggy (no objects visible, probably a sign error), but if everything works out I try to push it a branch into launchpad this weekend, so that the widelands devs can see what I am doing. Marten Edited: 2013-11-23, 08:45
Top Quote |
MartenR Topic Opener |
Posted at: 2013-11-23, 18:04
Ok, I have posted it now to launchpad: lp:~marten-r/widelands/feature-3d-rendering-open-gl-es-compat So far I introduced a 3D point and I have converted the object rendering so far to 3D coordinates. One thing I have stumbled across, if the coordinates in a point are negative, the blit function has a problem, caused by signed and unsigned mismatch of w and h of rect (unsigned) and point coordinates (signed). A simple typecast helped, I could drop some of the clipping stuff since opengl does it now. I am wondering, if you can also remove the manual clipping, in the 2D rendering if the unsigned signed mismatch is fixed or is it required with SDL? Anyway a rect with signed w and h would cause less trouble in the drawing routines. Should I change it? Point3D and draw3D is not the perfect way in the moment. I will probably change the interface in the future. Marten Top Quote |
SirVer |
Posted at: 2013-11-25, 05:25
@fawi: I agree with MartenR here - his suggestions is a lot of work, but yours is even more. Yours would require moving to true 3d models (for one example) which would be a lot more work. MartenR, if you propose your branch for merging, a diff will be generated. Also, I added you to the widelands-dev team. Please do not push to trunk, but instead push your changes to lp:~widelands-dev/widelands/feature-3d-rendering-open-gl-es-compat - it allows other devs to fix nits immediately and leave todos as code comments for you that are easy to grep for. Top Quote |
MartenR Topic Opener |
Posted at: 2013-11-25, 07:30
@SirVer I have pushed it to lp:~widelands-dev/widelands/feature-3d-rendering-open-gl-es-compat as you proposed. But I will not propose it for merging now, since the changed interfaces and coordinate systems are still a bit oscillating and the graphics output is slightly buggy. (The problem is to generate for the meantime a meaning full z-coordinate for animations. In the moment I am using the difference of image height and hotspot position for the z correction. But this causes some problems with the drawing order, anyway this is fixable...) I wait until this is stable. Anyway, my plan is after temporally fixing the glitches to introduce an abstract camera interface with cameras for isometric, perspective projection etc. . Where should I place this? In graphics folder or in wui? Marten Top Quote |
SirVer |
Posted at: 2013-11-26, 09:48
I think you can argue for both design choices. I personally feel that it should live in graphics/ instead of wui/, because in my mind the viewport rendering is part of the engine while the wui is just extensions to the user interface classes - that is not reflected in all design choices done so far though. Put it into graphics/ for now. Let me know when you feel that the code is ready for a first look. I'd rather not look over it when it is still changing a lot, because I'll do a lot of unnecessary reviewing then. Edited: 2013-11-26, 09:49
Top Quote |