Page 2 of 56

Posted: Wed Oct 15, 2008 1:53 pm
by BlindSide
Sudi wrote:But ur still using the direct shadow method...
I'm trying really hard to get screen shadowing to work......so that i don't have to change the shader of each model which should receive shadows.
Hmm, are you sure about this? I think that I am using "the screen shadowing method". You don't really have to change the shader of anything. The shadows are calculated in a different pass then overlayed on the screen, so it is independent of the scene's materials.

Posted: Wed Oct 15, 2008 2:05 pm
by sudi
Ok i might be wrong but to me it looks like ur setting the material for each node urself in XEffects.

Code: Select all

ShadowNodeArray[i].node->getMaterial(m).MaterialType = 
						(ShadowNodeArray[i].shadowMode == ESM_CAST) ? (E_MATERIAL_TYPE)WhiteWash
						: (E_MATERIAL_TYPE)Solid[ShadowNodeArray[i].filterType];
haven't checked the references ur using there yet.

i guess the method i mean is called deffered shading so that u only render the depthmap twice. once from the point of the cam and then from the light. transform both into camspace and compare. then shade the already rendered scene.

Posted: Wed Oct 15, 2008 2:14 pm
by BlindSide
Sudi wrote:Ok i might be wrong but to me it looks like ur setting the material for each node urself in XEffects.

Code: Select all

ShadowNodeArray[i].node->getMaterial(m).MaterialType = 
						(ShadowNodeArray[i].shadowMode == ESM_CAST) ? (E_MATERIAL_TYPE)WhiteWash
						: (E_MATERIAL_TYPE)Solid[ShadowNodeArray[i].filterType];
haven't checked the references ur using there yet.

i guess the method i mean is called deffered shading so that u only render the depthmap twice. once from the point of the cam and then from the light. transform both into camspace and compare. then shade the already rendered scene.
Hmm yeah but to render the depth map you still need to temporarily change the material like I do unless you had direct access to the depth buffer or something. So in the end it's the same thing (Except filtering becomes screen space, which might not be as accurate).

This is a touch-and-go method, I change it, render, then change it back, so it's transparent to the user. I do this in the depth render pass and in the shadow mapping pass.

I do like the performance aspect of the deferred idea, I will definately try it some time when I look more into deferred shading.

Posted: Wed Oct 15, 2008 2:19 pm
by JP
BlindSide wrote:What video card you using? You're referring to just the point light demo right? Keep in mind that the point lights even at the lowest res/filter still offer pretty decent quality since you're using 6 shadowmaps instead of one, and there is no wasted space so the resolution is used sparingly.
It's a geforce 59XX (can't remember the XXs!) and it's much below 20fps on both so fairly unusable for anything unfortunately :(

Posted: Wed Oct 15, 2008 5:29 pm
by fmx
Sudi wrote: i guess the method i mean is called deffered shading so that u only render the depthmap twice. once from the point of the cam and then from the light. transform both into camspace and compare. then shade the already rendered scene.
wait a minute, isn't this how projective shadows work anyway?
what is xeffects doing if not this method?! I really need to have a look at the code :P

just some stats for you, on my P4 2GHz geforce 7300GT (latest drivers, DX9) I get:

Example 1:
- OGL: with best settings max FPS = 13
- OGL: with crapest settings max FPS = 17

- DX: with best settings max FPS = 11
- DX: with crapest settings max FPS = 16


Example 2:
- OGL: with best settings max FPS = 2
- OGL: with crapest settings max FPS = 7

- DX: with best settings max FPS = 1
- DX: with crapest settings max FPS = 7


OGL generally seems to perform a tad better (not by a lot tho').
No ATI machine I can test it on unfortunatly ;)

Posted: Wed Oct 15, 2008 6:29 pm
by xDan
Hi again,

You seem to have fixed all my shader compile errors, great.

Direct3D still runs fine... but for OpenGL, the included binary crashes! (the previous one did too, after I attempted to fix the errors myself)

Here's the output with my graphics card info etc: http://pastebin.com/m42b0a204

It says GLSL version is 0.0

Now I tried compiling it myself. Using Irrlicht 1.4.2.

And it runs without crashing! also this time reports that GLSL version is 1.0

It seems getVendorInfo is not defined. So I commented out the line you say (so ScreenRTT is screen sized), which gives this

http://xzist.org/temp/xeffects1.png

setting the screenRTT size to (512,512) fixes the size problem, but it's still not right:

http://xzist.org/temp/xeffects2.png

My graphics card (ATI mobility radeon 9700) drivers are a few years old, it's an acer laptop and they don't provide updated ones. (and I have never managed to update them myself)

Hmm! :)

Direct3D notes:
- I get about 30-40 FPS on the lower settings. As high as it will go @2048x2048 and 16 PCF it's about 20 FPS.
That's for the first example. Example 2 is about 20 fps on the lowest settings, 4 on the highest!
- when setting the shadowmap resolution too high for my card (4096x4096), it gives lots of "Error: Could not set render target." messages. Is it possible to automatically fall back to a lower size if that is not supported?

Posted: Wed Oct 15, 2008 6:35 pm
by dlangdev
Blindside has done it again.

U da man.

Laudamus magnus.

Posted: Wed Oct 15, 2008 8:38 pm
by L_Draven
Deleted

Posted: Wed Oct 15, 2008 8:46 pm
by dlangdev
amigo, por favor, open up a new thread in the beginner section. gracias.

by the way, please delete the post above, it doesn't belong in there.

thanks.

Posted: Wed Oct 15, 2008 9:02 pm
by L_Draven
Ok sorry, i have deleted the post and created a new thread in Beginners section.

Thansk anyway.

Posted: Thu Oct 16, 2008 6:23 am
by torleif
I got it working, however shadows can't be seen (will work a bit harder soon though)

Question: does the pixel size have to be 2^n? I use resolutions in my game that are 3:4 (and thus not 2^n). The stretching is really bad.

Ambient light

Posted: Thu Oct 16, 2008 6:52 am
by asparagusx
Blindside - does this support ambient light?

Thanks

Anton

Posted: Thu Oct 16, 2008 7:12 am
by BlindSide
Why did you make another account aheymann? :S

Currently it supports global ambient color through effectHandler::setAmbientColor() and also you can set individual material properties if you want to effect the color in a diffuse manner. Please look at the tutorial for more information.

torlief, what problems are you encountering now? There is nothing restricting any of the resolutions to be 2^n except for hardware and Irrlicht limitations. These include problems with ATI in OpenGL and lack of large RTT support in DX in Irrlicht.

Cheers

Posted: Thu Oct 16, 2008 2:42 pm
by asparagusx
Forgot my password :)

Posted: Fri Oct 17, 2008 12:31 am
by sudi
Totally forgot to say that it works great over here.
I'm using a laptop with geforce8600gt. well framerate is really when using the pointlight.


btw i have done some research and found some really nice article about deffered lightning. but none about shadowing which is kinda making me believe that its not something u should do or maybe no one has simply done...or i'm to stupid to find it. anyway keep up the good work.