1

How can i move normal map without moving the camera and without moving light source in Three.js?

i have a plane that is perpendicular to the vector of the camera view. This plane is always in the center of the view. When I move the camera, and the plane moves with the camera and light source moves too.

Light source located behind the camera and directed onto the plane. This source of lighting as well as the plane moves synchronously with the camera.

To observe the changes on the map of the plane, I can either move the camera or move the light source. In my situation they move simultaneously and are not displaced relative to each other.

I need something like another virtual camera movement which would produce changes in the normal map on plane.

Thank you for your attention.

Eugene
  • 21
  • 3

1 Answers1

0

the most efficient way to do this is by creating a new shader. a less efficient method would be using a canvas as a texture. by moving the image on the canvas, you move the texture on the plane.

im currently working on a project which requires a HUD, i'm using similar methods. when i get to it i'll post a fiddle.

Kevin Kuyl
  • 1,215
  • 1
  • 17
  • 31
  • Very interesting approach. It's not just that the solution with the canvas is less efficient. The priority for me is the most realistic solution. Yes, I understand that I need a shader, but rather a modification of an existing shader, such as this http://mrdoob.github.io/three.js/examples/webgl_materials_normalmap.html So I need to change some value of the normal map shader, as if it was the camera movement in a usual situation, but without a real camera movement. As far as I understand, that there must be a simple way to do this with existing shaders. – Eugene Oct 30 '14 at 10:05