Original Post
Does anyone have an Idea on how to one put a mask on the camera and two make it zoom in like a gunscope, I am trying to make a sniper in my game.
-Scotto
Gingerbread Men
quote:
Original post by hplus0603
To zoom, control the "fov" factor of your perspective matrix. Smaller fov == more zoom.
To show a "scope" I would render a big black texture with a transparent hole in the middle, and some scope-like cross-hairs in the middle, using alpha testing (or blending). I would render this in orthographic mode (screen space) after rendering the entire scene. If you know what the size of the scope aperture is, you can do frustum culling to the size of the scope hole, instead of the entire screen, which may save you a few mesh draws.
DP4_SAT out.color.r, in.color, regs.colorMatrix[0];
DP4_SAT out.color.g, in.color, regs.colorMatrix[1];
DP4_SAT out.color.b, in.color, regs.colorMatrix[2];
0.6, 0.6, 0.2, -0.4,
0.4, 1.0, 0.4, 0,
0.2, 0.6, 0.6, -0.4,
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more