a repository for recording different projection views (equirectangular, rectinlinear/gnomonic).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

26 lines
499 B

using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
[ExecuteInEditMode]
public class CubemapRender : MonoBehaviour
{
public RenderTexture cubeMap;
int faceMask = 63;
Camera cam;
void Start()
{
cam = GetComponent<Camera>();
}
void Update()
{
if (cubeMap != null)
{
// Render the scene to the cubemap
cam.RenderToCubemap(cubeMap, faceMask);
}
}
}