• Welcome to Dark Bit Factory & Gravity.
 

Lighting scaled objects?

Started by Stonemonkey, December 12, 2007

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Stonemonkey

At present I calculate my vertex shading by transforming my camera to object space but I'm now wanting to be able to scale objects preferably by different amounts along each axis, is it still possible to transform the camera to object space taking the scaling into account and so be able to calculate the shading so it's correct for the scaled object in world space?

I'd like to be able to do this to avoid having to transform the normals and re-normalise them.

Cheers, Fryer.

Stonemonkey

I'm not sure if it can, I can see it being done in 2d but having problems seeing it in 3d. Still, if anyone has any ideas about it...

Jim

I think in general you need to recompute the normals.  If your scales aren't too extreme, you could light it and then scale it?  It would be wrong, obviously, but it would look pretty much OK.

Jim
Challenge Trophies Won:

Stonemonkey

I've pretty much come to that conclusion but there is something I'm going to try before giving up and settling for re calculating the normals.