• Home
  • Documentation
  • Forum
  • Blog
  • Users
    • Map
    • Userlist
    • Businesses
    • Userpages
    • Connections
  • Contributions
    • All
    • Store
  • Downloads
    • vvvv beta
    • vvvv beta previews
  • Store
Show / Hide Table of Contents

Shadow maps using depthbuffer

Author: elliotwoods
Date: 31 Jul, 2012
Category: demo
Credits:

elliotwoods

Download

64bit

0-shadow map 0.1.zip
31 Jul, 2012 - 13:23

Description

This patch and shader demonstrate how you can use a depth buffer as a shadow map to cast shadows from a light source.

Note that this is meant more as a learning tool than for your final projects, as there's many aesthetic improvements that should be made before deploying as a virtual scene lighting tool.

I've uploaded it here mostly to demonstrate the principle of how to perform this type of shadow mapping.

Comments

Comments are no longer accepted.
Please create a new topic in the vvvv beta forum to discuss this contribution.
kimiki
31 Jul, 2012 - 13:52

1+

thx elliot

nissidis
31 Jul, 2012 - 13:54

+1 perfect !

nissidis
31 Jul, 2012 - 13:58

but doesnt work for me, plus I cant find this INTZ format texture..

elliotwoods
31 Jul, 2012 - 15:02

@nissidis : you need the latest vvvv alpha release (alpha28 not beta27)

nissidis
31 Jul, 2012 - 15:16

Yes, just noticed it in the tags section above.. :) thx ! (NITZ isn't it only for ATI's hardware ? :S)

elliotwoods
31 Jul, 2012 - 16:01

from http://aras-p.info/texts/D3D9GPUHacks.html#depth

INTZ is for recent (DX10+) hardware. With recent drivers, all three major IHVs expose this. According to ATI <1>, it also allows using stencil buffer while rendering. Also allows reading from depth texture while it’s still being used for depth testing (but not depth writing). Looks like this applies to NV & Intel parts as well.

It should work on NVidia, ATI and Intel

nissidis
31 Jul, 2012 - 17:36

thanks a lot Eliot!

nissidis
31 Jul, 2012 - 18:01

Another question : these shadows' artifacts (these that you mentioned before) are they because of Sampler, File Format or smoothstep() ?

PS: Is fast and accurate, I love it!

elliotwoods
01 Aug, 2012 - 11:48

this is the 'de-facto' way of treating the shadows: http://www.gamerendering.com/2008/11/15/percentage-closer-filtering-for-shadow-mapping/

but an even better way is to defocus them with a soft shadow: http://www.rastertek.com/dx11tut42.html

both are fairly easy additions to the above

Psykeview
11 Oct, 2012 - 13:16

very nice elliot, i like it very much and the performance is very good, just would like to know how to remove artifacts from the shadows,,, any tip to achieve this? thanks

nissidis
11 Oct, 2012 - 18:11

if you increase the FOV of perspective node and pull the light source further than the initial position (for example in Y axis) you will get a much better result eliminating almost all these artifacts. I still have the soft shadowing problem since I am totaly noob in hlsl programming and concepts :/

nissidis
11 Oct, 2012 - 18:28

@Psykeview --> a 'hint' would be the device(EX.9) wich is rendering the INTZ texture (right side). Check there until you start seeing the teapots getting white/grey, this was the only practical way for me to understand what I was doing...

  • Improve this Doc

© 2020 by vvvv group. Imprint | Privacy Policy.
Thanks to DocFX for building this website. Analytics by Plausible.

Back to top