WEst
Community Member

Posts: 805
Daniel Martinek
|
 |
« Reply #20 on: April 30, 2008, 12:43:53 PM » |
|
It doesn't look that bad  , how many PCF taps are you using? And do you use any hardware shadowing helpers (HW ShadowMapping on nVidia or Fetch4 on ATI)? And the last question, will there be a Demo, or even some source code some day?  Now as the questions are done we can draw the attention to the problem: Seems like the resolution of the map is not high enough for the spheres selfshadowing, you can either try to increase the size (which is normally very bad), do some more blurring with PCF (which also needs a lot of performance) or you do what every good developer does when he has no solution: hide it. The Balls look very much unshaded, maybe a simply phong shading can hide the bad shadow edges a bit.
|
|
|
|
|
Logged
|
Greetings
Daniel Martinek Lead Programmer Roaming Nova Studios
|
|
|
GD
Customers
Community Member
    
Posts: 360
Josip Basic
|
 |
« Reply #21 on: May 01, 2008, 05:00:41 AM » |
|
Yeah West is right. Selfshadowing should not be used as an lighting technique. I dont know but I logically assume shadow caster should be rendered with faces front culled? I see you're doing here back culling. Also try making shadow bias larger, and let the lambert do diffuse lighting. Hope I was of help.
|
|
|
|
|
Logged
|
|
|
|
Mietze
Community Member

Posts: 236
|
 |
« Reply #22 on: May 01, 2008, 05:29:57 AM » |
|
Ya, ure right. Hiding is a common "technique" hehe. But for now, I went a step backwards, but its worth it. Instead of splitting the shadow map into four parts, I simply use one ARGB-channel per shadow map / split. This allows a four times higher resolution per shadow map split on the same texture resolution. Though it looks very funny aaaaand: there are less instructions for uv-offsetting in the shaders needed. There you go:  @west: I was using a 4x4 poisson disk with 16 samples for the blocker search and 16 samples for the filtering. Its barely slow and the quality sucks. I wonder how the inventors archieve such a good quality. Maybe theyre just fakin'.. I dont know  @GD: Ya, youre right. I render only backfaces to reduce non-biased surface acne. But there is a small bias yet. Maybe I will disable self shadowing some time, or only for specific models (since the platform is very low poly and though nice self shadowed)
|
|
|
|
|
Logged
|
|
|
|
AriusEso
Customers
Community Member
    
Posts: 376
Esoteric
|
 |
« Reply #23 on: May 01, 2008, 06:04:41 AM » |
|
I'm going to probably keep posting the same thing. But wow  . This is very good work. Shadow mapping is still a little advanced for me, I only have a very simple implementation working here. So any info is good info and this thread is educating me as it goes on. Good stuffs  .
|
|
|
|
|
Logged
|
|
|
|
WEst
Community Member

Posts: 805
Daniel Martinek
|
 |
« Reply #24 on: May 01, 2008, 06:23:22 AM » |
|
Ya, ure right. Hiding is a common "technique" hehe. But for now, I went a step backwards, but its worth it. Instead of splitting the shadow map into four parts, I simply use one ARGB-channel per shadow map / split. This allows a four times higher resolution per shadow map split on the same texture resolution. Though it looks very funny aaaaand: there are less instructions for uv-offsetting in the shaders needed.
Lol, that is funny, because yesterday I just did the same for my Omni-Lightmapping and saved one light per channel to save some texture samplers (it's a bit a strange implementation I have going on here, but I will show it when it is ready and optimized). @west: I was using a 4x4 poisson disk with 16 samples for the blocker search and 16 samples for the filtering. Its barely slow and the quality sucks. I wonder how the inventors archieve such a good quality. Maybe theyre just fakin'.. I dont know
Wow, that is quite a lot, I use only a 3x3 Kernel for the most time and it's already quite slow, but if you want really smooth filtering you should look into the optimization docs of the graphiccard vendors, there are techniques like fetch4 and HW shadowmapping that can improve your performance or quality very much.
|
|
|
|
|
Logged
|
Greetings
Daniel Martinek Lead Programmer Roaming Nova Studios
|
|
|
Mietze
Community Member

Posts: 236
|
 |
« Reply #25 on: May 01, 2008, 07:01:18 AM » |
|
Wow, that is quite a lot, I use only a 3x3 Kernel for the most time and it's already quite slow, but if you want really smooth filtering you should look into the optimization docs of the graphiccard vendors, there are techniques like fetch4 and HW shadowmapping that can improve your performance or quality very much.
Thanks for that information! I will get into that when I'll find some time. Ehm.. see for yourself:  The quality is a "bit" better now. I had the idea to replace the binary result of uniform depth testing (light depth < shadow map = {0,1}) with the exponential shadow mapping stuff. The result is quite acceptable. Its still running with a ARGB16F 1024px² shadow map, which allowes hardware filtering over here and offers enough precision for that small scene. Take a look at the spheres. Isnt that beautiful self shadowing? 
|
|
|
|
|
Logged
|
|
|
|
Mietze
Community Member

Posts: 236
|
 |
« Reply #26 on: May 01, 2008, 07:04:34 AM » |
|
The Balls look very much unshaded, maybe a simply phong shading can hide the bad shadow edges a bit. I use the half lambertian term for that, to use the full range of [0, 1]. The "full" lambertian term has a result range from [-1, 1], which results in only a half shading of the geometry (over 50% are < 0 => black)
|
|
|
|
|
Logged
|
|
|
|
WEst
Community Member

Posts: 805
Daniel Martinek
|
 |
« Reply #27 on: May 01, 2008, 07:11:41 AM » |
|
Wow, it really looks alot better now 
|
|
|
|
|
Logged
|
Greetings
Daniel Martinek Lead Programmer Roaming Nova Studios
|
|
|
Lenn
Customers
Community Member
    
Posts: 390
Ivan Miskelic
|
 |
« Reply #28 on: May 01, 2008, 07:14:05 AM » |
|
Really cool stuff! Nice imporvements, keep them coming. 
|
|
|
|
|
Logged
|
|
|
|
Mietze
Community Member

Posts: 236
|
 |
« Reply #29 on: May 01, 2008, 07:15:58 AM » |
|
Wow, it really looks alot better now  Yepp, but the hardware filtering only does a few things:  The difference isnt as that visible in this magnification scene, but it rules when it comes to mip mapping. EDIT: For all of those who're interested in PCS/Poisson Sampling, see http://www.cs.virginia.edu/%7Egfx/pubs/antimony/ 
|
|
|
|
« Last Edit: May 01, 2008, 07:21:52 AM by Mietze »
|
Logged
|
|
|
|
Mietze
Community Member

Posts: 236
|
 |
« Reply #30 on: May 01, 2008, 09:33:10 AM » |
|
I also don't use the far plane configuration yet. This means the far plane of the cameras view frustum gets clamped to the scenes bounding box, to remove empty space on the Shadow Maps - but thats easy to do. Now there it is:  This small thingy tightens the frustum to the scene bounding box, reducing wasted world space. This isnt very useful on large scale terrain scenes, but fits perfect for my upcoming project 
|
|
|
|
|
Logged
|
|
|
|
Toaster
Community Member

Posts: 141
|
 |
« Reply #31 on: May 01, 2008, 10:00:19 AM » |
|
wow dude this is looking really good.  Cant wait to see a demo or video.  -Toaster
|
|
|
|
|
Logged
|
|
|
|
|
newborn
|
 |
« Reply #32 on: May 01, 2008, 11:23:41 AM » |
|
Where do we send the money to have access to the source of this thingie? This looks awesome!
|
|
|
|
|
Logged
|
|
|
|
Mietze
Community Member

Posts: 236
|
 |
« Reply #33 on: May 01, 2008, 01:49:54 PM » |
|
Where do we send the money to have access to the source of this thingie? This looks awesome!
Thanks, I appreciate it! I think i will release the source code of the prototype project and the shaders when its quality/performance balance is okay. Its portability is very easy at the moment. I've ported this baby within five minutes to my actual game project: 
|
|
|
|
|
Logged
|
|
|
|
Mietze
Community Member

Posts: 236
|
 |
« Reply #34 on: May 02, 2008, 06:59:49 AM » |
|
|
|
|
|
|
Logged
|
|
|
|
munna
Community Member

Posts: 8
|
 |
« Reply #35 on: May 02, 2008, 08:26:25 AM » |
|
wow!!! great work!!!  "Where do we send the money to have access to the source of this thingie?" 
|
|
|
|
|
Logged
|
|
|
|
|
Happy
|
 |
« Reply #36 on: May 03, 2008, 10:08:38 PM » |
|
OMFG... 
|
|
|
|
|
Logged
|
|
|
|
|
JohnB
|
 |
« Reply #37 on: May 03, 2008, 11:49:15 PM » |
|
Wow Mietze - that's awsome work!
John B.
|
|
|
|
|
Logged
|
|
|
|
|
Zaknafein
|
 |
« Reply #38 on: May 05, 2008, 12:51:39 PM » |
|
Hot damn, I'm off in Cuba for one week and you come up with all this??  A couple of comments... - I've never tried ESM at all, but my VSM results too have been less than satisfactory. The classic problems; light bleeding, lack of precision which makes acne and flickering near "edges", almost inescapable use of 32-bit surface and so no access to filtering... At least straight VSMs, not layered or sum-area'd (neither of which I've tried). Anyway if you get good-looking PCF, it's more than enough. - I think you've made the first percentage-closer soft shadows implementation in TV3D... Awesome job! - Mixing ESM with standard shadowmap comparison in order to get smoother self-shadows sounds... hacky. But it does look good, even if you lose the nearest shadows. - And the color-coding is a genius idea! 4x resolution for free... Woah. Again I'll be very interested in a demo!
|
|
|
|
|
Logged
|
|
|
|
Mietze
Community Member

Posts: 236
|
 |
« Reply #39 on: May 06, 2008, 01:28:31 PM » |
|
- I think you've made the first percentage-closer soft shadows implementation in TV3D... Awesome job! Yepp, and its a good thing. But damn, its so hard slow!! 32 samples per pixel on a 16x poisson disc to get good shadows is something for a HPC-cluster, but not for my lame 7800 GTX :/ - Mixing ESM with standard shadowmap comparison in order to get smoother self-shadows sounds... hacky. But it does look good, even if you lose the nearest shadows.
I found out that its a common issue of ESM with near shadows, which is unacceptable, since my player model only casts "near shadows". - And the color-coding is a genius idea! 4x resolution for free... Woah.
That is what my idea was about  But if you plan to pre-filter it (a la gaussian), you need to take care about the channels. You cant just blur it per pixel, you need to blur it per channel, which is a bit slower if you dont do it correcly (and if you're a fool like me). Again I'll be very interested in a demo!
I dont think that I'll have the time to publish a demo. I probably will release one some time, but first I have to concentrate on my current project (the chimp-thingy)
|
|
|
|
|
Logged
|
|
|
|
|