PDA

View Full Version : pixelated scene



magni
04-13-2004, 02:36 AM
What I'm trying to do is to get a highly pixelated view of a scene, where each pixel is antialiased. Let's say the scene is rendered at a resolution of 64x64, to get a good base for antialiasing, but it is shown in just 16x16 pixels covering the whole viewport.

The approach I've had so far is to render the scene to a texture using a pbuffer with mipmaps being generated. The idea was then to render a quad over the whole viewport, with the mipmap that has 16x16 texels, and have that stretched over the quad. I've got the render to texture thing working, what I can't find out is how to use a specific mipmap level when texturing a quad. Is this possible? Any better approach?

dorbie
04-13-2004, 05:44 AM
You can select a MIP level but to get the MIP levels generated you'll need the auto MIP calculation extension and hope it works with a render to texture. Dunno if that's the case.

You can select a MIP lod using the texparameters TEXTURE_MAX_LOD and TEXTURE_MIN_LOD.

magni
04-15-2004, 12:57 AM
I didn't really figured out how to use the TEXTURE_MIN/MAX_LOD parameters, don't have much time now. I got confused that this is a float parameter. And if it is to be applied when the texture is generated or when it is used.

So I solved it by first render to one texture, take this texture and render to anotherone, smaller, with the appropriete filtering. Finally display this texture... probably not cheap at all.

ZbuffeR
04-15-2004, 05:53 AM
The texture LOD is a float in order to work properly with trilinear filtering (LINEAR_MIPMAP_LINEAR). Setting the to 1.5 will combine two levels. That way you can have extra (slightly ugly) blur.