<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.frictionalgames.com/page?action=history&amp;feed=atom&amp;title=Hpl3%3AGame%3Ascripting%3Acamera_textures</id>
	<title>Hpl3:Game:scripting:camera textures - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.frictionalgames.com/page?action=history&amp;feed=atom&amp;title=Hpl3%3AGame%3Ascripting%3Acamera_textures"/>
	<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=Hpl3:Game:scripting:camera_textures&amp;action=history"/>
	<updated>2026-05-15T09:42:03Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=Hpl3:Game:scripting:camera_textures&amp;diff=563&amp;oldid=prev</id>
		<title>Maintenance script: Upload from wiki</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=Hpl3:Game:scripting:camera_textures&amp;diff=563&amp;oldid=prev"/>
		<updated>2020-07-09T13:43:52Z</updated>

		<summary type="html">&lt;p&gt;Upload from wiki&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Camera Textures =&lt;br /&gt;
&lt;br /&gt;
It's possible to render a texture captured from an in-game camera to use on a GUI texture - for example, for showing images on security monitors etc.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
First of all you create a camera texture and give it a name. '''For best results the size (avSize below) should match the size of the texture you want to draw on-screen.''' Method:&lt;br /&gt;
&lt;br /&gt;
''void Gui_CreateCameraTexture(tString asName, cVector2l avSize, uint alFrameRate, float afFOV, float afNearPlane, float afFarPlane);''&lt;br /&gt;
&lt;br /&gt;
and then attach the camera texture to a particular entity. This entity's position and rotation will be the viewpoint the camera is rendered from. '''Don't point this towards the terminal showing the image!''' Method:&lt;br /&gt;
&lt;br /&gt;
''void Gui_AttachCameraTextureToEntity(tString asName, tString asEntity);''&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;file&amp;gt;&lt;br /&gt;
Gui_CreateCameraTexture(&amp;quot;DunbatCamera&amp;quot;, cVector2l(768, 613), 10, 60.0f, 0.1, 10);&lt;br /&gt;
Gui_AttachCameraTextureToEntity(&amp;quot;DunbatCamera&amp;quot;, &amp;quot;DunbatCameraArea&amp;quot;);&lt;br /&gt;
&amp;lt;/file&amp;gt;&lt;br /&gt;
== Rendering ==&lt;br /&gt;
&lt;br /&gt;
In your OnGui function, you just render (as if it were any kind of texture) an image texture with the same name as the camera texture and the argument eImGuiGfx_Special.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;file&amp;gt;&lt;br /&gt;
cImGuiGfx gfx(&amp;quot;DunbatCamera&amp;quot;, eImGuiGfx_Special);&lt;br /&gt;
ImGui_DrawGfx(gfx, cVector3f(0,0,5.0f), ImGui_GetSize(), cColor(1, 1));&lt;br /&gt;
&amp;lt;/file&amp;gt;&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
		
	</entry>
</feed>