Jump to content
  • Advertisement
Sign in to follow this  
csisy

sniper scope effect

This topic is 3337 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi here is what i want to do (in the end of the video) http://www.youtube.com/user/smleh#p/u/0/wZRwhcKWxvI maybe 2 render pass? first: the normal scene second: the "scoped" scene (new field of view) and composite? (i think it's too slow) thanks, csisy

Share this post


Link to post
Share on other sites
Advertisement
I'd suggest doing some offscreen rendering. You don't say what API you're using for graphics, for OpenGL you'd want to look at FBO's, that way you can render the 'scoped view' into a texture, and then apply that texture to the 'scope' part of the rifle, this would also allow you to do it all the time (similar to Halo 2/3) rather than just when you look through it.

Share this post


Link to post
Share on other sites
i use directx.
so just render the "scoped view" scene into a texture, and use it to the scope (lens)? i'll try it
thanks for the reply

Share this post


Link to post
Share on other sites
I would consider that to be somewhat unnecessary-- you're basically wasting VRAM and limiting the detail available. A more robust technique would likely be to do something similar to Portal. First, draw the zoomed-in scene almost like how you'd do it normally. Just increase the FOV and consider using scissor rectangles to increase performance. Then use some stenciling technique to mask out the scope lens. Finally, draw the rest of the scene as normal but configure the stencil test to reject any area you masked out previously. This way, you aren't arbitrarily limiting the level of detail available to the user *AND* can save the VRAM you would have otherwise spent on a render target. It's obviously a bit more complicated, but still something to consider ;)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!