• entries
    338
  • comments
    2046
  • views
    1154292

Shaders!

Sign in to follow this  
dgreen02

270 views

Alright...I hope I'm not getting in over my head here :-)

As I'm implementing multiplayer into my game, I'm going to also be overhauling the graphics engine as well. Right now the game doesn't use ANY pixel/vertex shaders, it's all done completly using the fixed function pipeline *embarrassed*. With the power of today's graphics cards this is absolutly not acceptable.

My main reason for doing this will be to shift my current software skinning onto the graphics card. Last time I profiled the game, I was spending about 25%+ of the CPU cycles animating/transforming the character/vehicle models...again, this is not acceptable. As I'm now adding multiplayer to the game, I'll be needing those CPU cycles :-)

I'm not going to require users to have the latest PS 3.0 graphics card. In fact since I've designed the whole engine up to this point to use the fixed function pipeline, I'm not going to have any requirements, I can always fall back to this implementation.

I'm really making this switch out of necessity, though there will be all kinds of benifits...just wait 'till you see the cityscapes I'm going to come up with. Reflections on the sides of the buildings/cars will now be a reality. I'm going to add some pretty badass water into the game as well.

I'm working on the game fulltime, and I'm going to charge money for the game...so it's the least I can do for my customers. Also I hope that by doing this I'll make the game a little more competitive.

I'm going to be targeting Vertex Shader 2.0, and Pixel Shader 2.0. If these shader models are not supported I'll fallback to VS1.1 & PS1.3. If those aren't supported....I'll use the fixed function pipeline to replace each one's functionality. That's how it looks right now, I'm still doing some basic tests to see exactly what I'm in for. Though it looks like I'll need to write a few different versions of each shader for different hardware.

Here's a screenshot of a slightly confused gangsta' :-) This is actually using a 256x256 texture for the character, I'll be replacing them with 512x512 versions soon.


Alright...back to work...wish me luck ;-)

- Dan

[EDIT QUICK UPDATE]
Alright...I did up a test app. and I'm displaying 900 animated models, with a 512x512 texture, and 1100 tris each. I'm getting about 60 FPS at 1280x1024 I can't believe it....where have vertex shaders been all my life!?!?! They're all using the same animation & texture...but still...jeeezus, I should make a Total War game or something lol. Throw some Romans into the game for shits and giggles.

Sign in to follow this  


9 Comments


Recommended Comments

If I stare at it long enough, will they all turn around and be John Malkovitch? [grin]

I'm curious about your choice of pixel shader 1.3. The only difference between PS1.2 and PS1.3 is the "texm3x2depth" instruction - something that isn't really that frequently used - though the differences between PS1.1 and PS1.2 is a little greater (cmp, dp4, texdp3, texdp3tex, texm3x3, texreg2rgb). Is there a specific effect that won't fit in PS1.1?

Share this comment


Link to comment
Here's how the shader support of my local test computers breaks down:
- PS 2.0 & VS 2.0 (Radeon x700)
- PS 1.3 & VS 1.1 (Geforce 440MX)
- PS 0.0 & VS 1.1 (Radeon Mobility 7500 <-- beast of a chipset!)
- PS 0.0 & VS 0.0 (is that even possible!?!? It's a Radeon 9250 with 256 MB of RAM, I think it's being read wrong from the card...ATI's site says PS 1.4 and VS 1.1....I gotta look into this).

That's the only reason I said 1.3. Not because of the instruction differences, but because of what I could guarantee support for through my testing. Though you're right I should probably drop it down to PS1.1 & VS1.1 as the fallback.

Good call on the Malkovich [grin]

- Dan

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now