|
|
Unity 2.5 is finally released. In summary:

Here’s what’s new. Here’s the download page.
My 11th Unity release since I joined 3+ years ago. This is quite a crazy release that involved almost complete editor tools rewrite and lots of other juggling. Was not exactly a walk in the park, but it’s done now. Meet me at GDC in San Francisco next week and I’ll tell you the war stories (Unity booth is 5110 NH).
Here’s the obligatory source code commits graph:

18 people involved in source code, 5315 commits, 18501 file changes. Of course, svn commits do not mean anything… I’m just fascinated by graphs and numbers.
Posted on 2009-03-19 15:13 in conferences, unity, work | 3 Comments »
Ok, I don’t exactly like Windows Vista. But I just spent 6 months using Vista as my primary OS at work… because everyone else was using XP, and someone had to make sure everything works on Vista as well. So it was me.
In summary, Vista is not that bad.
Once you get used to changes in Explorer, different skin and so on – it’s actually usable. I think they have made some real improvements in the underlying technology, too bad they managed to “compensate” for all of that by inconsistencies and lack of polish in user interface.
At this point it’s minor quirks in UI that annoy me, but apart from that, Vista is okay. Look:

Who implemented blending of icon overlays and do they still have a job? No sir, that shield icon is not properly blended here!

Who thought it’s a good idea to make the Burn icon bright red? In 6 months, I never used it. Why is it the brightest thing in the whole Explorer window?

Try going one folder up without resorting to this drop down menu. Utilities is the current folder here. And no, there’s no keyboard shortcut for “go up” either (there was in XP, which was perfect).

And of course, the awesome shutdown menu. The two buttons – never used them. What I always use is “Shut Down” from the menu. And let’s not even talk about all the choices in the menu (no, more choices is not always better).
So yeah. It’s not stellar, it has tons of small annoyances (and some large ones – try developing web plugins with UAC on…), but it’s usable. I might have gotten used to it by now, actually.
Posted on 2009-03-18 14:16 in random, rant, work | 6 Comments »
It’s funny how one’s view on things change over time.
Back in 2002, I wrote something that would be roughly translated like “C++ amazes me more and more”. In a positive sense! And I was talking about what is Boost.Spirit now.
A reply on local game development forums I wrote today (again, rough translation): “C++ is very hard and quite a horrible language, maybe you should not use it unless there are no alternatives”.
That’s quite a change in attitude we have here!
I feel like much of C++ horrors are a consequence of “it just somehow happened” (the whole template metaprogramming thing) or as a backwards compatibility with C requirement. Or maybe not, but I do agree with what ryg says here. Let’s play the internet memes:

Posted on 2009-03-01 19:23 in code, rant | 4 Comments »
So LTGameJam 2009 is over. I’ve been there as part organizer, part participant, so my views are both biased and incomplete (being an organizer means you have to run around a bit, instead of just focusing on making the game).
The theme for the games was “as long as we have each other, we will never run out of problems”. Additionally, games had to be short (5 minutes of play or less), and somehow incorporate one of “affectionate”, “patriotic” or “missing” words.
I worked on a Missing Peace game. It’s nothing really fancy, does not quite follow the idea and incorporates the above mentioned words in a cheap way (“just stick it into a title! haha!”). It was probably the most polished game from all games made there though (for some definition of polish)… too bad it’s not actually fun to play :)
Oh well. I just did not have any interesting ideas, and wasn’t particularly inspired, so there is the result. Probably burnout of trying to finish Unity 2.5 at work had it’s toll as well.
Overall, the good parts about this game jam:
- It was fun (hey, that’s the whole idea)
- Some very positive progress, compared to LTGameJams 2002/2003: more people (20-25, up from 10-15), much better proportion of artists (about 30%, up from almost zero), more people who don’t know each other, more games made by folks outside of nesnausk! group :)
- Some of the ideas that were brainstormed have interesting bits.
- Did I mention it was fun?
On the downside, I get the feeling that the games made this time were not crazy enough. GameJams are meant to generate totally whacky, crazy and amazing ideas; however this time most of the games were known game mechanics, pretty safe idea and so on. Have to improve on that the next time.
So that’s about it!
Posted on 2009-02-20 21:18 in games | No Comments »
Posted on 2009-01-30 11:59 in games | No Comments »
Ok, I’m somewhat late to jump onto the latest fads bandwagon, but here it goes – I added a Twitter widget here on the sidebar. I blame Steve Streeting for pushing me over the edge!
Me on Twitter.
Posted on 2009-01-26 16:25 in random | 1 Comment »
Sometime soon I’ll have to implement fixed function lighting pipeline in vertex shaders. Why? Because mixing fixed function and vertex shaders in multiple passes does not guarantee identical transformation results, thus requiring depth bias or projection matrix tweaks, which leads to various artifacts that annoy people to hell.
I don’t really know why that happens, because it seems that most modern cards don’t have fixed function units, so internally they are running shaders anyway. DX9 runtime on Vista’s WDDM also seems to be only handling shaders to the driver internally. Still, for some reason somewhere the precision does not match…
How such a task should be approached?
My requirements are:
- Should handle any possible state combination in D3D fixed function T&L.
- D3D 9.0c, using vertex shader 2.0 is ok. For now I don’t care about OpenGL.
- No HLSL at runtime. I don’t want to add a megabyte or more to Unity web player just for HLSL. DX9 shader assembly is ok, because we already have the assembler code.
- Should work as fast (or close to) as the regular fixed function pipeline.
I looked at ATI’s FixedFuncShader sample. It’s an ubershader approach; one large (230 instructions or so) shader with static VS2.0 branching. It had some obvious places to optimize, I could get it down to 190 or so instructions, kill some rcp‘s and reduce the amount of constant storage by 2x.
Still, it did not handle some things in the D3D T&L or had some issues:
- It assumes one input UV, one output UV and no texture matrices. This place in T&L gets quite convoluted – any input UVs or a texgen mode can be transformed by matrices of various sizes, and routed into any output UVs.
- It was not using full T&L lighting model. No biggie here.
- I haven’t checked with NVShaderPerf or AMD ShaderAnalyzer yet, but last time I checked the static branch instruction was taking two clocks on some NV architecture. So ubershader approach does not come for free.
Another thing I’m considering, is to combine final shader(s) from assembly fragments, with some simple register allocation.
In T&L shader code, there’s only limited set of could-be-redundant computations, mostly computing world space position, camera space normal, view vector and so on (those could be used lighting, texgen or fog). Those computations can be explicitly put into separate fragments, and later fragments could just use their result.
What is left then is some register allocation. A shader assembly fragment could want some temporary registers for internal use (this is simple, just give it a bunch of unused registers), also want some registers as input (from previous fragments), and save some output in registers.
Again, I haven’t checked with shader performance tools, but I think, guess and hope that the drivers do additional register allocation, liveness analysis etc. when converting D3D shader bytecode into hardware format. This would mean that I can be quite sloppy with it, i.e. don’t have to implement some super smart allocation scheme.
I wrote some experimental code for the shader assembly combiner and so far it looks like a reasonable approach (and not too hard either).
Does that make sense? Or did everyone solve those problems eons ago already?
Edit: half a year later, I wrote a technical report on how I implemented all this: http://aras-p.info/texts/VertexShaderTnL.html
Posted on 2009-01-22 22:32 in code, d3d, gpu, rendering, work | 9 Comments »
Somewhat amusing quote from gamedeff.com:
Дешевая популярность в тяжелые времена не мешает, поэтому в блог срать надо почаще (всем, кстати, рекомендую).
Preemptive note: Google Translate does not quite cope with it.
Posted on 2009-01-05 14:12 in random | 6 Comments »

No, I don’t have any particular point to make. But I did not even get the t-shirt…
Posted on 2008-12-30 9:48 in opengl, random | 2 Comments »
This was the function that I added:
void GUIView::MakeVistaDWMHappyDance()
{
// Looks like Vista has some bug in DWM. Whenever we maximize or dock
// a view, we must do something magic, otherwise
// white stuff appears in place of the view.
// See http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=4208117&SiteID=1
bool earlierThanVista = systeminfo::GetOperatingSystemNumeric() < 600;
if( earlierThanVista )
return;
// What seems to work is drawing one pixel via GDI.
// We draw it at (1,1) with usual background color.
int grayColor = 0.61f * 255.0f;
PAINTSTRUCT ps;
BeginPaint(m_View, &ps);
SetPixel(ps.hdc, 1, 1, RGB(grayColor,grayColor,grayColor));
EndPaint(m_View, &ps);
}
I know. Reading from screen when Aero is on is slow, bad and wrong. But then, what do you do? It’s better than users staring an all-white window just because Vista decided to draw it white, no matter what you think you’re drawing into it.
…still, MakeVistaDWMHappyDance is not nearly as cool as
internal interface ICanHazCustomMenu { … }
that Nicholas added a while ago.
Posted on 2008-12-11 18:16 in code, random, rant, work | 2 Comments »
|