projection test for gallery space w/ chair using squeezed & gnomic projection.
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.

45 lines
1.0 KiB

11 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using Unity.VisualScripting;
using UnityEngine;
[ExecuteInEditMode]
public class CubemapRender : MonoBehaviour
{
public RenderTexture cubeMap4K;
public RenderTexture cubeMap1K;
public Material mat;
[Header("4K Rendering")]
public bool m_4k = false;
int faceMask = 63;
Camera cam;
void Start()
{
cam = GetComponent<Camera>();
}
void Update()
{
9 months ago
if(this.isActiveAndEnabled)
11 months ago
{
9 months ago
if (cubeMap1K != null && cubeMap4K != null)
11 months ago
{
9 months ago
// Render the scene to the cubemap
if (m_4k && Application.isPlaying)
{
cam.RenderToCubemap(cubeMap4K, faceMask);
mat.SetTexture("_MainTex", cubeMap4K);
}
else
{
mat.SetTexture("_MainTex", cubeMap1K);
cam.RenderToCubemap(cubeMap1K, faceMask);
}
11 months ago
}
}
}
}