
OOGL
Posted Sunday, 7 September, 2008 - 04:37 by Kamujin inOOGL - Object Oriented OpenGL - Sourceforge
This project is a set of utilities that can be used with the OpenTK libraries to add object oriented wrappers to commonly used functionality.
It is done completely in C# and can be run on Windows, Linux, and OS X.
Currently implimented features are as follows.
* MilkShape file loader (including animations)
* MilkShape single animation track to multiple animation track splitting.
* Basic skeletal animation controller.
* Shader class (supports shader based skeletal animation)
* FrameBuffer class (used by GUI to render child windows to textures for higher framerates)
* Texture class. (simple OO wrapper)
* System.Windows.Forms like GUI framework.
The GUI framework provides basic implimentation of the follow controls.
* Button
* CheckBox
* ComboBox
* HScrollBar
* Label
* ListBox
* Picture
* ProgressBar
* TextBox
* VScrollBar


Comments
Re: OOGL
Hello,
I would like to try this out. Got the code.
When I run it, a file referenced in Game.cs is missing:
Track[] tracks = Track.Load(ResourceLocator.GetFullPath("/Models/Beta_Kamujin/Beta_Kamujin.tracks"));
Please post the content of the .tracks file.
Thanks
Re: OOGL
Thanks for pointing that out. I have added it to the SVN. Please update your working copy and it should be fixed.
Currently F3 and F4 play the 2 tracks listed in the file.
Re: OOGL
Good idea to separate this from OpenTK itself, here's something you might find useful. It's an implementation of the Tipsy vertex cache optimization described by Sander et al. The implementation is not perfect, it assumes that you have only 1 mesh in your model, as in exactly 1 VBO and 1 IBO. It will also work best if your modeling technique produces alot of triangle fans, since the algorithm takes the center of a fan and issues all triangles connected with it.
The algorithm expects a boolean flag HasBeenProcessed for each triangle. A timestamp and an Array of all triangles referencing it, in each vertex. The structs look like this:
The actual function that does the optimization:
This code was written a while ago for XNA, ported to Tao and then to OpenTK, and obviously has some flaws that could be improved e.g. ArrayList{Triangle} and passing more by ref. Feel free to use/alter it in any way you like, but keep in mind that the approach was taken from http://www.cs.princeton.edu/gfx/pubs/Sander_2007_%3ETR/tipsy.pdf and you will most likely not be able to apply licenses/fees to it without checking with the authors first.
Hope this helps.
Re: OOGL
Thanks, I will certainly consider this method when I get to the optimization phase.
Re: OOGL
Does OOGL use the latest release (0.9.1) or OpenTK?
I can't build the source code, as there's no Font.MeasureText method in the OpenTK or OpenTK.Utilities dlls.
I actually modified the code to create a RectangleF using the MeasureString method, but it seemed I was missing a GameWindow.RunSumple method as well.
I'd like to build this, as I'm very interesed in the MS3D loader, and seeing how it works.
Re: OOGL
Oh, well that's just plain clumsy of me. I'll square this away asap.
I am using the OpenTK from the SVN, I'll make sure to post the revision in the README from now on.
Until then, you can safely replace the GameWindow.RunSimple with GameWindow.Run method.
For what its worth, my code for RunSimple can be found here http://www.opentk.com/node/488.
It's not required though.
Can you give me some feedback on how it works for you?
Re: OOGL
Yeah I had a go at replacing the SimpleRun(50) call with Run(50) after posting, but now I'm getting a shader compiling error in the AbstractShader class when loading skeletalAnimation.vs:
Shader error: Vertex shader failed to compile with the following errors:
ERROR: 0:15: ')' : syntax error parse error
ERROR: 1 compilation errors. No code generated.
Shaders are still a little mysterious to me, so I don't have much hope of ironing that one out. :-)
Once I've got it running, I'll have a play around with it, but it looks like I could really use some of the stuff you've done here in my current project (which is perhaps still a little young to advertise on this board).
Re: OOGL
That looks like its complaining about this line.
int bone = (int) boneAttribute;
I assume its complaining about casting the float to an int.
What card are you using? Maybe I am leaning on something nVidia specific in my shader.
Re: OOGL
It's a Radeon X1950.
I changed the typecasting syntax to:
The compiler seems to accept this, as I now get an error message for line 17:
Shader error: Vertex shader failed to compile with the following errors:
ERROR: 0:17: '' : Matrix construction from matrix is not allowed in GLSL1.10
ERROR: compilation errors. No code generated.
I've no idea what version of GLSL I'm lacking, but I updated my graphic drivers after getting this and it still won't compile. It's tempting to fiddle around and find another way of implementing the same line in a way which the compiler will accept, but there's clearly an underlying compatibility issue at stake here.
Re: OOGL
Yeah, I wrote those shaders to GLSL 1.2.
Can you try?