Search Unity

texture question

Discussion in 'Scripting' started by Dazzid, Jul 13, 2015.

  1. Dazzid

    Dazzid

    Joined:
    Apr 15, 2014
    Posts:
    61
    Hi All,
    I have some difficulties trying to fix a texture that disappear when I rotate the 3D model. I'm testing with Standard Shader but I can't find the solution. If you look the model, half of the texture disappear with the rotation

    Here some picture:
     
  2. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
    is that a brain? :)

    is the texture one single thing or is it made up from several parts?
     
  3. Dazzid

    Dazzid

    Joined:
    Apr 15, 2014
    Posts:
    61
    It has mainly two independent meshes (left and right)
    I see that my problem is the shader in my background cube, but don't find the correct one. The idea is to have a background that give a sense of a space. Someone have a suggestion?
    Thanks
     
    Last edited: Jul 13, 2015
  4. Dazzid

    Dazzid

    Joined:
    Apr 15, 2014
    Posts:
    61
    can someone help me on this one?
    Code (CSharp):
    1.  
    2. Shader"SimpleGlass" {
    3. Properties {
    4. _Color ("MainColor", Color) = (1,1,1,1)
    5. _SpecColor ("SpecColor", Color) = (1,1,1,1)
    6. _Emission ("EmmisiveColor", Color) = (1,1,0,0)
    7. _Shininess ("Shininess", Range (0.01, 1)) = 0.21
    8. _MainTex ("Base", 2D) = "white" { }
    9.  }
    10.  
    11. SubShader {
    12. //Weusethematerialinmanypassesbydefiningtheminthesubshader.
    13. //Anythingdefinedherebecomesdefaultvaluesforallcontainedpasses.
    14. Material {
    15. Diffuse [_Color]
    16. Ambient [_Color]
    17. Shininess [_Shininess]
    18. Specular [_SpecColor]
    19. Emission [_Emission]
    20.  }
    21. LightingOn
    22. SeparateSpecularOn
    23.  
    24. //Setupalphablending
    25.  
    26.  
    27. //Renderthebackfacingpartsoftheobject.
    28. //Iftheobjectisconvex, thesewillalwaysbefurtheraway
    29. //thanthefront-faces.
    30. Pass {
    31. BlendSrcAlphaOneMinusSrcAlpha
    32. Material {
    33. Diffuse (0.1,0.1,0.1,1)
    34.  }
    35. CullFront
    36. SetTexture [_MainTex] {
    37. CombinePrimary * Texture
    38.  }
    39.  
    40.  }
    41. //Renderthepartsoftheobjectfacingus.
    42. //Iftheobjectisconvex, thesewillbecloserthanthe
    43. //back-faces.
    44. Pass {
    45. CullBack
    46. BlendOneOne
    47. SetTexture [_MainTex] {
    48. CombinePrimary * Texture
    49.  }
    50.  }
    51.  }
    52. }
    53. }
    I'm trying with a simple shader but I can't find the solution yet