<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[Shooter Game Tutorial]]></provider_name><provider_url><![CDATA[http://shootertutorial.com]]></provider_url><author_name><![CDATA[andrzejkoloska]]></author_name><author_url><![CDATA[https://shootertutorial.com/author/andrzejkoloska/]]></author_url><title><![CDATA[UMG: How to create icons from 3d&nbsp;assets]]></title><type><![CDATA[link]]></type><html><![CDATA[<p><a href="https://shootertutorial.files.wordpress.com/2015/07/pistoliconscreen.jpg"><img class="alignnone wp-image-730 size-large" src="https://shootertutorial.files.wordpress.com/2015/07/pistoliconscreen.jpg?w=1024&#038;h=517" alt="Pistoliconscreen"   /></a></p>
<p>Working alone on a game is really hard sometimes. For example I&#8217;ve bought K-Spree GUI and I don&#8217;t have weapon icons for UI. I would like to show you guys how to use Unreal Engine 4 features to create icons from 3d meshes.</p>
<ul>
<li>Goal: Create weapon icons from 3d assets,</li>
<li>Have one level to configure everything to create icons,</li>
</ul>
<p>Let&#8217;s go!<!--more--></p>
<pre><strong>This Tutorial has been created using Unreal Engine 4.8.2</strong>. 
Make sure you are working on the same version of the engine.</pre>
<p><strong>Using Outline Postprocess Material</strong></p>
<p>As you can see in K-Spree gui the best way for weapons icons would be outline graphics. We could use Postprocess material to draw outline for our objects. Material can be found in Content Examples -&gt; Blueprint Communication -&gt; M_Hightlight.</p>
<p>You can read more about outlines <a href="http://www.tomlooman.com/ue4-outline-post-process/" target="_blank">here</a> and <a href="http://www.michalorzelek.com/blog/?p=260" target="_blank">here</a>. (btw great blogs! must read!) Here&#8217;s screenshot of the material. I&#8217;m using Line Render width: 5</p>
<p><a href="https://shootertutorial.files.wordpress.com/2015/07/outlinemat.jpg"><img class="alignnone size-medium wp-image-731" src="https://shootertutorial.files.wordpress.com/2015/07/outlinemat.jpg?w=300&#038;h=115" alt="outlinemat" width="300" height="115" /></a></p>
<ul>
<li>Material Domain need to be PostProcess,</li>
<li>Blendable Location need to be Before Translucency,</li>
</ul>
<hr />
<p><strong>Creating Level</strong></p>
<p>Create new blank level named WeaponIconMap. Insert Camera and change some variables:</p>
<ul>
<li>Location: (X=0.000910,Y=-0.000600,Z=218.031403)</li>
<li>Rotation: (Pitch=-90.000000,Yaw=0.000000,Roll=0.000032)</li>
<li>Projection Mode: Orthographics,</li>
<li>Ortho Width: 35</li>
<li>Constrain Aspect Ratio: false,</li>
<li>Post Process Settings -&gt; Bloom -&gt; Intesity: 100, Threshold: 0.1 (this values work for me but you can iterate what will be best for outline)</li>
<li>Post Process Settings -&gt; Auto Exposure -&gt; Min Brightness: 5, Max Brightness: 5 &#8211; try to iterate those values when you will have outline visible,</li>
<li>Post Process Settings -&gt; Misc -&gt; AA Method: FXAA -&gt; Screen Percentage: 200,</li>
<li>Post Process Settings -&gt; Add one blendable which will be outline material created earlier.</li>
</ul>
<p>Now insert mesh into the level. I&#8217;m using Pistol_A mesh as example.</p>
<ul>
<li>Location: (X=-3.461101,Y=-7.529733,Z=-0.000214)</li>
<li>Rotation: (Pitch=0.000000,Yaw=89.999489,Roll=-90.000000)</li>
<li><strong>Most important: Rendering -&gt; Render Custom Depth: True,</strong></li>
</ul>
<p>The clue is that camera should point the weapon.</p>
<p><a href="https://shootertutorial.files.wordpress.com/2015/07/camerapointingweapon.jpg"><img class="alignnone wp-image-733 size-full" src="https://shootertutorial.files.wordpress.com/2015/07/camerapointingweapon.jpg?w=675&#038;h=597" alt="camerapointingweapon" width="675" height="597" /></a></p>
<p>Go to Level Blueprint and on begin play change player camera.</p>
<p><a href="https://shootertutorial.files.wordpress.com/2015/07/changecamera.jpg"><img class="alignnone wp-image-732 size-full" src="https://shootertutorial.files.wordpress.com/2015/07/changecamera.jpg?w=565&#038;h=319" alt="changecamera" width="565" height="319" /></a></p>
<p>If you run the game you should see outline effect on your mesh. Tweak the values and as always &#8211; take your time to get best results!</p>
<hr />
<p><strong>Configuring Screenshot Taking</strong></p>
<p>Open Level Blueprint and add r.setres 512&#215;512 and HighResShot console commands to it.</p>
<p><a href="https://shootertutorial.files.wordpress.com/2015/07/takescreenshot.jpg"><img class="alignnone wp-image-734 size-large" src="https://shootertutorial.files.wordpress.com/2015/07/takescreenshot.jpg?w=1024&#038;h=254" alt="takescreenshot"   /></a></p>
<p>You should get notification that your screen is saved @ Game\Saved\Screenshots\Windows folder. I&#8217;m using 512&#215;512 texture because there is some issues with non square textures for UMG on Android.</p>
<p>Basically there is lot more you can do with screenshot feature. Please read <a href="https://docs.unrealengine.com/latest/INT/Engine/Basics/Screenshots/index.html" target="_blank">this</a> and <a href="https://docs.unrealengine.com/latest/INT/Engine/Content/Tools/RenderToTextureTools/Setup/index.html" target="_blank">this</a> documentation pages. Basically you could create blueprint to generate icons for all of your weapons.</p>
<hr />
<p><b>Importing icon to UMG.</b></p>
<p>Import your screen to Content Browser and create material from it.</p>
<p><a href="https://shootertutorial.files.wordpress.com/2015/07/pistoliconmaterial.jpg"><img class="alignnone wp-image-735 size-large" src="https://shootertutorial.files.wordpress.com/2015/07/pistoliconmaterial.jpg?w=1024&#038;h=547" alt="pistoliconmaterial"   /></a></p>
<p>Use Power Node to tweak opacity. If you have the Gimp/Photoshop skill you can create Alpha channel for this image. I don&#8217;t have so I&#8217;m hacking here.</p>
<hr />
<p><strong>Final Result</strong></p>
<p>That&#8217;s it. Add Image to UMG Widget and select material as brush.</p>
<p><a href="https://shootertutorial.files.wordpress.com/2015/07/finalexample.jpg"><img class="alignnone wp-image-737 size-large" src="https://shootertutorial.files.wordpress.com/2015/07/finalexample.jpg?w=1024&#038;h=568" alt="finalexample"   /></a></p>
<p>You can use this method for any 3d object!</p>
<blockquote><p>Creating ShooterTutorial takes a lot of my free time.<br />
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=8UXM3JZGDPPPE"><img src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" alt="Buy Now Button" /><br />
</a>If you want you can help me out! I will use your donation to buy better assets packs and you will be added to Credits /Backers page as well.</p>
<p>Implementing game is taking time but writing about it is taking much more effort!</p></blockquote>
]]></html><thumbnail_url><![CDATA[https://i0.wp.com/shootertutorial.files.wordpress.com/2015/07/finalexample.jpg?fit=440%2C330]]></thumbnail_url><thumbnail_height><![CDATA[244]]></thumbnail_height><thumbnail_width><![CDATA[440]]></thumbnail_width></oembed>