First of all I want to get something off my chest - STOP STEALING MY NICKNAME! When I first started using the ‘Ilfirin’ nickname a little over 10 years ago you could put it into any search engine and always, without exception, receive 0 results. It remained like this (with the exception of various papers, articles and posts I wrote around the internet) for a good 3-5 years, but now if you google ‘ilfirin’ you’ll receive somewhere around 85,000 results (maybe 5,000 of which are me). What the hell? It’s not exactly a ‘normal’ nickname. I’m not even especially fond of it anymore but, damnit, I had it first!
Anyway..
As far as my graphics R&D work goes, not too much has changed since my last post (where I mentioned nothing would be changing for quite a while!). I have, at least, resumed my R&D work on real-time BRDF rendering and I’m still making a good deal of progress. Alas, I only have 2-4 hours a week to dedicate to this and that’s generally not even enough to get the math right for one section of what I’m working on. Plus, something “super secret” has popped up regarding everything I’ve been working on (the highlight of which is the BRDF stuff, although there’s about a dozen different projects I’ve been working on included in it) that’ll prohibit me from talking about any of this in too much detail until said “super secret” project is commercially released.
[Insert Transitional Phrase]
Silverlight!
So I’ve been steady at work at my new job writing their entire software suite from the ground up for next generation platforms (as the original code base was written close to a decade ago in VB6) one of which we’ve decided to write in Silverlight, despite it’s extremely infant state. We were originally doing all the web application parts with ASP.NET and AJAX and have some stuff that looks and runs absolutely amazing for those platforms (relative to everything else I’ve seen developed on those platforms).. but it’s still fucking horrible. If you want to write applications that have completely random, unexplicable bugs and have functions that *should* only be called once suddenly called 20-30 times for no reason (not even counting postbacks and callbacks), half of the time losing the data to that call in between the call and the actual procedure’s code.. write for ASP.NET and AJAX. Likewise if you want some interfaces that are so fucking close to being awesome but that tiny little bit it falls short, is just enough to make it absolutely horrible. There are tons of things asp and ajax are good for, writing what are essentially windows thick clients to be run in a web/browser environment, on the other hand, is not one of them. Do yourself a favor and avoid them like they’re going to give you herpes.. because they might just cause you to do stuff that will!
Silverlight on the other hand.. well, to regress, I was actually one of the ones adamant against using Silverlight. I kept beating the horse saying that it wasn’t mature enough (this one is still largely true, but read on), it wasn’t for doing the type of applications we needed/wanted to do, it might not even be supported in a few years and on and on. Mostly I already had done extensive work on the ASP.NET and AJAX applications and finally had all them working like I wanted and really didn’t want to spend a month working with a technology I knew nothing about that quite likely just wouldn’t work for what we wanted to do. Luckily, I lost that fight. It took me less than 2 full work days to get the basics of our application working in Silverlight and, amazingly, we ran into no bugs. The platform is just SO much more solid than any other web platform out there right now. Once you have everything working the way you want it to.. it stays working. Probably the most important difference between Silverlight and ASP/AJAX (not that they’re even direct competitors, it just happened to be an either/or situation *for us*) for us was in handling the user interface and layout. For our application we wanted it to always make full use of the entire browser window (with a bunch of collapsible sections in the application) no matter how big or small it is and never require scrolling even when it only takes up a small chunk of the screen. Getting together a proof of concept of this running in ASP/AJAX was actually extremely [misleadingly] easy. We got that together so quickly and so close to what we wanted that we initially abandoned all research into other areas and just decided to go this route. Huge mistake. When we started making the necessary corrections to the built-in controls for our needs all of a sudden all our layout code (that you’d think/we thought would be 100% seperate) started going completely nuts. Change out a textbox in a grid to a combobox in the same grid and all of a sudden the grid would shoot out a few thousand pixels off the side of the screen filled with nothing but empty space.. to name one of about 3 billion instance of strange, completely uncalled for problems. All the sections of the application that were developed and working completely fine in isolation were suddenly broken in inexplicable ways when moved into the main application despite the fact that there was exactly 0 overlap and 0 communication between them. Whatever - I don’t even want to go into half the problems we ran into with all this (although I would LOVE to know why everything worked perfectly fine in the R&D stage but completely bombed in production!!!!)
Silverlight isn’t without it’s faults, however. In fact, in the current beta release (2.0 beta1) there’s some completely fucking retarded parts to it. Quite a few actually. For one, there’s no buit-in ComboBox. There’s a built in Date Picker, RepeatButton (you click it and a status bar gets progressively bigger), a 3-state button and a whole bunch of other shit no one (read: hardly anyone) ever uses, but one of the single most integral UI components IN HISTORY is currently absent. What. The. Fuck. Luckily writing your own combobox that works “well enough for now” is fairly easy, requiring maybe 5 lines of XAML and another 20 of C# code to do. Microsoft promises (with sufficient fine print to allow them to back out of the promise at any given time) to have a combobox in by the time 2.0 is fully released and I, along with many others, are just crossing their fingers and praying it comes soon. In the meantime, rolling your own that works well enough isn’t difficult at all.. writing your own that works exactly like you want it to on the other hand is not nearly as easy. If you can’t wait for that, you can always pay $500-$1000 USD for something that you would normally never even consider paying money for. Yeah, right.
Data Binding
The only other massive gripe (there’s a million minor ones) I currently have with Silverlight is the data binding. .NET provided you with a whole host of different ways to bind controls to your data, but in general just about everyone (at least everyone I know) all chose the same route - DataSets. You fill a DataSet with your column and row definitions and your data and just bind that to your control and everything worked automagically. It was extremely useful and by a massive margin the single most used data binding feature ever implemented in .NET. So, naturally, they chose to use this for Silverlight.. err, wait a minute, no they EXPLICITELY DENY YOU THE ABILITY TO DO THIS IN SILVERLIGHT. THERE ARE NO FUCKING DATASETS! The only way to bind data in Silverlight is to have an IEnumerable (say, a List<> object) of objects where each property of the object turns into a column. So, say you have a class called Row with properties ‘Name’ ‘Date’ ‘Other’ and you have a list of 50 of those with different values for each property. When you bind that to a DataGrid, you’ll get 3 columns and 50 rows with each column name equal to a property in that class. Sound good? Well, [un]lucky for us we will never ever ever ever ever ever ever ever have any idea what columns are going to be in our data sets until they’re there. You can even add new columns in real-time. We can’t possibly have a class that has each column enumerated as a property because WE DON’T KNOW WHAT THEY ARE TO MAKE THEM PROPERTIES. With DataSets this was never a problem, since you never had to define ANYTHING at compile time. While you could do it at compile time if you wanted to, in the background everything was still done at run-time. Not so in Silverlight 2.0 Beta 1. Currently the workaround I have for this is a massive ‘Row’ structure with hundreds of Col0-ColN properties and a constructor that takes one of our customly developed DataRow structures as a parameter and fills out the structure with one massive switch statement. These DataRows are wrapped in a ‘DataSetViewable’ class that has a list of them and takes one of our custom DataSet structures as a parameter and fills everything in. This structure can now be bound to Silverlight DataGrid controls directly and everything works mostly OK except for the fact that all the column titles are “Col0, Col1 .. ColN” with a few hundred of them not even having data. So what we have to do is, after binding (if you do it before, everything crashes horribly) go back through the DataGrid’s column list and change the header name to what we actually want and mark all columns with no data as invisible. Then everything looks and works fine.. from the user’s perspective at least. Which is good enough for us for now until Microsoft get’s their shit together (they have promised, while simultaneously not gauranteeing, that this will be fixed before 2.0 is fully released).
Other than all that, which has made me seriously considering pistol whipping some of Microsoft’s developers a number of times, Silverlight has been a miracle worker for us. Once you get around the retarded nuances and get your shit working, it actually stays working solidly and reliably - something I could never say for ASP.NET, AJAX, generic javascript, flash or just about any other web technology. I should stress the fact that Silverlight 2.0 (which really should’ve been called 1.0) is still in beta stage at this point and everything me and my company have been encountering should be expected given the fact that we’re extremely early adopters of a technology that wasn’t even originally designed (as far as we can tell) to do what we’re doing with it. But still - no ComboBox? What the hell were you thinking?
That’s the end of my ranting for today. My sister (who I haven’t seen for a few years now) is going to be in town all weekend, so I’m going to finish up here at work and go catch up with her. Have a happy Memorial Day Weekend everyone!
P.S. I’ve updated my BRDF post with some more links to BRDF Databases. I’m still missing a lot of my favorite databases, especially one which had around 40GB of data in it and was freely available to the public. I’d really really love to find that. If anyone comes across it, please send me a line.