Dan M

08-14-2010, 07:29 AM

Hi there,

I have some terrain in a grid. I'd like the edge to fade out so that the isn't a hard join between the void and the viable positions. I followed a method that I knew was going to result in the problem I currently have as I thought that I would have come up with a way to remedy it by now, but haven't.

So, at the moment I:

- Find the intersection between my camera location and the frustum's far centre with the four planes making up my terrain's boundary.

- Take the intersection point which is closest to me further (discounting ones behind me)...

- Calculate the signed distance between the point and the plane.

- Use this distance to setup GL_FOG_LINEAR's START and END values.

The problem is probably obvious. When I'm looking at a plane that's perpendicular to me everything's is fine. When I am near a plane and looking parallel to it towards an adjacent plane I can see the hard edge because the fogged distance is at the adjacent plane. When I'm near a plane and looking at it, but at an acute angle the fog is very close and obscures much of the terrain that should be visible.

So I guess I can't simply use GL's fog and have to come up with something more serious. Any suggestions of new methods or any way to remedy my current situation?

Thanks for any help you can offer,

Dan.

I have some terrain in a grid. I'd like the edge to fade out so that the isn't a hard join between the void and the viable positions. I followed a method that I knew was going to result in the problem I currently have as I thought that I would have come up with a way to remedy it by now, but haven't.

So, at the moment I:

- Find the intersection between my camera location and the frustum's far centre with the four planes making up my terrain's boundary.

- Take the intersection point which is closest to me further (discounting ones behind me)...

- Calculate the signed distance between the point and the plane.

- Use this distance to setup GL_FOG_LINEAR's START and END values.

The problem is probably obvious. When I'm looking at a plane that's perpendicular to me everything's is fine. When I am near a plane and looking parallel to it towards an adjacent plane I can see the hard edge because the fogged distance is at the adjacent plane. When I'm near a plane and looking at it, but at an acute angle the fog is very close and obscures much of the terrain that should be visible.

So I guess I can't simply use GL's fog and have to come up with something more serious. Any suggestions of new methods or any way to remedy my current situation?

Thanks for any help you can offer,

Dan.