Difference between revisions of "Mike notes"

From Bo3b's School for Shaderhackers
Jump to: navigation, search
(Created page with " ==== Shadows ==== Hi bo3b - yeah this is not the right shader for shadow rendering ;-) It's not always obvious, but a few clues are: - There is a ShadowMap sampler in the...")
 
(Shadows)
Line 16: Line 16:
  
 
I hope this stuff helps, I basically don't realize consciously nowadays what it is that I look for so writing this stuff down is useful for me too :-)
 
I hope this stuff helps, I basically don't realize consciously nowadays what it is that I look for so writing this stuff down is useful for me too :-)
 +
 +
 +
Related awesome post from DarkStarSword regarding fixing shadows:[https://forums.geforce.com/default/topic/766890/3d-vision/bo3bs-school-for-shaderhackers/post/4715553/#4715553 Shadow fixing]

Revision as of 00:17, 20 December 2015

Shadows

Hi bo3b - yeah this is not the right shader for shadow rendering ;-) It's not always obvious, but a few clues are:

- There is a ShadowMap sampler in there somewhere

- There is a SomethingXXXToShadow or SomethinXXXToLight matrix in there (or the reverse!)

- A World Coordinate is contructed from EyePos or CamPos, and a 3-comp texcoord

- There is an InvView or InvProjView in there (usually generating something in world coords)

- Recognize that you may not see the word "shadow" in a shader that actually plots shadows. As noted above you often need to look for matrices with "light" in them. This makes more sense because these matrices do a coordinate transformation to the "view" of where the light source is that either casts shadows or enhances the light on a surface, say like a spotlight (very much the same as the View transformation moving to the POV of the camera).

I hope this stuff helps, I basically don't realize consciously nowadays what it is that I look for so writing this stuff down is useful for me too :-)


Related awesome post from DarkStarSword regarding fixing shadows:Shadow fixing