Whats new?

I have not made any recent posts due to the fact that I started a new job as a .net web developer. So, that took me off track for a few weeks and I was not able to work on my own projects as much as I would like. I have alot of code to release within the next month though! I am currently working on a few areas of my engine and I will release the code for each part.

I am reworking my threading library for c++11 support, which means it will be completely cross-platform. Also, I completely re-wrote it because it was just messy. So, I rewrote it, kept all the same functionality, but the code is half the size and it should work much faster than the original implementation due to several major changes to the way the main loop of the threading library worked. It is very stream-lined now to the point where there is no overhead from the threading library at all. I am also writing a few concurrent_containers to go along with the code.

I am also working on a thin/lightweight Directx 10/11 framework that I will release as well. The framework isn’t anything fancy, but it is very effective at its job. The framework is for the most part a wrapper in the form of classes for the directx function calls and objects to help the user not have to retype the same code over. This also means that memory is automatically managed, so there is no need to remember to free resources. It’s very cool and I am proud of it.

The last part I have been working on is a simple –notepad like– text editor for MY_UI. My motivation for this is that I want to edit my shaders in my game engine, compile them and see the results instead of having to open them in an outside editor to make the changes. Now, this may or may not prove to be useful because if I am working in a game engine, odds are that I will also have visual studio open also to aid in the editing of my shaders. We shall see I guess. . .

Also, if you have not heard of a program called visual Assist X for visual studio, check it out! Seriously, this program is intellisense–on crack! All of these changes will be coming out slowly in the next month.

GUI

I just released version 1.17 of the GUI I am building. It has a complete 3d object toolset now for moving, rotating, and scaling 3d objects in either object space or world space. Check it out in the demo links to the right, or download the code and build it yourself!

Updates

In case anyone visiting this site is not aware, I post all my update info to the libraries in the forums section. I dont want to clutter up the main page more than I already do. So, check there frequently for what has happened in an update.

GUI code 1.11

I am releasing a big change to the way the UI system works. Previously, the gui was rebuilt each frame, which is what every other GUI does, and this took a decent amount of CPU time. In Graphics programming, there is a fancy term called, Temporal Coherence, which is just another way of saying, “things stay generally the same over time.” In any graphics application, the difference from frame to frame can be small. This is how most video compression works by using previous frames and only recording the difference between frames.

In the gui I wrote, I use the CPU to do all clipping and work. The GPU has no translation, rotation, or any other work to do except to sample a texture. This might seem backward to most, however, this gives several advantages: the number of draw calls is equal to the number of different textures being draw (I use a texture atlas which contains all the needed textures, so the draw call is always 1 for the entire GUI) ; and I can cache the whole last frame drawn. Since I can cache the entire last frame drawn, I only redraw it when a change occurs, giving me a HUGE speed increase. The pic below is 50 open re sizable windows –with tabs, buttons, and text in them– and you can see how fast the GUI is draws on my system.

 

 

 

 

 

 

 

 

One thing to note on using the GUI is to make sure and use the Set functions, don’t try to manually set anything otherwise the GUI wont know to redraw itself properly.

SpeedUI

Maybe I will change the name of MY_UI to SpeedUI since is so damned fast. I recently made some changes to the way drawing works and came out with some incredible results. For my tests, I open up 30 re sizable windows with some tabs, text and a button inside of each window. Normally, I was getting .55ms CPU time, and .35 ms GPU time for this. After optimizing the drawing, the GPU time dropped to about .3ms and the CPU time dropped to about .02ms ( A HUGE INCREASE!). Basically, this means the UI will be non existent in your application, unlike other UI’s where you are seeing a runtime of 1-2ms for GPU and 3-5 ms for CPU time. I will release the source code later today . . .

UI improvments

Added more controls and functionality. I also removed the DrawImmediate function as it is not needed. I changed to two different draw calls with all the controls: one with clipping, one without. This is to squeeze more speed when the control is known not to exceed the boundary of its control. Buttons, Text, checkboxes, sliders, are all examples of controls that will not use clipping when being drawn unless a parent, like a window, or scroll bar control draws them, in which case, they will be drawn with clipping on.

Check the right hand Library menu for the download.

UI release

The source code for the User Interface can be downloaded here. I am working on adding new controls and features. I will gladly incorporate new controls and features as long as they do not hinder the performance of the Simplicity of the Library (you can send requests by e-mail smasherprog AT gmail.com, or post on the message boards. Currently, there is a directx 10 example and there is no documentation except the examples in the code. However, the examples are pretty clear and easy to understand.

*EDIT* There have been quite a few people downloaded the UI code before I made a small change. So, if you are reading this, make sure to re download the latest version.

 

UI code release tonight

I will release the source code to the User Interface that I have been developing tonight. Right after I finish creating a color picker, I will make another post with the source. Until then, here is a picture of the work in progress . . ..

UI progress

I am very close to releasing the source code — it will be within the next few days now! I am releasing another update for the new controls added. The demo isn’t pretty yet because I am currently implementing functionality and focusing less on the skin of the UI. The skin is by far the easiest to change, but also an area that I could spend alot of time in to make it look exactly how I want. The demo is VERY fast and I am really pleased with the fact that that entire UI can be drawn in a single draw call regardless of the number of controls, or types of controls.

All of the controls are clipped and the UV’s are changed correctly. The clipping is done exclusively on the CPU and for this specific purpose –a User Interface– the cpu is able to handle the job without any problems. In fact, the difference in speed when I comment out the code for the cpu clipping is about a .05 ms difference than with the code turned on (this is with 40 windows being drawn). If I were to let the GPU preform the clipping, performance would drop significantly due to the extra draw calls issued.

Another feature is the fact that the controls like a value slider can be linked –or bound– to a number value, like a float. When the slider is moved, the float will be updated and if the float is changed by another part of your program, the slider will also reflect that. This is the same for all controls where it makes sense to link to the underlying objects. This idea was taken from when I was using GWEN, I ended up writing extra code to handle the getting and setting of the values of the sliders. My goal was to make the UI as helpful as possible, not the opposite.

Check in the next few days for the source code. Until then, here are the demos.  download the 64 bit  and   download the 32 bit .

UI release

I am releasing an example of the user Interface that I am working on, the 32 bit example can be download here, and the 64 bit example can be downloaded here. I will release the source code within the week; I still have some cleaning up to do with it. The example requires directx 10, so you must have Vista or higher to run it. Everything is drawn in a single call except for the button examples where I use an external texture for a button. There is still much room for improvement in the drawing logic to squeeze even more speed out of it. You can also use Nvidia PerfHud with the examples if you want to get a closer look. As you can see from the screenshot below, it takes .166 ms GPU time and .135 MS cpu time to render 40 open windows.

 

 

 

 

 

 

 

My goal with this UI is speed and simplicity, so I will accept any suggestions as long as they are inline with those goals.