using part of an image for an object texture, and another part for a different object texture

I have a photograph of a room with left, right and back wall visible, as well as floors and ceilings. I would like to ‘assign’ the right wall of the image as a texture for the right wall of a model, and likewise with the other components.

Is there a way to do this in Unity without taking the image, cutting out those portions and making traditional rectangular ‘unskewed’ images?

I am trying to replicate this effect, which I made in openframeworks, but using the collision detection and various awesome little graphical thingies in Unity: Gersart on Instagram: "Testing a theory #openframeworks #lowpolygon #code"

If this isn’t possible, I will try it the other way, I just thought I should ask.

If you virtual camera is matching the real camera in the photo you could use a shader that projects the texture in screen space instead of the uvs.

…I didn’t understand what you said, but it sounded sexy. any tutorials for how to accomplish this awesome-sounding thing?

(sorry, except the part for “shader” this sounded like “polarize the hull plating” in Enterprise…)

Try this shader i made for you in shaderforge:
(you can find the shader under “Shader Forge/ScreenSpaceProjection”
insert the photo texture into the MainTex slot and assign the material to your scene blocking objects.

// Shader created with Shader Forge v1.32
// Shader Forge (c) Neat Corporation / Joachim Holmer - http://www.acegikmo.com/shaderforge/
// Note: Manually altering this data may prevent you from opening it in Shader Forge
/*SF_DATA;ver:1.32;sub:START;pass:START;ps:flbk:,iptp:0,cusa:False,bamd:0,lico:1,lgpr:1,limd:0,spmd:1,trmd:0,grmd:0,uamb:True,mssp:True,bkdf:False,hqlp:False,rprd:False,enco:False,rmgx:True,rpth:0,vtps:0,hqsc:True,nrmq:1,nrsp:0,vomd:0,spxs:False,tesm:0,olmd:1,culm:0,bsrc:0,bdst:1,dpts:2,wrdp:True,dith:0,rfrpo:True,rfrpn:Refraction,coma:15,ufog:False,aust:True,igpj:False,qofs:0,qpre:1,rntp:1,fgom:False,fgoc:False,fgod:False,fgor:False,fgmd:0,fgcr:0.5,fgcg:0.5,fgcb:0.5,fgca:1,fgde:0.01,fgrn:0,fgrf:300,stcl:False,stva:128,stmr:255,stmw:255,stcp:6,stps:0,stfa:0,stfz:0,ofsf:0,ofsu:0,f2p0:False,fnsp:False,fnfb:False;n:type:ShaderForge.SFN_Final,id:3138,x:32719,y:32712,varname:node_3138,prsc:2|emission-47-OUT;n:type:ShaderForge.SFN_Color,id:7241,x:32204,y:32707,ptovrint:False,ptlb:Color,ptin:_Color,varname:node_7241,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,c1:1,c2:1,c3:1,c4:1;n:type:ShaderForge.SFN_Tex2d,id:7372,x:32204,y:32918,ptovrint:False,ptlb:MainTex,ptin:_MainTex,varname:node_7372,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,tex:630f164e44edb4d848a0fc4d010cfb42,ntxv:0,isnm:False|UVIN-7048-UVOUT;n:type:ShaderForge.SFN_ScreenPos,id:7048,x:31883,y:32949,varname:node_7048,prsc:2,sctp:2;n:type:ShaderForge.SFN_Multiply,id:47,x:32416,y:32806,varname:node_47,prsc:2|A-7241-RGB,B-7372-RGB;proporder:7241-7372;pass:END;sub:END;*/

Shader "Shader Forge/ScreenSpaceProjection" {
    Properties {
        _Color ("Color", Color) = (1,1,1,1)
        _MainTex ("MainTex", 2D) = "white" {}
    }
    SubShader {
        Tags {
            "RenderType"="Opaque"
        }
        Pass {
            Name "FORWARD"
            Tags {
                "LightMode"="ForwardBase"
            }
           
           
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag
            #define UNITY_PASS_FORWARDBASE
            #include "UnityCG.cginc"
            #pragma multi_compile_fwdbase_fullshadows
            #pragma only_renderers d3d9 d3d11 glcore gles
            #pragma target 3.0
            uniform float4 _Color;
            uniform sampler2D _MainTex; uniform float4 _MainTex_ST;
            struct VertexInput {
                float4 vertex : POSITION;
            };
            struct VertexOutput {
                float4 pos : SV_POSITION;
                float4 screenPos : TEXCOORD0;
            };
            VertexOutput vert (VertexInput v) {
                VertexOutput o = (VertexOutput)0;
                o.pos = mul(UNITY_MATRIX_MVP, v.vertex );
                o.screenPos = o.pos;
                return o;
            }
            float4 frag(VertexOutput i) : COLOR {
                #if UNITY_UV_STARTS_AT_TOP
                    float grabSign = -_ProjectionParams.x;
                #else
                    float grabSign = _ProjectionParams.x;
                #endif
                i.screenPos = float4( i.screenPos.xy / i.screenPos.w, 0, 0 );
                i.screenPos.y *= _ProjectionParams.x;
                float2 sceneUVs = float2(1,grabSign)*i.screenPos.xy*0.5+0.5;
////// Lighting:
////// Emissive:
                float4 _MainTex_var = tex2D(_MainTex,TRANSFORM_TEX(sceneUVs.rg, _MainTex));
                float3 emissive = (_Color.rgb*_MainTex_var.rgb);
                float3 finalColor = emissive;
                return fixed4(finalColor,1);
            }
            ENDCG
        }
    }
    FallBack "Diffuse"
    CustomEditor "ShaderForgeMaterialInspector"
}

That works great! I had been using the multiply shader with a few additions.

One ‘small’ problem, though. While using the multiply shader I was able to move and resize planes to ‘catch’ the various parts of the image. You can see that here:

however, with the one you provided I the preview screen does not show any planes, so it gets difficult trying to set things up:

I shall be examining the code to see what the difference is.

Thank you very much for the starting point, though. It is much appreciated!