I’m trying to use a 360° video, I place it on an inverted sphere and put my camera inside.
The problem is that I can’t achieve to make it look nice. There’s always some deformations on the image. Meanwhile, I followed many tutorials, but the issue always stays.
I achieved to solve it on images, by transforming them into Cubemap, but it doesn’t help much for a video…
If someone gets an answer, or already did something like that, please let me know your method !
Isn’t the FOV the same for images and videos ? I put it in both photo and video spheres, but only video ones won’t work.
About the camera center, I’m sure it’s ok for it.
Edit : I just checked my FOV, and even if it didn’t change my problem, it was indeed fewer than 90… Now it feels quite better looking in my game, thanks for it.
To describe better the defformation I get, it looks kind of “sick” when applied to a sphere. You can see it here :
It’s more present at the top and botton, but also a bit in the middle of the sphere.
Oh my… It looks like that’s the point. I’m trying to solve it, but when I create a sphere from blender and put a material inside it just turns gray or black…
By now, I just used this script for making my spheres. Maybe it’s possible to give it more faces ?
using UnityEngine;
using UnityEditor;
public class InvertedSphere : EditorWindow
{
private string st = "1.0";
[MenuItem("GameObject/Create Other/Inverted Sphere...")]
public static void ShowWindow()
{
EditorWindow.GetWindow(typeof(InvertedSphere));
}
public void OnGUI()
{
GUILayout.Label("Enter sphere size:");
st = GUILayout.TextField(st);
float f;
if (!float.TryParse(st, out f))
f = 1.0f;
if (GUILayout.Button("Create Inverted Sphere"))
{
CreateInvertedSphere(f);
}
}
private void CreateInvertedSphere(float size)
{
GameObject go = GameObject.CreatePrimitive(PrimitiveType.Sphere);
MeshFilter mf = go.GetComponent<MeshFilter>();
Mesh mesh = mf.sharedMesh;
GameObject goNew = new GameObject();
goNew.name = "Inverted Sphere";
MeshFilter mfNew = goNew.AddComponent<MeshFilter>();
mfNew.sharedMesh = new Mesh();
//Scale the vertices;
Vector3[] vertices = mesh.vertices;
for (int i = 0; i < vertices.Length; i++)
vertices[i] = vertices[i] * size;
mfNew.sharedMesh.vertices = vertices;
// Reverse the triangles
int[] triangles = mesh.triangles;
for (int i = 0; i < triangles.Length; i += 3)
{
int t = triangles[i];
triangles[i] = triangles[i + 2];
triangles[i + 2] = t;
}
mfNew.sharedMesh.triangles = triangles;
// Reverse the normals;
Vector3[] normals = mesh.normals;
for (int i = 0; i < normals.Length; i++)
normals[i] = -normals[i];
mfNew.sharedMesh.normals = normals;
mfNew.sharedMesh.uv = mesh.uv;
mfNew.sharedMesh.uv2 = mesh.uv2;
mfNew.sharedMesh.RecalculateBounds();
// Add the same material that the original sphere used
MeshRenderer mr = goNew.AddComponent<MeshRenderer>();
mr.sharedMaterial = go.GetComponent<Renderer>().sharedMaterial;
DestroyImmediate(go);
}
}
Just finished the UV mapping… It looks like it works, thanks a lot.
I just realize that I made so much complicated manipulations for photos, converting then to cubemaps and applying it to spheres and skybox… Well, now I just wonder if I should let these cubemaps or replace every photo sphere by my new one with a classical texture. I think more detailed objects will just slow down my project, but I would like to hear some confirmation about it.