• Advertisement
Sign in to follow this  

Would anyone like to testdrive my shadow program?

This topic is 4163 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm planning on running this program (link below) which demonstrates various shadow mapping techniques on one of the university's computers but before doing so I'd like to know if there are any compatibility issues across various setups. You'll probably need something equivalent to an ATI Radeon 9600 or nVidia GeForce5. As for controls, just use the left/right mouse button to adjust the view/light. Also, since I'm running this on a fairly high-end rig (Athlon 64 3800+, ATI X1900XTX), performance isn't really much of an issue but I'd appreciate it if any of you could give me a general assessment on performance on your system (there's a built-in FPS counter). Thanks. http://www.yousendit.com/transfer.php?action=download&ufid=8F4744626A6E5E41 [Edited by - Pasquinel on August 11, 2006 4:32:21 PM]

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by oscinis
Include glut32.dll ;)


Ah, Thank you. Are there any other files I need to include? I already have glut32.dll embedded in my windows system folder but I can understand how some of these university computers may not have it.

Share this post


Link to post
Share on other sites
Quote:
Original post by CoyCash
Crashed for me after the second messagebox; no explanation given.


So you were able to get past the second messagebox but not the third? There's suppose to be a third message box which pops up verifying if the shaders compiled correctly. If you were only able to get past the second message box, then I think the program's having trouble finding where the "/Models" and "/Textures" folders are located. The zipped file already has all the folders in their correct locations but, just to be on the safe side, make sure those folders are located in the same directory as the "DynamicShadows.exe" executable.

Share this post


Link to post
Share on other sites
it says "FBO unsupported" or some crap and crashes. wtf is FBO? Why cant people program things in a normal way without using wierd stuff...

I have a GeForce 6800 with latest drivers.

This all brings me to my conclusion that OpenGl should be banned.

Share this post


Link to post
Share on other sites
Mine says FBO supported then says shader compatible hardware and then crashes, could it be because of a different glut32.dll version ???

My PC specs:

AMD Athlon 64 3500+ @ 2.2ghz
256mb nVidia GeForce 7600GT
1 gb of ram
WinXP SP2

Share this post


Link to post
Share on other sites
I get through FBO, GLSL, but then it says FBO Configuration usupported. Geforce 7600 GT here.

Share this post


Link to post
Share on other sites
Quote:
Original post by Matt Aufderheide
it says "FBO unsupported" or some crap and crashes. wtf is FBO? Why cant people program things in a normal way without using wierd stuff...

I have a GeForce 6800 with latest drivers.

This all brings me to my conclusion that OpenGl should be banned.


FBO is an acronym for Frame Buffer Objects in OpenGL. Essentially, they allow you to render to a shadow map larger than 1Kx1K and they're potentially faster than the old glCopyTexSubImage2D by rendering directly to texture rather than copying from the framebuffer. Anyway, I'm kind of surprised your GeForce 6800 is getting that message. If anyone else is having any trouble, I could upload a new file with FBOs disabled, you just won't be able to crank the shadow map resolution beyond 1Kx1K.

Share this post


Link to post
Share on other sites
Thanks for the feedback folks. It seems like most of you have nVidia cards so I've switched to an internal texture format of GL_DEPTH_COMPONENT24 (I was using GL_DEPTH_COMPONENT16 since that's the only one supported by my ATI). Included in this latest zip are executables for nVidia (DynamicShadowsNVIDIA.exe), ATI (DynamicShadowsATI.exe), and FBOs disabled (DynamicShadowsNoFBO.exe) just as a precaution in case neither the nVidia nor the ATI ones work. I've also included my version of glut32.dll.

http://www.yousendit.com/transfer.php?action=download&ufid=8F4744626A6E5E41

[Edited by - Pasquinel on August 11, 2006 4:25:50 PM]

Share this post


Link to post
Share on other sites
tried it, crashed :(
with the nVidia version I get the message box that FBOs are supported, then the message box that shader compatible hardware was detected and then I get an application error saying it couldn´t read memory at some address.
With the NoFBO version I get only one message box (shader compatible hw detected) before I get the same error as nVidia version.
I use a GeForce 6800GT 256MB.
You really should think about implementing a small debug log that would give us the option to tell you more specifically what goes wrong or where.

Share this post


Link to post
Share on other sites
Quote:
Original post by Matt Aufderheide
Ok it works. Is this app to show how bad shadow mapping can look? Because it does do that ...


Matt,

Which executable did you run and would you care to provide a screenshot? If you're running the "DynamicShadowsNoFBO.exe" version then you're going to be limited to a 512x512 shadow map resolution, though enabling "LiSPSM and PCF" or "LiSPSM and VSM" will help alleviate perspective aliasing quite a bit. Just make note that the current light mode you set will determine whether or not you can select a certain shadow mode so if you want to test out all the shadow modes (particularly LiSPSM), just leave the light mode on the default "Directional".

Share this post


Link to post
Share on other sites
Crashes for me on my GeForce 6200. I've tried all executables, and they all pop up saying "FBO supported", then "GLSL supported" (obviously, the no-FBO one doesn't have the first pop-up), then they get one of those generic errors from MS saying that the program encountered a problem and must be shut down.

Share this post


Link to post
Share on other sites
Quote:
Original post by matches81
tried it, crashed :(
with the nVidia version I get the message box that FBOs are supported, then the message box that shader compatible hardware was detected and then I get an application error saying it couldn´t read memory at some address.
With the NoFBO version I get only one message box (shader compatible hw detected) before I get the same error as nVidia version.
I use a GeForce 6800GT 256MB.
You really should think about implementing a small debug log that would give us the option to tell you more specifically what goes wrong or where.


matches81,

Hmm, if you got past the "Shader compatible hardware detected. Using GLSL." message box when running the NoFBO version then I'm fairly certain your nVidia card doesn't like the way I've setup my shadow/reflection/refraction map textures. Anyway, here's the code I used to setup the aforementioned textures. If anyone can spot anything nVidia specific, it would be of great help:

Shadow map

// Create shadow map texture and set the texture quality.
glGenTextures(1, &shadowMap);
glBindTexture(GL_TEXTURE_2D, shadowMap);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT24, shadowMapSize, shadowMapSize, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);

// Here is where we set the mode and function for comparison between shadow map and fragment seen from eye space.
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE_ARB, GL_COMPARE_R_TO_TEXTURE_ARB);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC_ARB, GL_LEQUAL);



Reflection map

glGenTextures(1, &reflectionMap);
glBindTexture(GL_TEXTURE_2D, reflectionMap);
glTexImage2D(GL_TEXTURE_2D, 0, 3, waterMapSize, waterMapSize, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);



Refraction map

glGenTextures(1, &refractionMap);
glBindTexture(GL_TEXTURE_2D, refractionMap);
glTexImage2D(GL_TEXTURE_2D, 0, 3, waterMapSize, waterMapSize, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);

Share this post


Link to post
Share on other sites
your code looks fine for nvidia cards. I suspect there's something wrong with the FBO setup code tho. can you show us that too?

Share this post


Link to post
Share on other sites
Quote:
Original post by LtJax
your code looks fine for nvidia cards. I suspect there's something wrong with the FBO setup code tho. can you show us that too?


Sure, I just assumed that people with nVidia cards were running into problems with the basic texture setup scheme since they had trouble running the NoFBO version (which doesn't setup FBO textures at all). Now that I think about it, when I compiled the NoFBO version, I don't ever recall having changed from GL_DEPTH_COMPONENT16 (which is the highest precision my ATI supports) to GL_DEPTH_COMPONENT24 (which, I've read somewhere, is what nVidia cards like). But then again, Matt was able to run the program...anyway, here's the FBO setup code:

FBO shadow map

// Create depth buffer.
GLuint depthBuffer;
glGenFramebuffersEXT(1, &depthBuffer);
glBindFramebufferEXT(GL_RENDERBUFFER_EXT, depthBuffer);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, shadowMapSize, shadowMapSize);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);

// Create and setup FBO.
glGenFramebuffersEXT(1, &depthFBO);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, depthFBO);

// Attach depth texture.
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, shadowMap, 0);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depthBuffer);

// There are no color buffers attached.
glDrawBuffer(GL_NONE);
glReadBuffer(GL_NONE);

// Verify all is well and restore state.
checkFBOStatus();
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);

// Delete the temporary buffer.
glDeleteFramebuffersEXT(1, &depthBuffer);



FBO reflection map

// Create depth buffer.
GLuint depthBuffer;
glGenRenderbuffersEXT(1, &depthBuffer);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depthBuffer);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, waterMapSize, waterMapSize);

// Create and setup FBO.
glGenFramebuffersEXT(1, &reflectionFBO);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, reflectionFBO);

// Attach depth and reflection texture.
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, reflectionMap, 0);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depthBuffer);

// Verify all is well and restore state.
checkFBOStatus();
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);

// Delete the temporary buffer.
glDeleteRenderbuffersEXT(1, &depthBuffer);



FBO refraction map

// Create depth buffer.
GLuint depthBuffer;
glGenRenderbuffersEXT(1, &depthBuffer);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depthBuffer);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, waterMapSize, waterMapSize);

// Create and setup FBO.
glGenFramebuffersEXT(1, &refractionFBO);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, refractionFBO);

// Attach depth and refraction texture.
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, refractionMap, 0);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depthBuffer);

// Verify all is well and restore state.
checkFBOStatus();
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);

// Delete the temporary buffer.
glDeleteRenderbuffersEXT(1, &depthBuffer);

Share this post


Link to post
Share on other sites
uh oh, could be me, but your shadow map FBO setup does look a bit weird. first you seem to generate your "depthBuffer" renderbuffer as a framebuffer (glGenFramebuffersEXT and glBindFramebufferEXT) and also you seem to replace your depth texture with that renderbuffer, which u seem to delete right after (which isn't a big deal since the spec states that it'll not be deleted before you stop using it)

Share this post


Link to post
Share on other sites
Okay, I've uploaded the latest executables with a few modifications. I've cleaned up some of the extension initializations and added several more message boxes. If any of you could give me the last message box that shows up before the program crashes, then I can more closely pinpoint where the error occurs.

http://www.yousendit.com/transfer.php?action=download&ufid=8F4744626A6E5E41

[Edited by - Pasquinel on August 11, 2006 4:25:20 PM]

Share this post


Link to post
Share on other sites
I didn't try the latest one, but the one prior to that and all three executables worked for me. The ATI one said that FBO configuration was unsupported and disabled FBOs, but it still worked.
I could only run normal shadowmapping though, all the other techniques gave me a
Quote:

profile does not support "while" statements.


I have a NV GeForceFX 5900

Really nice water btw! [smile]

Share this post


Link to post
Share on other sites
Still crashes, even after the latest "patch". Athlon 64 3500+, 2 GB of ram and X850 XT. Last message box says "Shader compatible hardware detected. Using GLSL.", then it crashes. Valid for all 3 executables.

Y.

Share this post


Link to post
Share on other sites
Quote:
Original post by Ysaneya
Still crashes, even after the latest "patch". Athlon 64 3500+, 2 GB of ram and X850 XT. Last message box says "Shader compatible hardware detected. Using GLSL.", then it crashes. Valid for all 3 executables.

Y.

Same here (well, except for the machine, which is an Athlon XP, 512MB RAM, ATI Radeon 9600).


Share this post


Link to post
Share on other sites
Quote:
Original post by Omid Ghavami
I didn't try the latest one, but the one prior to that and all three executables worked for me. The ATI one said that FBO configuration was unsupported and disabled FBOs, but it still worked.
I could only run normal shadowmapping though, all the other techniques gave me a
Quote:

profile does not support "while" statements.


I have a NV GeForceFX 5900

Really nice water btw! [smile]


Ack, I should've suspected this. Your GeForceFX 5900 is only Shader Model 2.0 compliant so it won't support any of the GLSL loops that I've written in the fragment shaders to perform kernel computations. I guess I'll have to throw away the loops then for added compatibility, though my fragment code will unfortunately be much longer. As for now, you could try turning off GLSL (in the settings dialog) when you run LiSPSM to see if that works.

Thanks for the compliments on the water :) but I should give proper credit where it's due, which I found from this excellent tutorial:
http://www.bonzaisoftware.com/water_tut.html

Share this post


Link to post
Share on other sites
Quote:
Original post by Ysaneya
Still crashes, even after the latest "patch". Athlon 64 3500+, 2 GB of ram and X850 XT. Last message box says "Shader compatible hardware detected. Using GLSL.", then it crashes. Valid for all 3 executables.

Y.


Hmm, does it give any windows specific error message after the "Shader compatible hardware detected. Using GLSL." message box? Anyway, if it crashes at that point then I can almost readily attribute it to a problem with loading either the Wavefront .obj files or the bitmap texture files.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement