Search Unity

Sector of a Circle

Discussion in 'Shaders' started by LionWare, Nov 11, 2020.

  1. LionWare

    LionWare

    Joined:
    Jan 7, 2015
    Posts:
    9
    I want to render only a specific part of a sphere which would be given by it's azimuth and elevation angles (spherical coordinate system) and the texture would be mapped on to that part of the sphere. These Coordinates would then be changeable in runtime but I have no idea of how to go by it. I know the mathematics but have zero experience in writing shaders. Any help in this regard would be appreciated.
    Thanks.
     
  2. unityuserunity85496

    unityuserunity85496

    Joined:
    Jan 9, 2019
    Posts:
    89
    If you can make a texture in the shader in Object coordinates you can set up where the gradient will display from your calculations. In shaders you are effectively making black greyscale gradient textures as masks. You then multiply colors into them.

    Start here Cg Programming/Unity - Wikibooks, open books for an open world