Skip to main content
gamedev.net
🔒 Locked

Reflection issue

Started by godmodder Apr 1, 2007 at 9:30 AM 1 replies 1.3k views
Original Post
godmodder
godmodder
Hello, I've just added reflections to my engine and everything works fine, except when I walk very close to the reflective surface with my camera. When I do this, the reflection texture seems to stretch out. I've set my texture mode to CLAMP_TO_EDGE for the reflection texture. (when I don't set any special mode I get repeating patterns of the reflective objects when I get near) I use pBuffers for rendering into reflection texture, but because the reflection itself is fine I don't think that's causing any problems. Rendering the reflections in the texture with a wider FOV seems to lessen the artifacts a little, but not entirely. Here you can see an image of the reflections looking good: And here is a close-up of the scene when it goes wrong: Any solutions? Jeroen
MePHyst0
MePHyst0
Are your pBuffers(I really advice you to move on to Frame Buffer Objects) and the back buffer the same dimension? If not, then you have to take this into cosideration. Basically what are you getting is trying to read the reflection texture with coordinates outside [0,1], and thanks to CLAMP_TO_EDGE you get a constant color on the borders.
godmodder
godmodder
Thanx for the reply!

I solved the problem by using my camera viewVector in the reflection calculation instead of the (viewVector - cameraPosition). I also rendered into the reflection texture with a FOV of 60 instead of 45. All the artifacts are now completely gone and I'm a happy coder again!

PS: as for the size issue, weren't pbuffers designed to circumvent this problem?
PS2: (pun intended) I'm using pbuffers as a fallback approach. I like to code for the broadest range of hardware first and then resort to special extensions etc...

Jeroen

Topic Locked

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

Sign in to reply to this topic.