Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
5
Question by Jarrod_Walker · Oct 14, 2011 at 05:38 AM · texturematerialsphere

Material/Texture on the Inside of a Sphere

I was wondering if you can put a material of texture on the inside of a sphere.

I am asking this because I am making a game and a spaceship is floating in space, and eventually you are forced off the ship and to fall on to a planet you are in orbit of.

Thank you for any help you can provide.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image save · Oct 14, 2011 at 10:42 AM 0
Share

Just assu$$anonymous$$g the texture is for the planet, how come you need to render the inside of the sphere? Or is it a nifty-awesome-sphere spaceship?

5 Replies

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by syclamoth · Oct 14, 2011 at 06:21 AM

You can only put materials on one side of any given object, unless you are using shaders which specifically render backfaces. Because of backface culling being one of the simplest and fastest graphics optimisations, it is always assumed that you will be viewing meshes from one side only!

For what you want to do here, I would have two spheres- one with the normals pointing out, and one with the normals pointing in. You'll have to use some external application to make the 'inside-out' one, because Unity does not normally provide that kind.

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Jarrod_Walker · Oct 14, 2011 at 09:28 AM 0
Share

Thanks for you help.

What application would you recommend?

avatar image save · Oct 14, 2011 at 10:40 AM 0
Share

Have a look at Blender.

avatar image Jarrod_Walker · Oct 14, 2011 at 11:36 PM 0
Share

Thank for the help

avatar image
9

Answer by guywhosignedup · Mar 04, 2015 at 04:39 PM

This shader allows one to set a texture on the inside of a sphere:

 Shader "Flip Normals" {
          Properties {
             _MainTex ("Base (RGB)", 2D) = "white" {}
         }
          SubShader {
            
            Tags { "RenderType" = "Opaque" }
            
            Cull Front
            
            CGPROGRAM
            
            #pragma surface surf Lambert vertex:vert
            sampler2D _MainTex;
     
             struct Input {
                 float2 uv_MainTex;
                 float4 color : COLOR;
             };
            
            
            void vert(inout appdata_full v)
            {
                v.normal.xyz = v.normal * -1;
            }
            
            void surf (Input IN, inout SurfaceOutput o) {
                      fixed3 result = tex2D(_MainTex, IN.uv_MainTex);
                 o.Albedo = result.rgb;
                 o.Alpha = 1;
            }
            
            ENDCG
            
          }
          
          Fallback "Diffuse"
     }
 


Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
8

Answer by ddikman · Jun 20, 2013 at 03:10 PM

Or, you could just build a simple texture-shader and use Cull Front or Cull Off instead of Cull Back to display either both sides or just the backside. If you need lighting you´ll need to reverse the normals aswell, below is an example of a simple diffuse shader doing this to create a "inside-out"-colored box:

 Shader "Show Insides" {
     SubShader {
       
       Tags { "RenderType" = "Opaque" }
       
       Cull Front
       
       CGPROGRAM
       
       #pragma surface surf Lambert vertex:vert
       
       void vert(inout appdata_full v)
       {
           v.normal.xyz = v.normal * -1;
       }
       
       struct Input {
           float4 color : COLOR;
       };
       
       void surf (Input IN, inout SurfaceOutput o) {
           o.Albedo = 1;
       }
       
       ENDCG
       
     }
     
     Fallback "Diffuse"
     
   }
Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image neuman · Aug 22, 2014 at 09:44 PM 0
Share

The shader above is working for me, but I can't seem to get it to display a texture on the inside. Is there some modification to the code needed?

avatar image robertbu · Aug 22, 2014 at 09:47 PM 0
Share

Change line 6 to 'Cull Off'

avatar image
0

Answer by arunks123 · Sep 13, 2017 at 10:12 AM

how can i apply "unlit texture" property in this shader...?? "unlit-texture" property is very helpful for making 360 photo gallery etc.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by HunterNacho338 · May 27, 2018 at 02:03 PM

That shader really does work thank you.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

DAY and NIGHT Texture on Planet Earth 0 Answers

There is an issue with texture wrapping around sphere's in unity 0 Answers

Cutout Material is not showing texture transparency? 0 Answers

Best option to change texture/material.. 0 Answers

Get the material to show the texture inversed 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges