Help! shadow map bug in NVIDIA!

Member
Posts: 68
Joined: 2005.09
Post: #1
Hello,
So, I have compiled two different shadow map code examples that render shadows on my G4. they only require GL_ARB_depth_texture and GL_ARB_shadow. This graphics card I'm having a problem with is in a G5, and it's a GeForce 6800 Ultra with 1.5 supported and both extensions reporting for duty. BUT-- oh ho, this is where it gets tricky- the same code that works on my GeForce3 NVIDIA card does NOT work on this new one. If it were a simple case of "well, they aren't supported" I'd be okay. But, they are supported, and the card tells me so with glGetString.

What do I see? I see everything but shadows. I've looked at the shadow map, (which normally shows grayscale imagery on the geforce3) and it is just plain white on the new card. Which means the rendering to the texture isn't working, I can assume.
It was suggested I try to change the texture target for the shadow texture from TEXTURE_2D to TEXTURE_RECTANGLE_EXT. Except, that extension isn't on this card-
GL_EXT_texture_rectangle is, and while i cant be sure I'm doing it right, it doesn't seem to fix the problem.

Any thoughts? I really need to move on to the next part of this project, and I can't believe that its taken a month and I'm in the same technical problem. Annoyed

thanks all!
-dylan
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
Sounds like a bug. File it, get an ATI card, and move on.
Quote this message in a reply
Member
Posts: 68
Joined: 2005.09
Post: #3
crap i would except thats not really an acceptable answer-- these cards are in our lab computers, so if i have hope of turning in work, i gotta figure it out.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
If you can, try the Halo or Myst V demos on those machines. Both use shadow mapping for their shadows (though you may have to turn them on in the options). If they don't work, I'd say you're screwed.
Quote this message in a reply
Member
Posts: 68
Joined: 2005.09
Post: #5
thanks, i'll give it a try and report back tomorrow. Anyone else have this problem on this card? I have no problems sending the xcode project if you want to try it out and let me know!
thanks
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #6
For what it's worth, the shadows rendered correctly in Myst V for me on my powerbook with an FX 5200 Go. I only got about 3fps though...
Quote this message in a reply
Member
Posts: 68
Joined: 2005.09
Post: #7
Good news. Shadows work in the myst demo. I suppose this card can use the extensions, so any idea what next?
thanks!
Quote this message in a reply
Member
Posts: 68
Joined: 2005.09
Post: #8
i'm trying to find where the problem is then, in the generation of the map or the comparison, etc.

-I can display the depth texture to the screen, mapped on a poly- on my g4, this shows a monochromatic version of my scene, and different levels of grey = depth.
-On the g5 in question, this results in a blank map, a white poly. Same code. This is before it hits shadow extensions- so something is going wrong and it's not letting me render to this texture.
-Is there anything you guys know of that would be causing this? I'm trying other formats to see if i can get anything to render into a texture in this case- granted the testing isn't extensive, but all i've been able to do thus far is get it show a solid green, as opposed to a solid white texture.
-I would think I was missing something obvious, but this code works on my other machine. Is there a format or something that got un-supported?
-I can send code for anyone willing to help me out with this utterly frustrating problem.

Thanks!
Quote this message in a reply
Member
Posts: 153
Joined: 2004.12
Post: #9
Just out of curiosity, this isn't the shadow mapping demo in the openGL bible book is it?

There was a long silence...
'I claim them all,' said the Savage at last.
Quote this message in a reply
Member
Posts: 68
Joined: 2005.09
Post: #10
This particular code is from Paul's shadow mapping tutorial:
http://www.paulsprojects.net/tutorials/smt/smt.html

I looked briefly at the openGL bible shadow section and all i remember is that I liked the way this did it better. But, to each their own.

By the way- the conclusion of this: on the 6800:
-The problem is that DEPTH_TEXTURE_MODEs other than LUMINANCE are broken.
The suggested solution (thanks to alex!):
"Interpreting the boolean depth result as LUMINANCE data will work, but then the alpha is a constant 1.0 and you see a lot of artifacts that the alpha test is supposed to fix."
In code, this means changing:
//Shadow comparison should generate an INTENSITY result
glTexParameteri(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE_ARB, GL_INTENSITY);
into:
glTexParameteri(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE_ARB, GL_LUMINANCE);

Some banding will happen--unless you get a new card, just put up with it until the fix is released.

Cheers
-dylan
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #11
hangt5 Wrote:Just out of curiosity, this isn't the shadow mapping demo in the openGL bible book is it?

Good point -- that demo fails on my 5200, where the shadow-mapping tut that was discussed here a few weeks ago worked beautifully.
Quote this message in a reply
Member
Posts: 68
Joined: 2005.09
Post: #12
The 10.4.3 update has fixed the Nvidia 6800 bug and shadow mapping now officially works! With any luck, this thread has been helpful to some poor 6800 owner who wanted shadowmapping in his or her game.. I'd like to think I wasn't the only one.

I wonder what else 10.4.3 fixes?
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #13
Lots Wink

Good to hear shadows are working for you now.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #14
Not the crash with SGIS_generate_mipmap / on-the-fly texture compression on GeForce 6800s, despite what the people behind the Apple bug reporter would like me to believe... why'd they have to get my hopes up like that Mad
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  2d shadow blending problems tesil 1 5,620 Mar 17, 2011 10:12 AM
Last Post: Skorche
  Replacing edges with degenerate quads (for shadow volumes) Coyote 9 7,528 Jan 15, 2010 07:08 PM
Last Post: Coyote
  Shadow Mapping - Self-Shadowing Z-Fighting Artifacts Bachus 16 21,076 Feb 11, 2009 12:24 PM
Last Post: arekkusu
  GPU shadow volume extrusion with GLSL TomorrowPlusX 12 12,866 Jan 24, 2007 03:21 PM
Last Post: JoNo21
  Pbuffer problems on Intel NVIDIA GeForce 7300 GT NYGhost 5 4,176 Oct 26, 2006 09:39 AM
Last Post: NYGhost