Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Cubemap from Texture

Discussion in 'Scripting' started by danielesuppo, Mar 30, 2018.

  1. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    Hello!
    I have a Texture, created by script.
    Now I should "convert" it to a Cubemap, for reflection purpose.
    I've searched a lot on the web but I can't find any good solution to do it.
    Does anybody know how to do that?
    Thank-you!
     
  2. Scabbage

    Scabbage

    Joined:
    Dec 11, 2014
    Posts:
    268
    What kind of texture? What's the purpose of it? When you say for reflection do you mean reflections of a skybox?
     
  3. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    Hi Scabbage, sorry for my lack of details.
    I'm using Vuforia, and I'd like to have the live video input as a (fake) reflection for my objects.
    So the Texture come from a WebCamTexture.
    I'd not like to use a "Camera.RenderToCubemap" since it's expensive (I'm on mobile), and I just need the background (the live video input), not all the scene, for my reflections.
    So I "simply" would like to "convert" my ready-made Texture (the live video input) into a cubemap, not for real reflections but just an illusion..
    Furthermore it would be nice if I could pass my Texture into a Cubemap as Spherical.
    Thank-you!
     
  4. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    Solved! GetPixels - SetPixels...
     
  5. brunzero

    brunzero

    Joined:
    Jul 10, 2015
    Posts:
    8
    do you mind clarifying your approach to solving the problem? how did you convert the webcam texture into a cubemap?