Hello,
Im new to shader programming but im trying to do the following:
I have a Kinect and want to scan the height of a surface.
The scanned heightmap is passed to a shader, which is applied to a plane-mesh.
This vertex-shader moves the vertices in y-Direction, depending on the value of the heightmap and calculates the normals to replicate the surface scanned by the kinect.
The fragment-shader only renders a texture.
This works fine but i have 2 Problems:
Problem 1:
I want to display my surface like it is displayed with the diffuse-shader with shadows. Writing my own shader caused my object to be rendered without lighting. Do i have to write my own lighting now?
Problem 2:
Because the Kinect-heightmap is very noisy i want to apply a gaussian blur to smooth it a bit.
I was trying to do this in the vertex-shader but it seems like i should do it in another vertex-shader which is called before, because im already calculating the normals in the current one. But the normal-calculation only works after the heightfield is finished. I read a bit about passes but a pass seems to render to the display.
It would be nice if someone could help me out.