Project From View (UV Map) During Runtime

Is it possible to achieve the same effect as the UV mapping option “project from view” during runtime? I’ve tried manipulating UV coordinates but that gets really complicated really quickly.

Here is a static replica of what I’m attempting to accomplish in game (arbitrary example). Note the texture remains in place while the shape moves.






Thanks for any pointers!

Hmmmm… Well I can think of 3 ways that should be possible.

  1. Object > Material > Texture > Mapping > Coordinates; Use something other than UV, maybe Global or local.

  2. There are scripts on the forums which facilitate UV scrolling. Said scripts achieve this by moving UV coords. If one were to “project” these points from the camera position/orientation, rather than move them linearly, the result should be the effect you’re looking for.

  3. Essentially the same idea, but using GLSL instead.

Hopefully the first option fits your needs, as it’s basically a 1-click solution - otherwise you’ll have to do some coding ; )

I think you can use GLSL nodes + the view vector

I wanted to tell the same.

Setting up those UVs for this projection means calculating position on screen for each vertex and using it for UVs. Higher poly objects means higher detail. View coordinates, however, use screenspace. The current fragment is interpolated between 4 points giving the right coordinates, but easily…