Hello everyone!

Today I want to talk about the NinevehGL. Talk more about the features and about what it can offer to us. NinevehGL is almost done, I want to be as fast as possible, but I don't want to launch it without everything seems great: the documentation, the tutorials, the official website and obviously, the NinevehGL itself.

Soon I'll start posting videos and many divulgations about it, but right now in this article let's see some images taken directly from the NinevehGL running.

Let's start!

At a glance

The NinevehGL is a 3D engine fully made with the most pure Objective-C, right on top of Cocoa Touch Framework. So at the first moment, the NinevehGL is a 3D engine only for iOS. I intend to port NinevehGL to MacOSX (desktops with Obj-C) and also for ActionScript 3.0, using the new great API code named Molehill. ActionScript is my old programming language, today I don't hold much lover for it, but I know that there are many people that still loving Flash. Another important step is to port NinevehGL to JavaScript to work with WebGL. But at the beginning, NinevehGL will work only with OpenGL ES 2.x for iOS.

Now the most important question: "Why NinevehGL instead of PowerVR, Oolong, SIO2, Torque, Ogre, UDK, Unity, Wolfenstein, Shiva, Galaxy, or any other? Why should I choose NinevehGL instead any other 3D engine?".

I always tried to convince everyone to buy what I was selling, trying to convince everybody from my point of view. But not this time, I don't want to sell anything, I don't want to convince you. If you are using some other engine and glad with that, just continue with it, you don't have to change. Also, if you are a great OpenGL programmer and have your very own model and structure, continue with it, don't change anything. Because, again, I don't want to convince anyone at this time. Just as OpenGL, I'll focus on the most important thing to me: development!

I took everything that I've seen of worst in other engines and I've tried to make it better in NinevehGL. I took all my frustations with the actual engines, all my luggage as developer, all my knowledge about 3D world and put all of them in the NinevehGL. So, if you are like me and you have some insatisfaction with the other engines, for you, NinevehGL could really nice for you! I know I'm telling this every time, but I love this concept:"Keep it simple!" This is the NinevehGL's main principle, everything was made to be simple. There are no commands that need more than one single line of code. If you want to make one thing, you need one line, nothing else.

Now I'll describe in details the most important features of NinevehGL. Remember, I don't want to convince you of anything. I'm sure you are an advanced programmer and can form your own opinion about what's coming next. If you like it, great! If don't, it's great as well! Just tell me why and I'll try to make better.

Here is a features' list.

NinevehGL Features
Imports OBJ file.
Imports DAE (COLLADA) file.
Works with NGL binary file (exclusive of NinevehGL).
Cache 3D files to optimize the loading in next times (around 95% less loading time).
Works with OpenGL ES 2.x (programmable pipeline).
Full integrations with custom Shaders.
Supports 3D and 2D application.
Programming interface is 100% User Friendly and totally independent of OpenGL version.
Absolutely oriented to performance and minimum size (NinevehGL is 10% - 60% faster than any other engine).
Full support for PVRTC (even to without header generated by MacOS).
Automatically calculates normals and tangent space to work with lights and bump maps.

Importing 3D files

This is the most problematic topic to me considering other engines. As OpenGL doesn't import 3D files directly, you must use an engine that imports a file good for you or use one of the files accepted by that engine, like POD to PowerVR engine.

This is the first problem that NinevehGL works to solve, it can import the two most popular 3D file formats: COLLADA and WaveFront OBJ. You know what a mess the 3D imports with 3D softwares are. Each software has its own file format and implements its importing routines at its own way. So it's not hard to export an OBJ from 3DS Max and when you try to import in Maya, BOOM, error! To tell the truth, the incompatibility with the files when exporting from a 3D software to another is common.

The NinevehGL has a full importing routine. What that means? If your OBJ file has informations about the specular, the bump map, the reflection map or anything supported by OBJ file, NinevehGL will import and parse everything for you with no losses. The same is true for COLLADA files.
NinevehGL supports OBJ and DAE files.

Caching 3D files

This is the greatest feature in my opinion. NinevehGL works with a third kind of file, the NGL binary file. It's a binary file containing a full 3D model with all informations necessary to NinevehGL and also OpenGL. This file is loaded through streaming, so it's extremely fast. There are no 3D softwares that can export it, it's exclusive from NinevehGL. So how you can use it? There are two ways: First, you can convert your OBJ or COLLADA file on-line! Yes, you read it right, on-line convertion! No plugins, no installations, no complex things, you can generate NGL file on-line! Just access the NinevehGL website, choose the files on your machine and hit the button!

The other way, is the most fascinating one. NGL file is generated automatically by NinevehGL at the first time you load a new file from OBJ or COLLADA. This file will be stored locally in the device under the folder /Library/NinevehGL. What is great here, is that this folder is fully backed up by iTunes. So imagine this:

  1. You make an APP, which loads OBJ and COLLADA files.
  2. An user make the download of your APP from the APP Store.
  3. The user runs your APP at the first time, the NinevehGL loads around 20 3D file in 12 secs, let's suppose.
  4. The next times that this user runs your APP, the loading time will be 0.12 secs, for example.

What happened???
It's great! At the second run, the NinevehGL automatically identified that those 20 3D files were already parsed before, so it will use the cached NGL binary files instead the original ones!

But this feature doesn't stop here! Remember, NinevehGL was made to make everything be simple! So, let's suppose your application loads the 3D files through the internet connection instead loading it locally. No problems! NinevehGL compares the modification date of the files and choose the most recent. Imagine this:

  1. Your APP loads the 3D files from the internet, because you want to make updates without submeting a new APP to APP Store.
  2. An User downloads your APP. First run, 20 3D files in 12 secs.
  3. In the next times, NinevehGL will use NGL binary files, loading them in 0.12 secs.
  4. You make an update and upload some new 3D files.
  5. All the users that have your APP will receive the update, with 10 new 3D files replacing the old ones, so NinevehGL will parse the new downloaded files in 10 secs and it'll generate new NGL binary files.
  6. In the next runs of your application, NinevehGL will use the new generated NGL files and the loads will happen in 0.08 secs.

I cry of happiness every time I explain this routine. It's amazing, wonderful, outstanding, great, it's... it's... "magical"! Well, this is just my opinion about it. But I'm sure you can imagine how great would be to the final user: "At the first run, a loading of few seconds, next times, no loading? Where is the loading of this APP?". The loading happens in a snap.

NinevehGL automatically saves NGL binary files locally.

The last thing I want to say about this feature is the optimization. Again, the NinevehGL was made to be EXTREMELY FAST! So, if you load a NGL binary file directly, it will not create a cache file to it, because it is already optimized, it'll just create cache from non optimized files (OBJ and COLLADA). Now you know how to convert your 3D models to NGL binary file, you can convert them on-line, at the official NinevehGL website, or can just run your application in the simulator and take the binary file generated at the first run and find the file at /Library/NinevehGL!

In order to avoid confusion, it's important to say that NinevehGL will not be responsible to manage the internet connection for the file downloading. So you can't inform an URL to load a 3D file. What the NinevehGL will make is manage the files locally.

Custom Shaders

The NinevehGL was made to work with OpenGL programmable pipeline. So obviously it'll create its own shaders, based on the materials (loaded from 3D files or materials created directly in the code). Well, the most fun part of the programmable pipeline is exactly the shaders, so will NinevehGL block us of using our own shaders? Of course NOT! NinevehGL is absolutely user friendly, it's flexible!

The other engines working with programmable pipeline are used to give to us only two choices. Working only with your very own shaders or working only with their shaders! Well, this is not a choice, but rather it's a dilema! But, the NinevehGL offers another way, a third way: "all of above"! Yes, your read it right, NinevehGL has an API Shader capable to integrate two or more shaders into only one program. WOW, what that means?

That means you can create your own shaders, just as you are used to, implementing your own lights effects, materials or anything else you want. Then you pass your shaders to the NinevehGL and it'll integrate your custom shaders with the shaders generated by the NinevehGL materials. No conflicts, everything works fine together!

This works for Vertex Shader and/or Fragment Shader. An important thing to say is that there are no special constraints, you can even use a shader that you already have, with many variables inside, many functions and the main function. The NinevehGL Shader API will interpretate the code inside the shaders and will fuse all together.

NinevehGL can merge your custom shader with its own shaders.

Calculating Normals and Tangent Space

This is the robust side of NinevehGL. It's very fast even in the hard processing scopes, like calculations of normals and tangent space for imported models. Normals and tangent space are very important to generate real time lights, reflections, bump effects and many other things. NinevehGL automatically calculates the normals and generates the tangent space for each mesh that needs it.

NinevehGL automatically generates normals and tangent space, if needed.

NinevehGL can automatically generate some effects, like specular lights, ambient light, emissive light, bump map, reflections and other ones specified by NinevehGL materials. NinevehGL doesn't impose any limitations to you, it just works around the limits of the OpenGL. So, in the iOS, for example, you can work with very high mesh models. Obviously this is not a common situation, but sometimes it could be better to see high mesh models on the screen. Even to these high meshes, NinevehGL will continue to produce the normals, tangent space, specular lights, bump maps, reflections and everything else you need.

NinevehGL also works with very high mesh models.

Now I want to show you some other features that are also great, but I'll not talk in deep here.

Optimizing Textures

Just to keep it fresh on our minds, NinevehGL was made to operate in the maximum performance. So even the loaded textures will be optimized. If you choose to work with an opaque OpenGL Layer (the default), the textures could be optimized to the format RGB565, which is the best choice without alpha channel. If you choose to work with transparent layer, the textures could be optimized to the format RGBA444_4.

The optimization process will happens automatically and you don't need to worry about it. Even to PVRTC compressed texture format, these optimization could happen, if needed to. The textures, as any other external file, can be loaded from any path locally and the NinevehGL is ready to manage the local paths to you.

Plus, just as the 3D files, textures has a kind of "cache", that means if you load an image more than one time, the NinevehGL will manage the load locally and will not spend more memory with the same cached image. This is a very important optimization, mostly in cases when a 3D file use the same image for many things, like to the ambient, diffuse and specular maps.

Many other things

There are in NinevehGL many other important features, but I'll just point it because other engines also have these features, so it's not that exclusive. Like:

  • Cameras with projections (perspective and orthographic).
  • Customizations of OpenGL behaviors, like the render buffers.
  • Simple API to make 3D transformations (like obj.rotateX += 1.0).
  • Always use OpenGL optimization features, as Buffer Objects, array of structures, optimized texture formats, etc.

One great thing to talk a little bit more is about the auto-corrections. It's very common that the 3D modelers create their models with different scales, I mean, a 3D file which contains a spoon could has the range of vertices going through -1000.0 to 1000.0 and other file which contains a house with the range of -0.5 to 0.7, for example. By placing both files in a 3D softwares you probably will see a house at the side of the empire state in format of a spoon.

For a 3D softwares this is not a big deal, because there are an infinity work space and you can simply reorganize your objects visually. But for a programming language, this is a problem and gets even bigger if the object is so big or so far that you can't even see it on the screen.

The NinevehGL auto-correction can solve this problem for you, because it can normalize the vertices positions to fit on the screen (or in a specific range you want). By doing so you can control the size of your models without having to export it again from the 3D software. So in the case of the house and the spoon you could set the auto-correction to fit the house at the range -10.0 to 10.0 and the spoon to -0.1 and 0.1, simple as that (one line of code).

Outside the Scope

What you should not expect from NinevehGL? Here is a list:

  • The NinevehGL is not a game engine, it's a 3D engine.
  • So you shouldn't expect physics controllers or sound controllers. You should construct this kind of stuff by yourself.
  • No animation, YET! Animations is very important in the 3D world, but the first version of NinevehGL will not come with this feature. (Animations = Character Rigging + Bones)
  • No collisions, YET! There are two techniques to deal with collision, bounding box and bounding mesh. In this version, NinevehGL will not implement any of those.

Obviously any item in this list can change, because the NinevehGL is flexible. Consider the above list as an "out of scope" list only for the first version of the NinevehGL.


I'm sure you have now a solid opinion about NinevehGL, good or not, so let me know what you think, post a comment bellow, send me an email, tweet me... anything.

Again, I don't want to make promisses, but I really want to see this engine released soon. So I'm sure it will come in the first half of this year (2011). I'm just finishing some details now and organizing everything for the first release.

Thanks for reading,

And see you very soon!

NinevehGL will come in the first half of 2011.

© db-in 2017. All Rights Reserved.