PDA

View Full Version : GL_NV_DEPTH_CLAMP fails in some 'game profiles'



gstrickler
05-17-2006, 01:43 PM
Ok, this is a pretty strange problem. My app runs on PCs with FX cards, and on PCs with Quadro cards. I use NV_DEPTH_CLAMP for shadow rendering. Now just lately I've found that while the code is bullet proof on FX cards, on the Quadro cards sometimes the depth clamp just does not work.

I discovered that I can restore the depth clamp extension by selecting some "Game Profiles" (in the Nvidia driver control panel.) WIth some profiles clamping works, and with others it does not. But I can't find an individual driver setting that makes any difference. And the documentation on game profiles does not exist.

Has anyone seen anything like this before? I'm not sure what to do about it. :confused:

I'm using ForceWare 81.67 on a Quadro 3400 and a Quadro 1000 card in the PCs that fail. I'm using driver version 67.22 on FX5700 on the PCs that are bullet proof.

TomorrowPlusX
05-17-2006, 03:33 PM
Out of curiosity, what are you doing on ATI cards? IIRC they don't support depth clamp. As such, I just bit the bullet and implemented the infinite view frustum technique.

gstrickler
05-17-2006, 03:40 PM
My app is for internal use at Boeing. When new users get a copy, they are instructed to "get an Nvidia card."

TomorrowPlusX
05-17-2006, 05:18 PM
Are you married to the idea of using depth clamp? It took me all of an afternoon to rewrite my shadow projection code to use an infinite frustum.

rgpc
05-18-2006, 12:03 AM
Just a suggestion but try running something like RegMon and change the profiles. It might be that an option is being changed in the registry that affects NV_DEPTH_CLAMP.

gstrickler
05-18-2006, 08:41 AM
My shadow volume is orthographic because it's always from the sun. I thought the infinite frustum trick was to pull perspective projections out to infinity. And my real issue is not z-far, but z-near.

I use bounding hulls to compute a viewing frustum. All the objects in the final hull are shadow receivers. But there can be objects out of the field of view and far up-light that cast shadows onto the visible hull. When I generate the shadow depth texture using an ortho light view, I want to limit the Z to range over the visible hull. The up-light object's shadows all clip to the near plane. That's where the DEPTH_CLAMP works by clamping all the vertices and laying them flat against the near plane. Then all those shadow's project over all the objects actually within the viewable hull.

The immediate alternative is to pull z-near during shadow generation all the way back to the farthest shadow caster, but that reduces the shadow depth resolution within the visible hull.

rgpc: can you tell me more about where I can find profile info in the registry. I've looked and did not find anything. I really don't know how the profiles work. It was my initial impression that what you suggest is exactally what's happening... something in the profile is effecting NV_DEPTH_CLAMP. But I'm lost as to how to work this.

Thanks,