Filpping movie inside sphere

Hello

After some searching and tweaking I finally managed to project movie inside sphere. The problem left to resolve is: how to flip it so I don’t see mirror image while camera (fpc) is inside? I would be grateful for help.
If you need some more info please let me know.
I’m a simple sound designer so my knowledge about scripting is minimal, please be forgiving :wink:
Thanks a lot!
ZJ

Ummm, lets start with you describing what it is you’re even talking about.

movie? What movie, are you talking about a RenderTexture?

sphere? What sphere? Are you talking about a sphere shaped mesh on which you have attached a RenderTexture?

mirror image? Describe what you mean by mirrored image, what is it supposed to look like, assume none of us have ever attempted doing whatever you’re doing with movie/sphere (whatever that might be).

fpc? I have no idea what your random acronym means. First Person Camera? What relevance is it?

Thanks for such a quick replay and sorry for not being precise:

  1. it’s a 360 movie as a texture
  2. Yes, sphere on which texture is rendered
  3. I’m trying to test 3d audio in VR. So I render movie on the sphere…but of course to have a possibility to look around and watch 360 film camera must be inside. But when you inside the sphere the image you see is flipped.
    I hope it helped to a bit to understand the situation :slight_smile:
    Cheers!

Well that’s probably because the sphere mesh has its UV order set to be visible from the outside.

Either the UVs on the mesh have to be flipped. Or they have to be flipped in the shader.

How did you get it visible on the inside? Did you create a custom sphere mesh? Are you using a double sided shader? What shader are you using for that matter? Does the shader have the tiling rect defined (should be 4 values, x,y,x,y set to 1,1,0,0 by default probably), if so try negating the values to -1, play with them see what happens.

It is custom shader with cull off function, so I guess only inside is visible.
Here it is:

Shader "Custom/filmshader" {
    Properties {
        _Color ("Color", Color) = (1,1,1,1)
        _MainTex ("Albedo (RGB)", 2D) = "white" {}
        _Glossiness ("Smoothness", Range(0,1)) = 0.5
        _Metallic ("Metallic", Range(0,1)) = 0.0
    }
    SubShader {
        Tags { "RenderType"="Opaque" }
        LOD 200
        cull off
       
       
       
        CGPROGRAM
        // Physically based Standard lighting model, and enable shadows on all light types
        #pragma surface surf Standard fullforwardshadows

        // Use shader model 3.0 target, to get nicer looking lighting
        #pragma target 3.0

        sampler2D _MainTex;

        struct Input {
            float2 uv_MainTex;
        };

        half _Glossiness;
        half _Metallic;
        fixed4 _Color;

        void surf (Input IN, inout SurfaceOutputStandard o) {
            // Albedo comes from a texture tinted by color
            fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
            o.Albedo = c.rgb;
            // Metallic and smoothness come from slider variables
            o.Metallic = _Metallic;
            o.Smoothness = _Glossiness;
            o.Alpha = c.a;
        }
        ENDCG
    }
    FallBack "Diffuse"
}

Changing the tiling value (to -1) in shader inspector completely distorts the image.

Yeah, you should be fine.
In the material for the shader when attached to your sphere, if you open the ‘Albedo’ section, you’ll see a ‘Tiling/Offset’ section.

If it’s mirrored on the X, set it to -1 for the Tiling X, and 1 for the Offset X.
If it’s mirrored on the Y, set it to -1 for the Tiling Y, and 1 for the Offset Y.

What we’re doing is saying start at the offset of 1, or the far end of the image (the right), and the tiling of -1 is saying from that position, pull the values from there in the negative direction for the entire length of it.

Great! It solved it. Thanks a lot lordofduct!