0

I'm trying to make a projection using the uv project modifier :

uv project uv project

But I would like to project only once (don't re-project behind at the place where it should be shadow)

shadow

Would it be possible to use a light path camera ray from another camera than the one doing the final render ? Or use another attribute to make the projection only visible once and not project through all the object ?

Maybe a custom OSL or GSLS shadowmap from a point could be possible ?

I'm trying to reproject many photos (only one per frame) onto a photoscanned model :

texture view camera view

I'm aware that I can project texture from light, but it produces only photons that will be absorbed (or bounces) onto a surface. I would like to have control over the shader and decide if I want to project a shadeless texture or project it as a texture used in the principed shader after.

quellenform
  • 35,177
  • 10
  • 50
  • 133
softyoda yoann
  • 575
  • 6
  • 17

1 Answers1

0

I think what you are looking for is masking the actual texture out based on a camera direction.

I suggest you use the dot-product node in the shader graph. The first input should be the mesh normals and the second input the projecting camera's direction. The result can be remapped using a color ramp node and then multiplied over the texture.

To get the camera's direction you could place an empty right down the z-axis of the camera and subtract the camera's position from the empty's position (maybe through a driver if necessary). If you have a lot of photos it could be a pain to manage the uvs and textures. Alternatively you could use a photogrammetry software like the opensource software MeshRoom to texture your mesh.

adegner
  • 886
  • 4
  • 12
  • My goal isn't to texture my mesh, but to have representation of what each image represent over the image.

    I have tried the dot product from the camera uv project and the normal map but it give wrong result, my node setup : https://i.imgur.com/rnDrcbc.jpg the result : https://i.imgur.com/P3y87s0.jpg it don't hide behind projection https://i.imgur.com/Ls2IjKo.jpeg

    – softyoda yoann Apr 10 '21 at 11:49
  • I have found another anwser related to the same issue as mine https://i.imgur.com/MMJtZL3.jpeg here https://blender.stackexchange.com/questions/121210/camera-projection-without-generating-uvs I'll see how this anwser work. – softyoda yoann Apr 10 '21 at 12:08
  • Ok. It think your node setup inputs the uv vectors instead of the camera forward direction. Also the color ramp does not go between black and white. If you post a blend on blend exchange I can set it up for you or show you where the issue is. – adegner Apr 10 '21 at 13:17
  • Here is my file : i had to decimate a lot to reduce file size. I'm trying to merge it with a shader of from this blend : but his aspect-ratio/focal script don't work well (empty at wrong place) – softyoda yoann Apr 10 '21 at 14:18
  • I have managed to merge the osl script with my scene, i'll write a reply when i'll finish the video. – softyoda yoann Apr 11 '21 at 12:14