Today's journal is a kind of twisty one. I know I won't work for long
stretches today, but rather in short bursts of pure speed. Actually, as I start
this little log, I hear the middle school kids heading off. 8:00am. Seems a
little early. I don't remember going to school that early. Do you? Anyways, back
to the journal. The reason I won't be working for long stretches is that I've
got appointments today that break up my day into 3 chunks of time. Some longer
than others, but the only one I can really get some long stretches of work done
are the in the 3rd chunk, night time. It seems like night time is becoming one
of my more productive periods.
Chunk 1: Morning
I won't be going into the office this morning. My first appointment is at
11:00am. What's the use in going to the office for an hour and then leaving for
my appointment. Well, that's what I thought last night. Turns out started my day
at 7:00am today, working from the home office. Don't you love technology? It
actually wasn't supposed to be a working morning. I just wanted to do some
reading and research. Then I read the post mortem for TRON2.0 and that got me
thinking about the glow which got me thinking about shaders. So, this morning
I'm reading all I can about shaders. I'll check in my code from last night, and
probably do some tutorial shader programming. Exciting isn't it. It is for me at
least. I'd love to get shader technology into our products. I think that it has
the potential to boost the visual appearance of our games significantly as well
as our productivity especially if we can get the artists tweaking the shader
code. I've been assured by various texts that RenderMonkey will allow this and
actually have it make sense. Let's hope so 
You're probably wondering why I'm so enamored with shaders. Well, first off,
shader development is fast! I've had a taste of them using EffectEdit. As a
prototyping tool for the fixed function pipeline, it's incredible. Before
EffectEdit, I had to experiment with and tweak the rendering and texture states
until they gave me an image. And then I had to experiment and tweak some more
until I got the right image. Each experiment and tweak required a recompile and
relink. That could be whole days of frustration in the beginning. With
EffectEdit (and I'm hoping with the other shader packages), I can experiment and
tweak with the states without recompile or relink. My turnaround time is
incredible. For instance, last night, working on the scorch marks, I must have
tweaked the second texture stage 20 or 30 times before I realized that it wasn't
getting texture coordinates. No recompile or relink. Just tweaking. Once I
finally got the proper set of operations, it was a matter of minutes to
translate that into the fixed function pipeline, add it to the existing code and
see it working. That's fast!
Secondly, shaders are new. There's been so much talk about shaders, it's almost
impossible to not get excited about them. Especially when you see what they can
do. There are about 4 books out right now that are completely dedicated to
shaders. Two major graphic chipset manufacturers are writing FREE development
software for shaders, ATI's RenderMonkey and NVIDIA's CgLabs. Both of the major
graphics APIs are switching to them. You can't ignore them if you hope to be
competitive. Most of the new technology talk I see includes shader examples.
Thirdly, shaders are portable. With the advent of HLSL (High Level Shader
Language), shaders are now written using a "C" like syntax instead of
assembly. HLSL isn't Microsoft specific either. NVIDIA's Cg language and HLSL
are almost one in the same. If I understand correctly, OpenGL's shader extension
was spec'd by NVIDIA and so it looks an awful lot like Cg
Not that we're
going to use it, but you can also envision the cross platform advantages of
shaders. Since they're written in a machine neutral language, my shader can run
on any platform (Mac OSX, Linux, Windows, XBOX, GameCube, etc...) as long as
that platform has the capabilities and library support.
Anyways, that's my rant into shaders. Now I'm off to do some of the
stuff.....
There are 2 things I want to get out of my research.
1) How do you add shaders to your rendering pipeline. Most shader examples are
jsut fragments of technology. They don't give you enough context to actually add
them to the pipeline.
2) How do I access the existing scene lighting without writing custom shaders.
In GalCiv2, lighting will be very dynamic. Stars, planets, weapons, explosions
and other objects can give off light. I want to know if I can write a general
shader that can handle all those cases. I know the TnL gives it to me for free.
Resources:
Hemisphere Lighting With Radiosity Maps
Implementing Modular HLSL with RenderMonkey
Implementing
Lighting Models With HLSL
Animation
With Cg
Shader
Integration- Merging Shading Technologies on the Nintendo Gamecube
Complex
Matrix Transformations
Four Tricks
for Fast Blurring in Software and Hardware
NOTE: Tried to use RenderMonkey. Loaded it up. Couldn't run the pixel shader
on my laptop so I deleted it. BOOM! Blue screen.
Chunk 2: Afternoon
Got back late from my appoint and I've got my second appointment coming soon. I
didn't even get to do much of what I wanted to do this morning. After recovering
from my RenderMonkey problem, it was time to take a showe and go. Ugh. I did
manage to read most of one article. It was cool, but didn't give me the answers
I wanted. Gotta keep looking. Maybe I'll post on gamedev or flipcode. Anyways, I
had a pretty busy afternoon even if I didn't do much coding. I checked in my
work from last night. It's pretty sweet now. Had long conversations with the
team to discuss new things we can do and how we're going to change the map. That
means that we've got more stuff added to our todo list. I don't mind, it's all
fun. Cari and I split the projects that needed to be done and so we're just
going to go ahead full steam on those.
So, the gist of the afternoon. Essentially a long meeting. Hopefully tonight,
I'll get some stuff done. I'd like to at least get one screenshop up.
Chunk3: Evening
Well, here it is, evening. I'm pretty tired today. My alergies were killing
me. I wanted to do SOMETHING though. Especially after that long meeting the
afternoon. The work keeps piling up and I can't just let it do that. Especially
with the demo looming. So, I decided to do something.
1) I read a little bit more on some of the docs from this morning.
2) I implemented the hard part of the minimap. There's still more work to do,
but at least the hard stuff is done. We still have to fit it into the console
properly and we have to add variable render states to the starmap. For instance,
we don't want to draw the tile lines in the mini map, just the sector lines.
Also ships, planets, and the background have to change for the mini map. We'll
probably have to implement the same stuff for the main map so we'll kill 2 birds
with one stone when we do that.
3) Tried to fix the selection cursor, but all the files weren't checked in.
4) Added more randomness to the map. We can now have stars that have different
textures, different scales, different speeds, and different lights. Here are the
screenshots I promised 


For higher end machines, we can also do multi-texture work to get clouds. Or
add rings and satellites. Wouldn't that be neat 