Vertex Shaders and fixed function lighting.

Started by
2 comments, last by ET3D 17 years, 6 months ago
Hi, when I use my (simple) vertex shader to transform objects from world into projection space I'm completely losing all fixed function lighting. Is this a trade-off to using vertex shaders or is there a way to keep it?
Advertisement
Passing the moment when you start using shaders you are completely giving up your FF functionality, but, that's why the shaders are here :) you are able to have absolutely(ok,i know i know, not absolutely but nearly :) )everything under control.
so,in your particular case, you have to implement lighting and every other logic you want in your shaders.
Just to add to that - Fixed Function and Shaders are, for the most part, mutually exclusive. You can't mix-n-match [smile]

However, implementing parts (or all) of the fixed function lighting is not too complex. Have a search around for "Blinn-Phong" lighting or, if you have a recent SDK dig around in the "FixedFuncEmu" sample - it's for D3D10 but the maths should be extractable.

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Check out this ATI code. It implements a fixed function pipeline in SM2.

This topic is closed to new replies.

Advertisement