Friday 2 January 2009

Uniforms and Attributes

Volatile-Engine's old way of doing uniforms was rather complicated. You stuck an annotation on the field that is a uniform, registered the class that the field belonged to and you were done; however the background stuff that made all this possible was rather hideous. Lots of reflection, lots of workarounds around Array stuff and in the end I quoted Sherwin Nulland: "Ahhh fuck it".

So what do to? Well, I stole MatthiasM's idea (with his permission). Get the list of uniforms from the shader after linking -> create an array of Uniforms and access the uniforms through getUniform(String);

This allows a few things to happen:

1) You can only set Uniforms to what are declared in the shader. No more exceptions saying that uniform isn't there at runtime...

2) Allows a context specific state to be stored in java to compare uniform values before uploading to GL. Each Uniform has a Handle which has a reference to the cache.

3) It now plays rather nicely with Surface and its shizzlness. Hurrah for easy multi-target rendering!

Happy '09 by the way.

Saturday 16 February 2008

Scripting and how your foot could be in danger!

I was talking to MatthiasM last night regarding scripting and why, as game engine creators, we feel the need to restrict what the scriptee can do.

There are alot of arguments for and against scripting, the main one being is scope in my opinion. How much scope should you give the scriptee ?

On one hand, you definitely do not want your game engine crashing or even blue screening your computer (which OpenGL calls could do!), but on the other, you do not want to restrict the user's imagination in what they can and can't do.

I for one hand am going with the "give enough power to the scriptee so they can shoot their own foot off". Yes, they can access File. Yes, they can access GL_* calls, but so what? who cares? If they do and their game crashes, whos to blame?

Let me know your opinion if you have one.

Friday 15 February 2008

The Bog

I haven't been well in recent times and it seems that an increasing amount of my time is being spent on the throne...and it finally dawned on me.

Why am I making an XML based storage thing for Volatile-Engine?

I seemed to have lost track through the dark woods that is XML, but its clear now: having an index.xml file inside a .zip that loads the files surrounding the index.xml file...much like a website!

Afterall, whats a basic website? Just content and how to display it. Isn't that exactly what I need?

Just a question of how logic is going to fit into this equation, ruby or JSP anyone? Hmm?

Friday 1 February 2008

So Close!

Honestly, all I need to do now is 3 things:

  • Get VBOs implemented again. Had to take them out temporarily for design purposes.
  • Get MatthiasM's obj loader inserted somewhere with a nice design around it.
  • Get the DDS loader working again.
After that, hopefully Volatile-Engine v0.1 will be born!

Wednesday 30 January 2008

View points

It seems like everyone these days wants to force their viewpoint onto other people. I started noticing this about a year ago, maybe I was just naive or something, and it didn't bother me, I thought people were just expressing their point of view.

But the other day, I had this conversation about abortion with one of my peers at the university and they seemed adamant that they want to go to a country where abortion is illegal and force the currently acceptable British society values on this country. What is wrong with that I hear you say?

Well, a lot of people seem to forget history; It wasn't until a few decades ago that women were allowed to vote in this country (the UK) and be counted as equals. And now all of a sudden, this society is a beacon for equality and morality? I'm not saying that the current accepted views aren't morally correct by the current standards, but when has it become tradition for people to force their 30+ year old tradition on people who's culture has survived thousands of years?

Wednesday 2 January 2008

Happy New Year!

Yup, its 2008..boo hoo, like the first of january was ever going to be full of rainbows and unicorns. It was a freezing cold day and I stayed in and studied...Not really that bothered.

On a slightly cheery note, volatile-engine is in SVN at googlecode: http://code.google.com/p/volatileengine. So thats one step closer to an actual release.

This SVN entry is actually the 6th fork of VE...VE 2 is the most full featured, but the 6th is the one im happy about. Ive been making the comparison between VE and j2d recently and I think that stands. You create a Surface (be that a texture, or a window), get its rendering context, and call draw, clear, project, whatever on it. The rendering context will render onto that surface. And there is a CompositeSurface for MRT...

I've also had a Obj loader contributed to VE from MatthiasM. Its not in SVN yet, have to sort a few things out with VBOs and textures before that goes in. But nevertheless, thanks.

Also, had an idea regarding transformations from Riven that has helped with JNI overhead as well as some performance enhancements. It has to do with the way the engine handles transforms. Previously, each SceneObject had its own localTransform as well as a cumulative worldTransform. Now, a SceneObject returns the localTransform and the worldTransform of its parent. Only a TransformSceneNode has the ability to actually move anything.

This is useful in two ways:
  1. Saves on glMatrixMode, glPushMatrix,  glLoadMatrix and glPopMatrix calls if the transform is the same.
  2. If a model has multiple parts to it, you can shove them in a single SceneNode and move that around. Other engines decided to have multiple Geometry(s) inside the equivilant of SceneMesh, but that has alot of hastle when it comes to passes.
So thanks to him for that contribution. All in all, I am very happy about the architecture of VE now. Hope this enthusiasm for coding stays for a while :)

Last but not least, Im still using alot of Gareth Jenkin-Jones' code (AKA ChaosDeathFish) especially the Array stuff. So thanks a bunch for that gareth.

Tuesday 13 November 2007

New Stuff

Its been a while, but alot has happened in that while. Yours truly has become a second year medical student in the top 10% of the year...w00p. Theres been little time to code, but things are progressing seriously slowly.

As a side note, went on placement with a friend of mine who has graduated and became a doc, it was quite nice to see actual patients that are living breathing things and not just some statistic in some book...

Side note two is that my music taste has somewhat slightly changed from the rock and roll to encompass alot of rock and roll, some acoustic guitar as well as funk. What will we ever do without james brown?!

Oh yeah, DOWN WITH FACEBOOK!

Sunday 3 June 2007

We love them really...

Last year I upgraded Girlfriend 1.0 to Wife 1.0 and noticed that the new program began unexpected child processing that took up a lot of space and valuable resources. No mention of this phenomenon was included in the product brochure. In addition, Wife 1.0 installs itself into all other programs and launches during system initialization where it monitors all other system activity. Applications such as Pokernight 10.3 and Beerbash 2.5 no longer run, crashing the system whenever selected. I cannot seem to purge Wife 1.0 from my system. I am thinking about going back to Girlfriend 1.0 but un-install does not work on this program. Can you help me?


Dear Sir,
This is a very common problem men complain about but is mostly due to a primary misconception. Many people upgrade from Girlfriend 1.0 to Wife 1.0 with the idea that Wife 1.0 is merely a "UTILITIES & ENTERTAINMENT" program. Wife 1.0 is an OPERATING SYSTEM and designed by its creator to run everything. It is impossible to un-install, delete, or purge the program from the system once installed. You can not go back to Girlfriend 1.0 because Wife 1.0 is not designed to do this. Some have tried to install Girlfriend 2.0 or Wife 2.0 but end up with more problems than original system. Look in your manual under Warnings - Alimony / child Support. I recommend you keep Wife 1.0 and just deal with the situation. Having Wife 1.0 installed myself, I might also suggest you read the entire section regarding General Protection Faults (GPFs). You must assume all responsibility for faults and problems that might occur. The best course of action will be to push apologize button then reset button as soon as lock-up occurs. System will run smooth as long as you take the blame forall GPFs. Wife 1.0 is a great program but is very high maintenance.