<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.unity3d.com/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.unity3d.com/index.php?title=TextureFromCamera&amp;feed=atom&amp;action=history</id>
		<title>TextureFromCamera - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.unity3d.com/index.php?title=TextureFromCamera&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php?title=TextureFromCamera&amp;action=history"/>
		<updated>2013-05-24T22:23:16Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.1</generator>

	<entry>
		<id>http://wiki.unity3d.com/index.php?title=TextureFromCamera&amp;diff=16193&amp;oldid=prev</id>
		<title>Bunny83: Added some categories</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php?title=TextureFromCamera&amp;diff=16193&amp;oldid=prev"/>
				<updated>2013-01-20T00:06:08Z</updated>
		
		<summary type="html">&lt;p&gt;Added some categories&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 00:06, 20 January 2013&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 57:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 57:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;}&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;}&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Category:C Sharp]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Scripts]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Utility]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Texture]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Category:MonoBehaviour]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Bunny83</name></author>	</entry>

	<entry>
		<id>http://wiki.unity3d.com/index.php?title=TextureFromCamera&amp;diff=14023&amp;oldid=prev</id>
		<title>Matt maker: remove a site-specific line</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php?title=TextureFromCamera&amp;diff=14023&amp;oldid=prev"/>
				<updated>2012-02-15T01:07:37Z</updated>
		
		<summary type="html">&lt;p&gt;remove a site-specific line&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 01:07, 15 February 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 30:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 30:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  void Reset() {&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  void Reset() {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; if (!cam) cam = &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Kaleidoscope&lt;/del&gt;.&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;getCamera()&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; if (!cam) cam = &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Camera&lt;/ins&gt;.&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;main&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; if (!target) target = transform;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; if (!target) target = transform;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  }&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;  }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Matt maker</name></author>	</entry>

	<entry>
		<id>http://wiki.unity3d.com/index.php?title=TextureFromCamera&amp;diff=14022&amp;oldid=prev</id>
		<title>Matt maker: new script for easy rendering of a camera to a texture</title>
		<link rel="alternate" type="text/html" href="http://wiki.unity3d.com/index.php?title=TextureFromCamera&amp;diff=14022&amp;oldid=prev"/>
				<updated>2012-02-15T01:05:59Z</updated>
		
		<summary type="html">&lt;p&gt;new script for easy rendering of a camera to a texture&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
Replaces the given target texture (usually our own) with a texture to be rendered by the given camera.&lt;br /&gt;
&lt;br /&gt;
by Matt &amp;quot;Trip&amp;quot; Maker, Monstrous Company :: http://monstro.us&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Attach it to the GameObject upon which you wish to see the camera's view as a texture, or attach it anywhere else you like, if you specify the source and destination targets.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
using UnityEngine;&lt;br /&gt;
using System.Collections;&lt;br /&gt;
&lt;br /&gt;
/// &amp;lt;summary&amp;gt;&lt;br /&gt;
/// Replace the given texture (usually our own) with a texture to be rendered by the given camera.&lt;br /&gt;
/// You may supply a renderTexture to use, or one will be ceated.&lt;br /&gt;
///&lt;br /&gt;
/// by Matt &amp;quot;Trip&amp;quot; Maker, Monstrous Company :: http://monstro.us&lt;br /&gt;
///&lt;br /&gt;
/// &amp;lt;/summary&amp;gt;&lt;br /&gt;
public class TextureFromCamera : MonoBehaviour {&lt;br /&gt;
&lt;br /&gt;
     public Camera cam;&lt;br /&gt;
     public Transform target;&lt;br /&gt;
     public RenderTexture renderTexture;&lt;br /&gt;
     public Vector2 textureSize = new Vector2(512,512);&lt;br /&gt;
     public int depth = 16;&lt;br /&gt;
    &lt;br /&gt;
     void Reset() {&lt;br /&gt;
          if (!cam) cam = Kaleidoscope.getCamera();&lt;br /&gt;
          if (!target) target = transform;&lt;br /&gt;
     }&lt;br /&gt;
&lt;br /&gt;
     void Awake() {&lt;br /&gt;
          Reset();&lt;br /&gt;
     }&lt;br /&gt;
    &lt;br /&gt;
     void Start () {&lt;br /&gt;
          if ((depth != 0) &amp;amp;&amp;amp; (depth != 16) &amp;amp;&amp;amp; (depth != 24)) {&lt;br /&gt;
               //Debug.LogError(this + &amp;quot; depth must be one of 0, 16, 24&amp;quot;);&lt;br /&gt;
          }&lt;br /&gt;
          if (!renderTexture) {&lt;br /&gt;
               renderTexture = new RenderTexture((int)textureSize.x, (int)textureSize.y, depth);//depth must be one of 0, 16, 24&lt;br /&gt;
               renderTexture.name = &amp;quot;TextureFromCamera_&amp;quot; + cam.name; //optional, but nice&lt;br /&gt;
               renderTexture.Create();&lt;br /&gt;
               //Debug.Log(renderTexture.depth + &amp;quot; width &amp;quot; + renderTexture.width + &amp;quot; height &amp;quot; + renderTexture.height);&lt;br /&gt;
          }&lt;br /&gt;
          cam.targetTexture = renderTexture;&lt;br /&gt;
          target.renderer.material.mainTexture = renderTexture;&lt;br /&gt;
     }&lt;br /&gt;
    &lt;br /&gt;
     void OnDisable() {&lt;br /&gt;
          renderTexture.DiscardContents();    &lt;br /&gt;
          renderTexture.Release();    &lt;br /&gt;
     }&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Matt maker</name></author>	</entry>

	</feed>