37 minutes ago, Bartosz Boczula said:
In VS I need light position - but I don't have one! I only have light direction, what light position should I use?
I would recommend using the position of the light. Unless the light is representing the sun, in which case just the direction can be used, you will need the light position. But you didn't say if the light is a spotlight, point light, etc. I'll assume spotlight.
53 minutes ago, Bartosz Boczula said:
I have working camera class, with Projection and View matrices and all - how can I reuse this? I should put camera position, but how to calculate "lookAt" parameter?
Create a new camera for the light if you want. Though it's easy enough from the position/direction to create the ortho/projection matrix to pass to the shader. I don't know what programming language or graphics API you're using so keeping this generic. You shouldn't need to calculate the look at, you have the direction, just set the camera direction to the light direction.
55 minutes ago, Bartosz Boczula said:
Is this suppose to be ortographic or perspective camera?
Spotlight would use a perspective camera. A point light might generate a cubemap. A sun would use orthographic. etc. Depends completely on the type of light source.
57 minutes ago, Bartosz Boczula said:
And one more thing - when in the 3D piplene is the actual write to the Depth Buffer? In PS or somewhere earlier?
The pixel shader. The vertex shader just multiplies the vertex by the mvp matrix you pass in. The pixel shader writes depth information to the depth buffer.
1 hour ago, Bartosz Boczula said:
I think I understand the idea behind Shadow Mapping
I'm not trying to be mean, but I think you were using poor resources as all your questions should have been answered by whatever you were reading/watching to learn from.
These are OpenGL resources but the concepts are the same for D3D, the video is Java + OpenGL but again translating the concepts to C++/C# should be quite simple:
http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-16-shadow-mapping/
The last video is one of like 8 that show different techniques.