# How to only render part of an image in lwjgl/openGL

I'm making a mining/building game in java using slick2D and I want to make it so you can only see a few blocks in any direction while you are underground. The best example I could find of what I want to do is the game miner dig deep.

One way I thought of doing it would be to have a large image and just draw transparent areas on it where you need to be able too see but even if that would be an efficient method I wouldn't be sure how to do that.

• Couldn't you just mask your buffer? Or have a texture with alpha overlayed on it? – Sidar Oct 18 '13 at 0:37
• if you want to mask in a rectangular area, consider using glScissor – PeterT Oct 18 '13 at 1:01
• It needs to be circular and I'm mainly using the slick libraries for rendering. I don;t know that much about openG but if someone could provide an example I would be able to implement it. – Ephyxia Oct 18 '13 at 3:07
• slick.ninjacave.com/forum/viewtopic.php?t=3598 – Sidar Oct 18 '13 at 10:06