rendering
Between a driver and an hard place
Posted April 20th, 2008 by DavideFriday I got to test a new model that I'll have to use for my current project.
The unoptimized model had over 1M polys (it's a small one 8). I went on to display it with the DX10-based engine and it crashed the (NVidia) driver.
The model is actually composed of many smaller models, so it's not like there is a huge vertex buffer. It also had no textures and I was using a simple common shader.
The only issue I can think of is the range of coordinates which it's relatively very large. It's a laughable supposition, but everything points to that. I'll have to debug to find a workaround.. but it's not easy considering that those driver crashes force me to reboot almost every time ! (Vista stays up, but I can't do 3D anymore).
This is a really bad setback. For the test I eventually displayed the model with my ultra-basic software renderer... no crashes there ;) ..and if there were, I could have fixed them myself.
Another thing that bothers me about DX10 and drivers in general, is how one has to guess performance, because the internals are obscure.
For example, using an NVidia 8800, I noticed that performance is a lot worse when using buffers flagged as "dynamic".
This whole "static" vs "dynamic" thing is apparently part of DX10 and Vista's driver model. Somebody, somewhere, probably decides to put the buffer in system memory (as opposed to GPU memory) under the assumption that the buffer needs to be touched frequently. Only, I may want to change it rarely, and also I was sort of expecting for the buffer to be allocated directly in the GPU memory and only be mirrored in system memory if I ever tried to read from the buffer (which I wouldn't dare to).
So, I have to be really careful and only use the "dynamic" flag for things that change frequently.. and possibly forget about building a flexible system that uploads textures and geometry on-demand.. which is otherwise theoretically very possible with no (not much ?) performance degradation.
As it stands, it seems almost that dynamic buffers are being uploaded per-frame, regardless of the fact that they aren't being modified per-frame.
..this is all speculation of course.. but that's what I really don't like about this: having to spend time trying to guess what those drivers do behind my back.. and hope that different drivers on different card will behave similarly (crashes aside ;).
For this reason I hope that the time will come when game companies can write complete graphics pipelines again. Either in-house or licensing code, but staying away from closed-source drivers, so that one won't have to debug and profile in the dark.
Some are worried that they couldn't possibly do much better than what card manufacturers already do with those drivers.. I think that there is plenty to improve by just getting rid of those fat drivers that have been plaguing PCs ever since 3D cards came out.
ole'
Damn Cg.. and shaders in general ?
Posted November 13th, 2007 by DavideToday I hit a wall.. a performance issue that I was expecting sometime, but not quite as bad.
Currently I'm working with nVidia's Cg for shaders on OpenGL. One ugly thing about shaders is that one often ends up with a lot of permutations, depending on the number of inputs a shader deals with.
For example a shader may get vertex color in input while another may get texture coordinates in input.. it grows exponentially !
Each combination has traditionally been converted into a separate shader-program.. which is not nice, especially if there is no simple way to have all these programs instead share values that should be common to all of them.
For example any vertex shader will normally get one (or two) transformation matrix per-object, while an object is often built of different materials, thus different shaders.
In Direct3D 9 with HLSL one can set some virtual global registers, which is a bit ugly (there is a more high level system on PC but not on XBox 360) but does a nice job of sharing those values across programs. In Cg however, one has to explicitly connect shaders parameters.. which, as it turns out, can be pretty bad for performance.
My current shaders base is composed of 16 total shaders which all share 2 matrix transformations (to screen space and to world space). So, every time I set those two matrices for a 3D object, it really sets 32 matrices and it possibly even stalls somewhere.. because my frame rate will drop drastically for 1000 objects !!!
Basically I'm there not rendering anything and seeing FPS rate going from 90 to 15 just by setting up the transformation matrices for 1000 objects.
Supposedly Cg 2.0 (if combined with the latest nVidia cards ?) allows to have a common buffer that all shaders can share.
I'm curious to see how Direct3D 10 deals with those shaders params and state changes in general... however D3D 10 requires Vista, an OS that isn't quite as approved yet in my company.
Given the situation, I will be getting a new computer to be used to run Vista. As I picked the hardware I felt a bit guilty asking for relatively high end stuff.. but it's for work.. really !
wooooooo
P.S. Let's see if I can go to sleep before 4 AM tonight !
Software rendering, Web 0.1, Mathematics and the new Babel
Posted November 8th, 2007 by DavideA lot goes through my head !
Aha !!!
For example:
Software rendering
Fixed pipeline came to the rescue long ago, then HLSL/Cg shaders came and now I just want to get rid of all that bullshit.
I think Paul Heckbert (poly_scan.c ...yeah !!). Render a polygon, do something per-pixel. Give it to me, stop this "safe family driver" shaders bullshit !
Currently web sucks (you win.. rince !)
It sucks to put anything other than text on the web, it sucks sucks. The next thing would be PowerPoint. You can actually drag and drop a picture into a PowerPoint document... I know Sergey & Larry have something like this cooking up somewhere.. and if they don't then it means they went the way of Microsoft -> rotten, self-overwhelmed by its own identity -> we do this way because we do this way because we do this way...
Mathematics
Something great happened to my group while I was in Arizona.. someone decided to go for math lessons for everyone in the group !!!
I "love" math but I'm not good at it.. we need lots of practice. I got involved with it and we'll be studying linear algebra for the sake of everyone, especially for the artists... but then I want to introduce signal theory -> it's at the base of information theory !!! Signal theory is widely underestimated in computer graphics. It's relegated to chip-making but it should be tought at a higher level (SHRM hinted it, An Efficient Representation for Irradiance Environment Maps finally proved it for me)
My Data
Ultimate goal for the Google Duo and Steve Jobs and some half-assed person that has taken the place of a tired Bill Gates (tired to make money and possibly more interested in World issues.. can't blame him !).
It's complex. Google has the web, but the web sucks (see above). You can upload pictures, but it's a pain in the ass. Apple has MP3 players that are turning into computers (and computer buyers).
Neither the web nor the Apple software are yet a good solution. Data is money: the more you get the more you are afraid to lose. I take a lot of pictures and I constantly worry about downloading and publishing. Where, when and until when ?
Digital cameras are everywhere and so are ex partners. Men more than women take pictures, that's a lot of ex girlfriend pictures. Is that women's next trick ?
It used to be: beg me to stay because I give you sex. Soon it could easily be: beg me to stay because you took to many pictures of me/us to be able to move on without a million new arguments with your possible new gfs.
Digital madness.. a solution to a problem that we created.. is that how machines are going to owe us ? Is that how Sergey&Larry or Steve are going to try to save us (for a price 8) ?
The Databusters, like the GhostBusters... get your data under control.. quite a mission.
But one day I will lose my data.. and I will be very miserable.. and then I may just be very happy 8)
P.S. Japanese language
Fack !!! I should be studying !!!
The future of 3D graphics (wow !)
Posted April 9th, 2007 by DavideMy employer has been involving me more and more with 3D technology development for the company. Very nice indeed !!
From time to time, I get involved with very interesting technology previews. What I see is not what I can report of. Also early preview of things don't normally tell the whole story. However, it seems that programmability is coming back in a big way.
This is somewhat obvious, considering how programmable shaders are getting constantly more powerful and pervasive. Also, with the PS3 almost going Cell-only, with nVidia releasing CUDA and with the academical world wishing for more GPGPU.
With great programmability comes great uncertainty: what's next ? read more »


Recent comments
3 hours 56 min ago
4 hours 55 min ago
12 hours 4 min ago
12 hours 21 min ago
1 day 46 min ago
1 day 4 hours ago
2 days 4 hours ago
2 days 4 hours ago
2 days 10 hours ago
2 days 10 hours ago