<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Infinity Code Forum — Texture vs Texture2D ?]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=1904</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1904&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Texture vs Texture2D ?.]]></description>
		<lastBuildDate>Tue, 18 Jan 2022 18:55:28 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Texture vs Texture2D ?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8030#p8030</link>
			<description><![CDATA[<p>Thanks a lot Alex !</p>]]></description>
			<author><![CDATA[null@example.com (philzmz)]]></author>
			<pubDate>Tue, 18 Jan 2022 18:55:28 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8030#p8030</guid>
		</item>
		<item>
			<title><![CDATA[Re: Texture vs Texture2D ?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8024#p8024</link>
			<description><![CDATA[<p>I see. <br />Ideally, you should ask the Playmaker developer to fix this, because there are so many uses of Texture2D in Unity API.<br />But it will most likely not be fast, so here is the action for you:<br /></p><div class="codebox"><pre><code>using InfinityCode.uPano;
using InfinityCode.uPano.Renderers;
using UnityEngine;

namespace HutongGames.PlayMaker.Actions.uPano
{
    [ActionCategory(uPanoCategories.PANORAMA)]
    [Tooltip(&quot;Set Cube Face Textures&quot;)]
    public class SetCubeFaceTextures : FsmPanoStateAction
    {
        [RequiredField]
        public FsmObject panorama;

        public FsmTexture topTexture;
        public FsmTexture frontTexture;
        public FsmTexture leftTexture;
        public FsmTexture backTexture;
        public FsmTexture rightTexture;
        public FsmTexture bottomTexture;

        public override void Reset()
        {
            panorama = null;
            topTexture = null;
            frontTexture = null;
            leftTexture = null;
            backTexture = null;
            rightTexture = null;
            bottomTexture = null;
        }

        public override void OnEnter()
        {
            DoEnter();
            Finish();
        }

        private void DoEnter()
        {
            if (panorama.IsNone)
            {
                Debug.LogError(&quot;Requires reference to a panorama or Pano Renderer&quot;);
                return;
            }

            Pano pano = GetPano(panorama);
            if (pano == null)
            {
                Debug.LogError(&quot;Panorama field should contain a reference to a panorama or Pano Renderer&quot;);
                return;
            }

            GameObject go = pano.gameObject;

            CubeFacesPanoRenderer pr = pano.panoRenderer as CubeFacesPanoRenderer;
            if (pr == null)
            {
                Debug.LogError(&quot;Requires CubeFacesPanoRenderer&quot;);
                return;
            }

            pr.textures = new[]
            {
                topTexture.Value as Texture2D,
                frontTexture.Value as Texture2D,
                leftTexture.Value as Texture2D,
                backTexture.Value as Texture2D,
                rightTexture.Value as Texture2D,
                bottomTexture.Value as Texture2D,
            };
        }
    }
}</code></pre></div><p>You cannot use Downloader for local files. It won&#039;t work.<br />The fact that your browser understands that these are local files and can open them means nothing, because the Unity API expects remote data.</p><p>6 x 8k x 8k textures will work more efficiently.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 17 Jan 2022 13:00:17 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8024#p8024</guid>
		</item>
		<item>
			<title><![CDATA[Re: Texture vs Texture2D ?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8022#p8022</link>
			<description><![CDATA[<p>Hello Alex thanks for your answer.</p><p>Yes, I know that I can create a cubefaces panorama with a PM action, but what I want to do is to set the faces of a panorama already in the scene. I made a short video to explain my concern and the workaround that I found.</p><p><a href="https://www.youtube.com/watch?v=1RJmTdjbaTs">https://www.youtube.com/watch?v=1RJmTdjbaTs</a></p><p>The array that is created is an object array, instead of a texture array, but if i change it it works. I don&#039;t know if this is abug or something normal.</p><p>And as you suggested I tried the - very interesting - downloader component, but I can&#039;t make it working, maybe I am wrong somewhere ? Please have a look to this 2nd video : <a href="https://www.youtube.com/watch?v=U6nRLsN1CrA">https://www.youtube.com/watch?v=U6nRLsN1CrA</a></p><p>I have a question : I use cubefaces as my panorama is 27k, over the 16k allowed by HugeTexture. Which is the more efficient, in terms of performance / weight ?</p><p>- to use 1 x 26624 RAW texture with HugeTexture with a spherical (which should be set if I understand to 26624x26624 pixels).<br />- or to use 6 x 8k x 8k textures with a cubeface panorama</p><p>It seems to me that the 2nd option should be better, but I need you to confirm.</p><p>Best regards, Phil</p>]]></description>
			<author><![CDATA[null@example.com (philzmz)]]></author>
			<pubDate>Mon, 17 Jan 2022 11:12:44 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8022#p8022</guid>
		</item>
		<item>
			<title><![CDATA[Re: Texture vs Texture2D ?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8018#p8018</link>
			<description><![CDATA[<p>Hello.</p><p>Unfortunately, I didn&#039;t understand your problem.<br />WWW Object returns you a Texture, and Create Cube Faces Pano also accepts Textures.<br />Also, if you have problems with Playmaker, you can use the Downloader component, which will download and set all sides of the panorama.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 14 Jan 2022 19:38:58 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8018#p8018</guid>
		</item>
		<item>
			<title><![CDATA[Texture vs Texture2D ?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8015#p8015</link>
			<description><![CDATA[<p>Hello<br />I&nbsp; download the 6 textures of a cube from the web using wwwobject action in playmaker. So I get a TextureArray with the 6 sides.<br />But I can&#039;t set the CubeFacesPanorenderer with this array, as it seems that it needs a 2D Texture array.<br />Any idea or workaround ? Or maybe use regular textures, as the sphericalpanorendrer does ?<br />Best regards<br />Phil</p>]]></description>
			<author><![CDATA[null@example.com (philzmz)]]></author>
			<pubDate>Fri, 14 Jan 2022 16:12:50 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8015#p8015</guid>
		</item>
	</channel>
</rss>
