Skip to main content
gamedev.net
🔒 Locked

Render to texture problem

Started by Leroy1891 Jan 17, 2004 at 12:05 PM 3 replies 650+ views
Original Post
Leroy1891
Leroy1891
I have a texture class that can load an image and project it onto the screen in 2D and it can also prepare a blank texture to be rendered into. when i load an image into one texture and prepare another texture to be the same size I can render the contents of the first texture into the prepared one no problem. but when i try to draw the first texture and render that same area of screen into the same texture it slowly blurs. Any ideas?
Krohm
Krohm
Maybe because it''s getting slightly minified/magnified and this means it goes filtering. I hardly see how this could cause a problem in a short period of time but maybe some drivers/hardware is likely to blur it a little.

However, this explains a single blur (per frame) not why multiple frame gets blurred.
Umh, I guess I have no real idea of what''s happening. More infos may be nice.
Previously "Krohm"
Nik02
Nik02
The texel alignment brings a little error, because it is not exact. That accumulates to what you describe as "slow blurring".

Maybe your geometry or texture coords are 0.5 to 1 pixel off?
Also, what are you trying to do?

kind rgds,
-Nik
Niko Suni
Leroy1891
Leroy1891
the settings for loading an image and preparing for rendering
are the same. what i want to do is draw a tex to a certain part
of the screen and render that exact same area into it so as to copy it. that way i can superimpose other graphics onto the texture.

The texture coords are the same every time the texture is rendered so i don''t think that''s it.

I''m not sure what was meant by texel alignment. could you please explain
Nik02
Nik02
Texture sampling points are not necessary aligned exacly at the pixel border. The float to integer conversion introduces some error to the sampling process due to that fact.

Try moving the texcoords by some fraction, for example 0.5, at both u and v directions.

Note that I''m not an OpenGL expert, so I don''t know the exact recommendations for the offsets.

-Nik
Niko Suni

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.