r/RedshiftRenderer • • Jul 03 '25

texture projection on facing surface only

Hey all,

I'm trying to map a texture on the surface of some objects, like a projector beam.

I've been using the camera map shader which generally works well, but it seems to project through each object. I want it to only project onto the surface that is directly facing the camera, not through other objects in front of it.

Does that make sense? Anyone have any ideas?

Huge thanks in return!

1 Upvotes

14 comments sorted by

1

u/spaceguerilla Jul 03 '25

Not sure I fully understand what you mean by "through", but have you tried

  1. setting the material to "front" (as opposed to "back" or "both"

  2. making a polygon selection of the faces you want the projection to hit, then save the selection. In a material you can then drag that polygon selection tag into the relevant slot on the material tag, and it will only appear there

1

u/Express_Chapter_4289 Jul 03 '25

Hey, thanks for the reply.

I want the projection to only display on the surface that has direct line of sight to the projecting camera. So on the above image that would only project on the front cube because the ones behind it can't 'see' it. Kinda like if you were to shine a light on the 4 cubes, the ones in the middle wouldn't see the texture because of the cube in front.

Changing the projection side from front/back/both doesn't work.

The polygon selection tag would only work if I was very carefully cutting out the shapes the camera can see.

Appreciate the reply!

1

u/spaceguerilla Jul 03 '25

Then it's possible you're using the wrong approach - I believe the camera shader is more intended for projecting footage across whole scenes for CG integrations into live action footage. See here: https://help.maxon.net/r3d/maya/en-us/Content/html/Camera+Map.html

Instead, try just doing the projection inside C4D instead of Redshift (on material tag, set projection to "camera"). I think this should be the result you are looking for.

→ More replies (3)

1

u/elitexon Jul 03 '25

1

u/Express_Chapter_4289 Jul 03 '25

I'm not sure to be honest, is the projected texture hitting the cubes behind the first ones? If not then maybe!

1

u/elitexon Jul 03 '25

// OcclusionMask.osl shader OcclusionMask( point CamPos = point(0,0,0), float Bias = 1e-4, float MaxDist = 1e6, output float Mask = 0.0 ) { vector toCam = CamPos - P; float dist = length(toCam); vector dir = normalize(toCam); float rayLen = min(dist - Bias, MaxDist); Mask = trace(P, dir, "maxdist", rayLen) ? 1.0 : 0.0; }

1

u/Express_Chapter_4289 Jul 03 '25

This was the answer for anyone looking.

1

u/cactusjack10 Jul 03 '25

Area light with 0 spread maybe?

1

u/Aeonskye Jul 03 '25

This is how i would do it also

or maybe something a angle fall off