tag:blogger.com,1999:blog-19791767493145725412024-03-13T05:17:30.509-04:00Yet another blog...Programming bits & a brain dump.R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.comBlogger57125tag:blogger.com,1999:blog-1979176749314572541.post-72018444280286488392019-12-04T14:18:00.002-05:002020-01-22T11:21:33.972-05:00Laser EyesGot <a href="https://en.wikipedia.org/wiki/LASIK">LASIK</a>!<br />
<iframe allowfullscreen="" class="giphy-embed" frameborder="0" height="201" src="https://giphy.com/embed/JDk54SQrwb96w" width="480"></iframe><br />
<a href="https://giphy.com/gifs/horror-ouch-final-destination-5-JDk54SQrwb96w">via GIPHY</a><br />
<br />
3 weeks ago yesterday. I'd say I'm at 95%. I could never see 100% with each eye, and I see as well as with my prescription.<br />
<br />
<b>Are you a candidate? - Screening</b><br />
Got like 2 or 3 tests, took about 30 min. Good candidate apparently. After that got a quote and set possible dates. Mulled over it for like a month and finally caved in. Scheduled a Pre-op.<br />
<br />
<b>Pre-op</b><br />
~2 hours total of more tests and measurements. Eyes dilated, more tests. After all that I still asked if I was a good candidate and got assured I was. Dice was rolled ;) Same day I picked up drops (antibiotic and steroid). The paperwork describing all the things that could wrong <b>almost</b> put me off it, but decided to brave it.<br />
<br />
<b>Surgery</b><br />
Arrived at 7:30am, took one relaxant pill. At 8am got into the surgery room, two machines (two lasers). Got one of the<br />
<br />
<iframe allowfullscreen="" class="giphy-embed" frameborder="0" height="310" src="https://giphy.com/embed/uVOTxMagGsgXS" width="480"></iframe><br />
<a href="https://giphy.com/gifs/a-clockwork-orange-eyes-uVOTxMagGsgXS">via GIPHY</a><br />
<br />
clamps set up, that was the most uncomfortable part of it and I barely felt it. That took maybe 20 secs to put them in. Then sat in one of the machines, dr/nurse will add eye drops for lubrication.<br />
<br />
Laser #1: Look at a green dot. Don't move your eye for 18 seconds. Dot looks blurry/blob, Dr assures it's normal and is talking all the time, reassuring what you are seeing and explaining it. Next eye. You can see some little brush the Dr does to your eyes. At that point you see <b>very</b> blurry. Stand up and move to next machine.<br />
<br />
Laser #2: Don't move your eye for 6 seconds. New light. Some eye drops, next eye. Done!<br />
<br />
Stand up and leave. You can see in focus w/o glasses, just very "milky" like if you were looking through a white filter. Use sunglasses and go home :)<br />
<br />
<b>Eye drops</b><br />
Start with drops an hour after surgery. Antibiotic drops are 4x/day for 7 days or until bottle runs out. Mine ran out end of 5th day.<br />
Steroid drops are: 3 days each hour (steroid) you're awake. Then 4x/day for 4 days. Then 2x/day for 7 days. And finally 1x/day for 7 days.<br />
You also can get some tears/lubricant extra, though they recommend not using them the first day. I didn't have to myself that day. Probably have used them 4 times in 3 weeks.<br />
<br />
<b>Eye care (First week)</b><br />
The first week is the most important one. You can't get water/dust/etc on your eyes, nor scratch/rub/touch them. They give you a flexible eye guard to sleep so you don't rub them while asleep. Very uncomfortable in that you build some crust/byproducts from the eye drops and you can't take it off. I used a tissue and just tried to not touch the eye, only the eyelid/bony part of the nose. Got some tight goggles for showering. After the first week Dr. cleared me off water/eye guard.<br />
<br />
<b>Post-op visit</b><br />
One 24-hours after surgery, next 7 days after that. My next one is a month after last one.<br />
<br />
<b>Actual vision</b><br />
Vision as good as with glasses.<b> </b>Some days the first week were a bit off on one of the eyes, but got better after a few minutes: no "OMG what have I done" moments. I saw halos around lights for a while, seems to be diminishing over time. Car headlights/lights at night do seem brighter than usual, as if they had the high-beams on. Dr. mentioned this should improve over time.<br />
<br />
All in all, worth the ordeal for me. Laser eyes FTW!<br />
<iframe allowfullscreen="" class="giphy-embed" frameborder="0" height="480" src="https://giphy.com/embed/JRrsVhXZYx6g4MVbJx" width="480"></iframe><br />
<a href="https://giphy.com/gifs/TheBoysTV-the-boys-theboys-theboystv-JRrsVhXZYx6g4MVbJx">via GIPHY</a><br />
<br />
<br />
<br />R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com0tag:blogger.com,1999:blog-1979176749314572541.post-24313855422147231652018-01-13T17:02:00.000-05:002018-01-13T17:02:20.399-05:00Adding Global shaders to UE4 v2.0<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(Updated post for 4.18 and above!)</span><br />
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br /></span>
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Intro</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">In Unreal Engine 4, global shaders are shaders that can be used from the C++ side to render post-processing effects, dispatch compute shaders, clear the screen, etc. (i.e., shaders that don’t operate on a material or a mesh). On occasion, more advanced functionality is necessary to achieve a desired look, and a custom shader pass is required. Doing this is relatively simple, as I will explain here.</span></div>
<span id="docs-internal-guid-b265d80c-f83c-f299-0b9f-4ff03e87492b" style="font-weight: normal;"><br /></span>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">USF Files</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">UE4 reads .usf (Unreal Shader Files) off the Engine/Shaders/Private folder. Any new shaders need their source files placed here, or if working on a plugin, <i>PluginName</i>/Shaders/Private).</span></div>
<span style="font-weight: normal;"><br /></span>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Tip</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">I’d recommend enabling </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">r.ShaderDevelopmentMode=1</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> in your </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">ConsoleVariables.ini</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> file for ease of development! Check out </span><a href="https://docs.unrealengine.com/latest/INT/Programming/Rendering/ShaderDevelopment/" style="text-decoration-line: none;"><span style="color: #1155cc; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; text-decoration-line: underline; vertical-align: baseline; white-space: pre-wrap;">the documentation</span></a><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> for more information!</span></div>
<span style="font-weight: normal;"><br /></span>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">How-to</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Let’s start by adding a new .usf file in your Engine/Shaders/Private folder; let’s call it </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">MyTest.usf</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> and add a simple pass-through Vertex Shader, and a Pixel Shader that returns a custom color:</span></div>
<span style="font-weight: normal;"><br /></span>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">// MyTest.usf</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">// Simple pass-through vertex shader</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">void</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> MainVS(</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">in </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">float4</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> InPosition : ATTRIBUTE0,</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">out</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">float4</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Output</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> : SV_POSITION</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Output</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> = InPosition;</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">}</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">// Simple solid color pixel shader</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">float4</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> MyColor;</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">float4</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> MainPS() : SV_Target0</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> MyColor;</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
<span style="font-weight: normal;"><br /></span>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Now, in order to get UE4 to pick up the shader and start compiling it, we need to declare a C++ class; let’s start with the Vertex Shader:</span></div>
<span style="font-weight: normal;"><br /></span>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">// This can go on a header or cpp file</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">class</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> FMyTestVS : </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">public</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FGlobalShader</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">DECLARE_EXPORTED_SHADER_TYPE</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(FMyTestVS, </span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Global</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">/*MYMODULE_API*/</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FMyTestVS() { }</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FMyTestVS(</span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">const</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">ShaderMetaType</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">::</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">CompiledShaderInitializerType</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">& </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Initializer</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">: </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FGlobalShader</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Initializer</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">}</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">static</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">bool</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">ShouldCache</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">EShaderPlatform</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Platform</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">true</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">}</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br /></span><br />
<span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">static</span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">bool</span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="color: #880000; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">ShouldCompilePermutation</span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">(</span></span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">const</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FGlobalShaderPermutationParameters&</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Parameters</span><span style="background-color: white; font-family: consolas; font-size: 9pt; font-weight: 700; white-space: pre-wrap;">)</span><br />
<span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: green; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">// Useful when adding a permutation of a particular shader</span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">true</span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">}</span></span></span><br />
<span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">};</span></div>
<span style="font-weight: normal;"><br /></span>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">There are a few requirements here: </span></div>
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="font-family: arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">This is a subclass of </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">FGlobalShader</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">. As such, it will end up in the Global Shader Map, (which means we don’t need a material to find it).</span></div>
</li>
<li dir="ltr" style="font-family: arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Usage of the </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">DECLARE_EXPORTED_SHADER_TYPE</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">() macro will generate the exports required for serialization of the shader type, etc. The third parameter is a type for external linkage for the code module where the shader module will live, if required (e.g. the C++ code doesn’t live in the Renderer module).</span></div>
</li>
<li dir="ltr" style="font-family: arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Two constructors, both the default and the serialization.</span></div>
</li>
<li dir="ltr" style="font-family: arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">The </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">ShouldCache</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">() function, needed to decide if this shader should be compiled under certain circumstances (e.g. we might not want to compile a compute shader on a non-compute shader capable RHI).</span></div>
</li>
<li dir="ltr" style="font-family: arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline;"><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">The <i>ShouldCompilePermutation()</i> function, needed when a permutation of a global shader is required. This is a slightly more advanced topic outside the scope of this post.</span></li>
</ol>
<span style="font-weight: normal;"><br /></span>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">With the class declared, we can now register the Shader Type to UE4’s list:</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">// This needs to go on a cpp file</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<pre style="background: white; font-family: Consolas; font-size: 13px;"><span style="color: #6f008a;">IMPLEMENT_SHADER_TYPE</span>(, <span style="color: #216f85;">FMyTestVS</span>, <span style="color: #6f008a;">TEXT</span>(<span style="color: #a31515;">"/Engine/Private/MyTest.usf"</span>), <span style="color: #6f008a;">TEXT</span>(<span style="color: #a31515;">"MainVS"</span>), <span style="color: #6f008a;">SF_Vertex</span>);
</pre>
</div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">This macro maps the type (</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">FMyTestVS</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">) to the .usf file (<i>/Engine/Private/</i></span><span style="color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">MyTest.usf</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">), the shader entry point (</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">MainVS</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">) and the frequency/shader stage (</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">SF_Vertex</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">). It also causes the shader to be added to the compilation list as long as its </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">ShouldCache() </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">and </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">ShouldCompilePermutation()</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> methods both returns true.</span></div>
<span style="font-weight: normal;"><br /></span>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Note</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">: Whichever module you add your FGlobalShader to has to be loaded before the actual engine starts, or you will get an assert like, “</span><span style="background-color: white; color: #333333; font-family: "arial"; font-size: 10pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">"Shader type was loaded after engine init, use ELoadingPhase::PostConfigInit on your module to cause it to load earlier.”</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">. We current do not allow a dynamic module that is loaded after a game or editor to add its own shader type.</span></div>
<span style="font-weight: normal;"><br /></span>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Let’s now declare the more interesting Pixel Shader:</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">class</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> FMyTestPS : </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">public</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FGlobalShader</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">DECLARE_EXPORTED_SHADER_TYPE</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(FMyTestPS, </span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Global</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">/*MYMODULE_API*/</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FShaderParameter</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> MyColorParameter;</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FMyTestPS() { }</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FMyTestPS(</span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">const</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">ShaderMetaType</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">::</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">CompiledShaderInitializerType</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">& </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Initializer</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">: </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FGlobalShader</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Initializer</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">MyColorParameter.</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Bind</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Initializer</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">ParameterMap</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">TEXT</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #a31515; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">"MyColor"</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">), </span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">SPF_Mandatory</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">}</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">static</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">void</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">ModifyCompilationEnvironment</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">const</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FGlobalShaderPermutationParameters&</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Parameters</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FShaderCompilerEnvironment</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">& </span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">OutEnvironment</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FGlobalShader</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">::</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">ModifyCompilationEnvironment</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: consolas; font-size: 12px; font-weight: 700; white-space: pre-wrap;">Parameters</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">, OutEnvironment);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">// Add your own defines for the shader code</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">OutEnvironment.</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">SetDefine</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">TEXT</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #a31515; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">"MY_DEFINE"</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">), 1);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">}</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">static</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">bool</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">ShouldCache</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">EShaderPlatform</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Platform</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">// Could skip compiling for Platform == SP_METAL for example</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">true</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">}</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">static</span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">bool</span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="color: #880000; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">ShouldCompilePermutation</span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">(</span></span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">const</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FGlobalShaderPermutationParameters&</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Parameters</span><span style="background-color: white; font-family: consolas; font-size: 9pt; font-weight: 700; white-space: pre-wrap;">)</span><br />
<span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: green; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">// Useful when adding a permutation of a particular shader</span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">true</span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">}</span></span></span><br />
<span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"><br /></span></span>
<span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">// FShader interface.</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">virtual</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">bool</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Serialize</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FArchive</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">& </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Ar</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">) </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">override</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">bool</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> bShaderHasOutdatedParameters = </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FGlobalShader</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">::</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Serialize</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Ar</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Ar</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> << MyColorParameter;</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> bShaderHasOutdatedParameters;</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">}</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">void</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">SetColor</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FRHICommandList</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">& </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">RHICmdList</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">const</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FLinearColor</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">& </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Color</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">SetShaderValue</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">RHICmdList</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">GetPixelShader</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(), MyColorParameter, </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Color</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">}</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">};</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">// Same source file as before, different entry point</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"></span><br />
<pre style="background: white; font-family: Consolas; font-size: 13px;"><span style="color: #6f008a;">IMPLEMENT_SHADER_TYPE</span>(, <span style="color: #216f85;">FMyTestPS</span>, <span style="color: #6f008a;">TEXT</span>(<span style="color: #a31515;">"/Engine/Private/MyTest.usf"</span>), <span style="color: #6f008a;">TEXT</span>(<span style="color: #a31515;">"MainPS"</span>), <span style="color: #6f008a;">SF_Pixel</span>);
</pre>
</div>
<span style="font-weight: normal;"><br /></span>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">In this class we are now exposing the shader parameter </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">MyColor </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">from the .usf file:</span></div>
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="font-family: arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">The </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">FShaderParameter MyColorParameter </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">member is added to the class, which will hold information for the runtime to be able to find the bindings, allowing the value of the parameter to be set at runtime.</span></div>
</li>
<li dir="ltr" style="font-family: arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">In the serialization constructor we </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Bind</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">() the parameter to the ParameterMap by name, this has to match the .usf file's name.</span></div>
</li>
<li dir="ltr" style="font-family: arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">The new </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">ModifyCompilationEnvironment</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">() function is used when the same C++ class defines different behaviors and be able to set up #define values in the shader.</span></div>
</li>
<li dir="ltr" style="font-family: arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">The </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Serialize</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">() method is required. This is where the compile/cook time information from the shader’s binding (matched during the serialization constructor) gets loaded and stored at runtime.</span></div>
</li>
<li dir="ltr" style="font-family: arial; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; list-style-type: lower-alpha; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Finally, we have a custom </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">SetColor</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">() method, which shows how to set the MyColor parameter at runtime with a specified value.</span></div>
</li>
</ol>
<span style="font-weight: normal;"><br /></span>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Let’s now write a simple function to draw a fullscreen quad using these shader types:</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<pre style="background: white; font-family: Consolas; font-size: 13px;"><span style="color: blue;">void</span> <span style="color: #880000;">RenderMyTest</span>(<span style="color: #216f85;">FRHICommandList</span>& <span style="color: navy;">RHICmdList</span>, <span style="color: #216f85;">ERHIFeatureLevel</span>::<span style="color: #216f85;">Type</span> <span style="color: navy;">FeatureLevel</span>, <span style="color: blue;">const</span> <span style="color: #216f85;">FLinearColor</span>& <span style="color: navy;">Color</span>)
{
<span style="color: green;">// Get the collection of Global Shaders</span>
<span style="color: blue;">auto</span> <span style="color: navy;">ShaderMap</span> = <span style="color: #880000;">GetGlobalShaderMap</span>(<span style="color: navy;">FeatureLevel</span>);
<span style="color: green;">// Get the actual shader instances off the ShaderMap</span>
<span style="color: #216f85;">TShaderMapRef</span><<span style="color: #216f85;">FMyTestVS</span>> <span style="color: navy;">MyVS</span>(<span style="color: navy;">ShaderMap</span>);
<span style="color: #216f85;">TShaderMapRef</span><<span style="color: #216f85;">FMyTestPS</span>> <span style="color: navy;">MyPS</span>(<span style="color: navy;">ShaderMap</span>);
<span style="color: green;">// Declare a pipeline state object that holds all the rendering state</span>
<span style="color: #216f85;">FGraphicsPipelineStateInitializer</span> <span style="color: navy;">PSOInitializer</span>;</pre>
<pre style="background: white; font-family: Consolas; font-size: 13px;"><pre style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-family: Consolas;"> <span style="color: navy;">PSOInitializer</span>.<span style="color: navy;">PrimitiveType</span> = <span style="color: #6f008a;">PT_TriangleStrip</span>;</pre>
<span style="color: navy;">PSOInitializer</span>.<span style="color: navy;">BoundShaderState</span>.<span style="color: navy;">VertexDeclarationRHI</span> = <span style="color: #880000;">GetVertexDeclarationFVector4</span>();
<span style="color: navy;">PSOInitializer</span>.<span style="color: navy;">BoundShaderState</span>.<span style="color: navy;">VertexShaderRHI</span> = <span style="color: navy;">MyVS</span><span style="color: teal;">-></span><span style="color: #880000;">GetVertexShader</span>();
<span style="color: navy;">PSOInitializer</span>.<span style="color: navy;">BoundShaderState</span>.<span style="color: navy;">PixelShaderRHI</span> = <span style="color: navy;">MyPS</span><span style="color: teal;">-></span><span style="color: #880000;">GetPixelShader</span>();
<span style="color: navy;">PSOInitializer</span>.<span style="color: navy;">RasterizerState</span> = <span style="color: #216f85;">TStaticRasterizerState</span><<span style="color: #6f008a;">FM_Solid</span>, <span style="color: #6f008a;">CM_None</span>>::<span style="color: #880000;">GetRHI</span>();
<span style="color: navy;">PSOInitializer</span>.<span style="color: navy;">BlendState</span> = <span style="color: #2b91af;">TStaticBlendState</span><>::<span style="color: #880000;">GetRHI</span>();
<span style="color: navy;">PSOInitializer</span>.<span style="color: navy;">DepthStencilState</span> = <span style="color: #216f85;">TStaticDepthStencilState</span><<span style="color: blue;">false</span>, <span style="color: #6f008a;">CF_Always</span>>::<span style="color: #880000;">GetRHI</span>();
<span style="color: green;">// Apply it</span>
<span style="color: #880000;">SetGraphicsPipelineState</span>(<span style="color: navy;">RHICmdList</span>, <span style="color: navy;">PSOInitializer</span>);
<span style="color: green;">// Call our function to set up parameters. This has to happen AFTER the PSO has been applied!</span>
<span style="color: navy;">MyPS</span><span style="color: teal;">-></span><span style="color: #880000;">SetColor</span>(<span style="color: navy;">RHICmdList</span>, <span style="color: navy;">Color</span>);
<span style="color: green;">// Setup the vertices</span>
<span style="color: #216f85;">FVector4</span> <span style="color: navy;">Vertices</span>[4];
<span style="color: navy;">Vertices</span>[0].<span style="color: #880000;">Set</span>(-1.0f, 1.0f, 0, 1.0f);
<span style="color: navy;">Vertices</span>[1].<span style="color: #880000;">Set</span>(1.0f, 1.0f, 0, 1.0f);
<span style="color: navy;">Vertices</span>[2].<span style="color: #880000;">Set</span>(-1.0f, -1.0f, 0, 1.0f);
<span style="color: navy;">Vertices</span>[3].<span style="color: #880000;">Set</span>(1.0f, -1.0f, 0, 1.0f);
<span style="color: green;">// Draw the quad</span>
<span style="color: #880000;">DrawPrimitiveUP</span>(<span style="color: navy;">RHICmdList</span>, <span style="color: #6f008a;">PT_TriangleStrip</span>, 2, <span style="color: navy;">Vertices</span>, <span style="color: blue;">sizeof</span>(<span style="color: navy;">Vertices</span>[0]));
}</pre>
</div>
<span style="font-weight: normal;"><br /></span>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">If you want to actually test this in your codebase, you can try something like this; I declared a console variable so it can be toggled at runtime:</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">static</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">TAutoConsoleVariable</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">int32</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">> CVarMyTest(</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">TEXT</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #a31515; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">"r.MyTest"</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">),</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">0,</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">TEXT</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #a31515; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">"Test My Global Shader, set it to 0 to disable, or to 1, 2 or 3 for fun!"</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">),</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">ECVF_RenderThreadSafe</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">void</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FDeferredShadingSceneRenderer</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">::</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">RenderFinish</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FRHICommandListImmediate</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">& </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">RHICmdList</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">[...]</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">// ***</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">// Inserted code, just before finishing rendering, so we can overwrite the screen’s contents!</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">int32</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> MyTestValue = CVarMyTest.</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">GetValueOnAnyThread</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">();</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> (MyTestValue != 0)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FLinearColor</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Color</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(MyTestValue == 1, MyTestValue == 2, MyTestValue == 3, 1);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">RenderMyTest(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">RHICmdList</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FeatureLevel</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Color</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">}</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">// End Inserted code</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">// ***</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">FSceneRenderer</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">::</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">RenderFinish</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">RHICmdList</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">[...]</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
<span style="font-weight: normal;"><br /></span>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">At this point you should be able to test out your new global shader! Run your project, then pull up a console using tilde (~) and type </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">r.MyTest 1</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">, then </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">r.MyTest 2</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> and/or </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">r.MyTest 3</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> to change colors. Use </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">r.MyTest 0</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> to disable the pass.</span></div>
<span style="font-weight: normal;"><br /></span>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Debugging the generated source</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Take a look at the blog post </span><a href="https://www.unrealengine.com/blog/debugging-the-shader-compiling-process" style="text-decoration-line: none;"><span style="color: #1155cc; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; text-decoration-line: underline; vertical-align: baseline; white-space: pre-wrap;">https://www.unrealengine.com/blog/debugging-the-shader-compiling-process</span></a><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> if you want to be able to debug the compilation of your .usf file and/or see the processed file.</span></div>
<span style="font-weight: normal;"><br /></span>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">Bonus!</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">You can modify the USF file while an uncooked game/editor is running, and then press </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Ctrl</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">+</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">Shift</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">+</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;">. (period)</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> or type </span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline; white-space: pre-wrap;">recompileshaders changed</span><span style="color: black; font-family: "arial"; font-size: 11pt; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline; white-space: pre-wrap;"> in the console to pick up and rebuild your shaders for quick iteration!</span></div>
<br />
<span style="font-family: "arial"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">Enjoy!</span>R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com7tag:blogger.com,1999:blog-1979176749314572541.post-2239499668529050502017-05-11T12:01:00.002-04:002017-05-22T14:25:19.390-04:00Adding Global shaders to UE4<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Intro</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">On UE4, a global shader is one that doesn’t operate on a material or a mesh - for example, a full-screen quad, a post-processing feature, a compute shader, etc. There are times when the built-in global shaders do not provide enough functionality and a custom shader pass is required. Doing this is relatively simple, which will be covered in this post.</span></div>
<b id="docs-internal-guid-b265d80c-f83c-f299-0b9f-4ff03e87492b" style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">USF Files</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">UE4 reads USF (Unreal Shader Files) off the Engine/Shaders folder, so any new shaders need to supply their source files there. As of 4.17, shaders can also be read from a plugin (Plugin/Shaders).</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Tip</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">I’d recommend enabling </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">r.ShaderDevelopmentMode=1</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> in your </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ConsoleVariables.ini</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> file for ease of development! Check out </span><a href="https://docs.unrealengine.com/latest/INT/Programming/Rendering/ShaderDevelopment/" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">https://docs.unrealengine.com/latest/INT/Programming/Rendering/ShaderDevelopment/</span></a><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> for more information!</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">How-to</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Let’s start by adding a new USF file in your Engine/Shaders folder; let’s call it </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">MyTest.usf</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> and add a simple pass-through Vertex Shader, and a Pixel Shader that returns a custom color:</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// MyTest.usf</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// Simple pass-through vertex shader</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">void</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> MainVS(</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">in </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">float4</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> InPosition : ATTRIBUTE0,</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">out</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">float4</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Output</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> : SV_POSITION</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Output</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> = InPosition;</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// Simple solid color pixel shader</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">float4</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> MyColor;</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">float4</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> MainPS() : SV_Target0</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> MyColor;</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Now, in order to get UE4 to pick up the shader and start compiling it, we need to declare a C++ class; let’s start with the Vertex Shader:</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// This can go on a header or cpp file</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">class</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> FMyTestVS : </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">public</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FGlobalShader</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">DECLARE_EXPORTED_SHADER_TYPE</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(FMyTestVS, </span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Global</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/*MYMODULE_API*/</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FMyTestVS() { }</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FMyTestVS(</span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">const</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ShaderMetaType</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">::</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">CompiledShaderInitializerType</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">& </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Initializer</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FGlobalShader</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Initializer</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">static</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">bool</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ShouldCache</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">EShaderPlatform</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Platform</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">true</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">};</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">You can see some required things here: </span></div>
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">This is a subclass of </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FGlobalShader</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">; as such it will end up in the Global Shader Map, (which means we don’t need a Material to find it).</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Usage of the </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">DECLARE_EXPORTED_SHADER_TYPE</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">() macro; this will generate exports required for serialization of the shader type, etc; the third parameter is a type for external linkage for the code module where the shader module will live, if required (eg the C++ code doesn’t live in the Renderer module).</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Two constructors, both the default and the serialization, are required.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">The </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ShouldCache</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">() function, needed to decide if this shader should be compiled under certain circumstances (eg we might not want to compile a compute shader on a non-compute shader capable RHI).</span></div>
</li>
</ol>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">With the class declared, we can now register the Shader Type to UE4’s list:</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// This needs to go on a cpp file</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">IMPLEMENT_SHADER_TYPE</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(, FMyTestVS, </span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">TEXT</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #a31515; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"MyTest"</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">), </span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">TEXT</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #a31515; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"MainVS"</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">), </span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">SF_Vertex</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">This macro maps the type (</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FMyTestVS</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">) to the USF file (</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">MyTest</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">), the shader entry point (</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">MainVS</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">) and the frequency/shader stage (</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">SF_Vertex</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">); it also causes the shader to be added to the compilation list, as long as its </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ShouldCache()</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> method returns true.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Note</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: Whatever module you end adding your FGlobalShader has to be loaded before the actual engine starts, or you will get an assert like “</span><span style="background-color: white; color: #333333; font-family: "arial"; font-size: 10pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"Shader type was loaded after engine init, use ELoadingPhase::PostConfigInit on your module to cause it to load earlier.”</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">; i.e. we current do not allow a dynamic module loaded in the middle of the game or editor to add its own shader type.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Let’s now declare the more interesting Pixel Shader:</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">class</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> FMyTestPS : </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">public</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FGlobalShader</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">DECLARE_EXPORTED_SHADER_TYPE</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(FMyTestPS, </span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Global</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/*MYMODULE_API*/</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FShaderParameter</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> MyColorParameter;</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FMyTestPS() { }</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FMyTestPS(</span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">const</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ShaderMetaType</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">::</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">CompiledShaderInitializerType</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">& </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Initializer</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FGlobalShader</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Initializer</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">MyColorParameter.</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Bind</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Initializer</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ParameterMap</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">TEXT</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #a31515; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"MyColor"</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">), </span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">SPF_Mandatory</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">static</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">void</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ModifyCompilationEnvironment</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">EShaderPlatform</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Platform</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FShaderCompilerEnvironment</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">& </span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">OutEnvironment</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FGlobalShader</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">::</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ModifyCompilationEnvironment</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Platform</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, OutEnvironment);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// Add your own defines for the shader code</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">OutEnvironment.</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">SetDefine</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">TEXT</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #a31515; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"MY_DEFINE"</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">), 1);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">static</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">bool</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ShouldCache</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">EShaderPlatform</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Platform</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// Could skip compiling for Platform == SP_METAL for example</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">true</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">;</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// FShader interface.</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">virtual</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">bool</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Serialize</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FArchive</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">& </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Ar</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">) </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">override</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">bool</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> bShaderHasOutdatedParameters = </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FGlobalShader</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">::</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Serialize</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Ar</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Ar</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> << MyColorParameter;</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">return</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> bShaderHasOutdatedParameters;</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">void</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">SetColor</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FRHICommandList</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">& </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">RHICmdList</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">const</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FLinearColor</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">& </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Color</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">SetShaderValue</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">RHICmdList</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">GetPixelShader</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(), MyColorParameter, </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Color</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">};</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// Same source file as before, different entry point</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">IMPLEMENT_SHADER_TYPE</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(, FMyTestPS, </span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">TEXT</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #a31515; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"MyTest"</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">), </span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">TEXT</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #a31515; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"MainPS"</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">), </span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">SF_Pixel</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">In this class we are now exposing the shader parameter </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">MyColor </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from the USF file:</span></div>
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">The first thing to note is the </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FShaderParameter MyColorParameter </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">member added to the class: this will hold information for the runtime to be able to find the bindings so the value of the parameter can be set at runtime.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">In the serialization constructor we </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Bind</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">() the parameter to the ParameterMap by name, this has to match the USF name.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">The new </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ModifyCompilationEnvironment</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">() function, this is used in the cases where we might have the same C++ class define different behaviors and be able to set up #define values in the shader.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">The </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Serialize</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">() method, required as this is where the compile/cook time information from the shader’s binding (matched during the serialization constructor) gets load and stored at runtime.</span></div>
</li>
<li dir="ltr" style="background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: lower-alpha; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Finally we have a custom </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">SetColor</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">() method, which shows how to set the MyColor parameter at runtime with a specified value.</span></div>
</li>
</ol>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Let’s now write a simple function to draw a fullscreen quad using these shader types:</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">void</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> RenderMyTest(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FRHICommandList</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">& </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">RHICmdList</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ERHIFeatureLevel</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">::</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Type</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FeatureLevel</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">const</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FLinearColor</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">& </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Color</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// Get the collection of Global Shaders</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">auto</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ShaderMap</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> = </span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">GetGlobalShaderMap</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FeatureLevel</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// Get the actual shader instances off the ShaderMap</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">TShaderMapRef</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><fmytestvs> MyVS(</fmytestvs></span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ShaderMap</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">TShaderMapRef</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><fmytestps> MyPS(</fmytestps></span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ShaderMap</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// Declare a bound shader state using those shaders and apply it to the command list</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">static</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FGlobalBoundShaderState</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> MyTestBoundShaderState;</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">SetGlobalBoundShaderState</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">RHICmdList</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FeatureLevel</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, MyTestBoundShaderState, </span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">GetVertexDeclarationFVector4</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(), *MyVS, *MyPS);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// Call our function to set up parameters</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">MyPS-></span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">SetColor</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">RHICmdList</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Color</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// Setup the GPU in prep for drawing a solid quad</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">RHICmdList</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">SetRasterizerState</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">TStaticRasterizerState</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FM_Solid</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">CM_None</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">>::</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">GetRHI</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">());</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">RHICmdList</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">SetBlendState</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(TStaticBlendState<>::</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">GetRHI</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">());</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">RHICmdList</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">SetDepthStencilState</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">TStaticDepthStencilState</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">false</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">CF_Always</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">>::</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">GetRHI</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(), 0);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// Setup the vertices</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FVector4</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Vertices</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[4];</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Vertices</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[0].</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Set</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(-1.0f, 1.0f, 0, 1.0f);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Vertices</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[1].</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Set</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(1.0f, 1.0f, 0, 1.0f);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Vertices</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[2].</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Set</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(-1.0f, -1.0f, 0, 1.0f);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Vertices</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[3].</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Set</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(1.0f, -1.0f, 0, 1.0f);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// Draw the quad</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">DrawPrimitiveUP</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">RHICmdList</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">PT_TriangleStrip</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, 2, </span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Vertices</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">sizeof</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Vertices</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[0]));</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
<b style="font-weight: normal;"><br /></b>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">If you want to actually test this in your codebase, you can try something like this; I declared a console variable so it can be toggled at runtime:</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">static</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">TAutoConsoleVariable</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">int32</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">> CVarMyTest(</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">TEXT</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #a31515; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"r.MyTest"</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">),</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">0,</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">TEXT</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #a31515; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">"Test My Global Shader, set it to 0 to disable, or to 1, 2 or 3 for fun!"</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">),</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #6f008a; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ECVF_RenderThreadSafe</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">void</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FDeferredShadingSceneRenderer</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">::</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">RenderFinish</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FRHICommandListImmediate</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">& </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">RHICmdList</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[...]</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// ***</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// Inserted code, just before finishing rendering, so we can overwrite the screen’s contents!</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">int32</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> MyTestValue = CVarMyTest.</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">GetValueOnAnyThread</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">();</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: blue; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">if</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> (MyTestValue != 0)</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">{</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FLinearColor</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Color</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(MyTestValue == 1, MyTestValue == 2, MyTestValue == 3, 1);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">RenderMyTest(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">RHICmdList</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: navy; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FeatureLevel</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, </span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Color</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// End Inserted code</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: green; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">// ***</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">FSceneRenderer</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">::</span><span style="background-color: white; color: #880000; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">RenderFinish</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(</span><span style="background-color: white; color: #216f85; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">RHICmdList</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">);</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">[...]</span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br class="kix-line-break" /></span><span style="background-color: white; color: black; font-family: "consolas"; font-size: 9pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">}</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">At this point you should be able to run your project, then pull up a console using tilde (~) and typing </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">r.MyTest 1</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">, then </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">r.MyTest 2</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> and/or </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">r.MyTest 3</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> to change colors. Use </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">r.MyTest 0</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> to disable the pass.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Debugging the generated source</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Take a look at the blog post </span><a href="https://www.unrealengine.com/blog/debugging-the-shader-compiling-process" style="text-decoration: none;"><span style="background-color: transparent; color: #1155cc; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">https://www.unrealengine.com/blog/debugging-the-shader-compiling-process</span></a><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> if you want to be able to debug the compilation of your USF file and/or see the processed file.</span></div>
<b style="font-weight: normal;"><br /></b>
<br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Bonus!</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">You can modify the USF file while an uncooked game/editor is running, and then press </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Ctrl</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">+</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Shift</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">+</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">.</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> (or type </span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">recompileshaders changed</span><span style="background-color: transparent; color: black; font-family: "arial"; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> in the console) to pick up and rebuild your shaders, for quick iteration!</span></div>
<br />
<span style="font-family: "arial"; font-size: 11pt; vertical-align: baseline; white-space: pre-wrap;">Enjoy!</span>R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com10tag:blogger.com,1999:blog-1979176749314572541.post-61094550668869764802016-08-08T09:17:00.001-04:002016-12-19T09:34:54.909-05:00My Siggraph's 2016 Vulkan on UE4 talk and slides<br />
YouTube video:<br />
<a href="https://www.youtube.com/watch?v=CsHMiEQgrLA&index=4&t=26m40s">https://www.youtube.com/watch?v=CsHMiEQgrLA&index=4&t=26m40s</a><br />
<br />
Slides:<br />
<a href="https://www.khronos.org/assets/uploads/developers/library/2016-siggraph/3D-BOF-SIGGRAPH_Jul16.pdf">https://www.khronos.org/assets/uploads/developers/library/2016-siggraph/3D-BOF-SIGGRAPH_Jul16.pdf</a><br />
<br />
Best Practices Roundtable:<br />
<a href="https://www.youtube.com/watch?v=owuJRPKIUAg">https://www.youtube.com/watch?v=owuJRPKIUAg</a><br />
<br />R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com0tag:blogger.com,1999:blog-1979176749314572541.post-90944205757907361632016-05-18T10:39:00.001-04:002016-05-18T10:39:15.227-04:00Debugging shader compiling in UE4Made it to the main blog list of UE4:<br />
<br />
<a href="https://www.unrealengine.com/blog/debugging-the-shader-compiling-process">https://www.unrealengine.com/blog/debugging-the-shader-compiling-process</a><br />
<br />
<br />R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com0tag:blogger.com,1999:blog-1979176749314572541.post-64466702507631294892014-12-03T22:13:00.000-05:002014-12-03T22:13:10.690-05:00Windows changing size & position after monitor sleepI recently updated my old 24" Dell monitor to a 32" Acer B326HUL, love it! But I found that when the monitor went to sleep, the windows got resized to a smaller res, as well as all the desktop icons got rearranged. Digging around on the internet found that Windows somehow remembered 1920x1200 as the res, and resizes all windows to fit that when coming out of sleep.<br />
<br />
So the fix is registry magic!<br />
In this register tree:<br />
<i>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration\</i><br />
<br />
there is at least an entry per monitor; I had a <i>DELxxxxxxxxxx </i>and an <i>ACRxxxxxxxxxx </i>one, and under the <i>00 </i>node, there are two parameters to check out there:<br />
<b>PrimSurfSize.cx</b>, <b>PrimSurfSize.cy</b> and <b>Stride</b>.<br />
<br />
These should match your current monitor.<br />
<br />
A little below you should see these entries:<br />
<i>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration\SIMULATED_xxxxxxxx</i><br />
<br />
inside, you will also find under the <i>00</i> node, and those parameters pointing to the old sizes. Use the values from above, and also change under the remaining <i>00</i> node the <b>ActiveSize.cx</b> & <b>ActiveSize.cy</b> entries to match. Log off or restart and voila!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeWj0hLD6NvsDzG0ybeF1ixPbsQq2drA4D3Co70IF6bEBgry73_rwfKyIaMuQwpTeR7YyUWE2BObrd73kH2-ChVCTXfpoOyYsG-yXclLhNdO-ReXgjA0ZdG3zVvUnaYM3ibMb_JriUnZQ/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeWj0hLD6NvsDzG0ybeF1ixPbsQq2drA4D3Co70IF6bEBgry73_rwfKyIaMuQwpTeR7YyUWE2BObrd73kH2-ChVCTXfpoOyYsG-yXclLhNdO-ReXgjA0ZdG3zVvUnaYM3ibMb_JriUnZQ/s1600/Untitled.png" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
References:<br />
<a href="https://social.technet.microsoft.com/Forums/en-US/4d8f3aef-8c04-481b-a69a-ec0fbf3669c2/turning-off-display-resizes-open-windows?forum=w7itproperf">https://social.technet.microsoft.com/Forums/en-US/4d8f3aef-8c04-481b-a69a-ec0fbf3669c2/turning-off-display-resizes-open-windows?forum=w7itproperf</a><br />
<a href="http://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/windows-7-movesresizes-windows-on-monitor-power/1653aafb-848b-464a-8c69-1a68fbd106aa?page=2">http://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/windows-7-movesresizes-windows-on-monitor-power/1653aafb-848b-464a-8c69-1a68fbd106aa?page=2</a><br />
<br />R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com29tag:blogger.com,1999:blog-1979176749314572541.post-33316011301537740542014-07-17T16:18:00.000-04:002014-07-17T16:18:07.277-04:00Data breakpoints on XcodeKeep forgetting about this!<br />
<br />
Add:<br />
<b>watchpoint set expression <i>address</i></b><br />
<br />
Remove them:<br />
<b>watchpoint delete</b><br />
<br />R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com0tag:blogger.com,1999:blog-1979176749314572541.post-59234688591886953202014-07-16T09:01:00.002-04:002014-07-16T09:07:58.505-04:00Notepad++ Syntax highlighter for Metal, HLSL, Cg, etcBased off <a href="http://mynameismjp.wordpress.com/2012/11/04/hlsl-udl/" target="_blank">Matt Pettineo's post</a>, I've added support for <i>half</i> and also added Metal support:<br />
<a href="https://drive.google.com/file/d/0B3ZhBJ_SrVS2c0p4bTRJVE5GeTA/edit?usp=sharing" target="_blank">Notepad++ User Defined XML</a><br />
<br />
Though probably only Unreal users will/might develop Metal shaders on a PC :)<br />
<br />
Enjoy!<br />
<br />R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com1tag:blogger.com,1999:blog-1979176749314572541.post-68464775569182802442014-06-24T14:51:00.002-04:002014-06-24T17:13:35.396-04:00Lambdas instead of #define?Recently I was running into this kind of code:<br />
<pre style="background: white; font-family: Consolas; font-size: 12px;"><span style="color: blue;">#if</span> ONLY_WHEN_TRACKING_DOWN_BUG
<span style="color: blue;">#define</span> <span style="color: #6f008a;">DUMPINFO</span>(<span style="color: navy;">Name</span>, <span style="color: #880000;">Stat</span>) <span style="color: #880000;">DumpInfo</span>(<span style="color: navy;">Name</span>, <span style="color: #880000;">Stat</span>)
<span style="color: blue;">#else
</span><span style="color: blue;">#define</span> <span style="color: #6f008a;">DUMPINFO</span>(<span style="color: navy;">Name</span>, <span style="color: #880000;">Stat</span>) <span style="color: green;">/* Nothing */
</span><span style="color: blue;">void</span> <span style="color: #880000;">FunctionCalledALot</span>()
{
[...]
<span style="color: navy;">string</span> <span style="color: navy;">InfoName</span>;
<span style="color: blue;">int</span> <span style="color: navy;">InfoStat</span>;
<span style="color: #880000;">GetInfo</span>(<span style="color: navy;">InfoName</span>, <span style="color: navy;">InfoStat</span>);
<span style="color: #6f008a;">DUMPINFO</span>(<span style="color: navy;">InfoName</span>, <span style="color: navy;">InfoStat</span>);
[...]
}</pre>
<pre style="background: white; font-family: Consolas; font-size: 12px;"></pre>
Which got my OCD up & running, as <b style="font-family: Consolas; font-size: 12px;"><span style="color: navy;">InfoName </span></b>and <b style="font-family: Consolas; font-size: 12px;"><span style="color: navy;">InfoStat</span></b> might not get removed (since the compiler might not figure out that <b style="font-family: Consolas; font-size: 12px;"><span style="color: #880000;">GetInfo</span></b>() has no side effects).<br />
<br />
The typical way to solve this is to add the enclosing #define:<br />
<br />
<pre style="background: white; font-family: Consolas; font-size: 12px;"><span style="color: blue;">void</span> <span style="color: #880000;">FunctionCalledALot</span>()
{
[...]
<span style="color: blue;">#if</span> ONLY_WHEN_TRACKING_DOWN_BUG
<span style="color: navy;">string</span> <span style="color: navy;">InfoName</span>;
<span style="color: blue;">int</span> <span style="color: navy;">InfoStat</span>;
<span style="color: #880000;">GetInfo</span>(<span style="color: navy;">InfoName</span>, <span style="color: navy;">InfoStat</span>);
<span style="color: #6f008a;">DUMPINFO</span>(<span style="color: navy;">InfoName</span>, <span style="color: navy;">InfoStat</span>);
<span style="color: blue;">#endif</span> <span style="color: green;">// #ONLY_WHEN_TRACKING_DOWN_BUG</span>
[...]
}</pre>
<pre style="background: white; font-family: Consolas; font-size: 12px;"></pre>
The problems with this fix are:<br />
a) <b style="font-family: Consolas; font-size: 12px;"><span style="color: #6f008a;">DUMPINFO </span></b>might have more conditions (like depending on a console variable)<br />
b) Code rots: There might not be enough people enabling <b style="font-family: Consolas; font-size: 12px;">ONLY_WHEN_TRACKING_DOWN_BUG</b>, which will cause the code to never get compiled, so changes to signatures or types will cause errors for the poor soul who tries to use it.<br />
<br />
I was fiddling with this kind of solution, which I hope would fix those issues:<br />
<pre style="background: white; font-family: Consolas; font-size: 12px;"><span style="color: blue;">void</span> <span style="color: #880000;">FunctionCalledALot</span>()
{
[...]
<span style="color: blue;">auto</span> <span style="color: navy;">DebugInfoLambda</span> = [&]()
{
<span style="color: navy;">string</span> <span style="color: navy;">InfoName</span>;
<span style="color: blue;">int</span> <span style="color: navy;">InfoStat</span>;
<span style="color: #880000;">GetInfo</span>(<span style="color: navy;">InfoName</span>, <span style="color: navy;">InfoStat</span>);
<span style="color: blue;">return</span> <span style="color: #216f85;">std</span>::<span style="color: #880000;">make_tuple</span>(<span style="color: navy;">InfoName</span>, <span style="color: navy;">InfoStat</span>);
};
<span style="color: #6f008a;">DUMPINFO</span>(<span style="color: navy;">DebugInfoLambda</span>);
[...]
}
</pre>
I'm sure it has its drawbacks, but I think it solves the code rot issue, and the dead-code optimization issue too. So far the disassembly seems reasonable...<br />
<br />R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com0tag:blogger.com,1999:blog-1979176749314572541.post-88732162966546589602014-05-02T09:14:00.001-04:002014-05-02T09:15:36.674-04:00(Color) BasicI think I was around 10 yrs old when I got my first personal computer. This was a <a href="http://en.wikipedia.org/wiki/Color_Computer" target="_blank">TRS-80 Color Computer 3</a>, which my grandparent bought in a Radio Shack. He put it on layaway and took us a full year to pay for it so we could bring it back to Mexico. I managed to sneak in a few game paks, Robocop, Super Pitfall and Thexder.<br />
You hooked up the computer to your TV, turned it on and voila: Color-Basic!<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">10 PRINT "Hello"</span><br />
<span style="font-family: Courier New, Courier, monospace;">20 PRINT "*"</span><br />
<span style="font-family: Courier New, Courier, monospace;">30 GOTO 10</span><br />
<br />
Something like that was my first program. The Color Basic manual was so great, and the language lent itself to exploration. LET is optional? You can add lines in the middle by using line number 15 if you missed anything? 320x192 at 16 colors!<br />
<br />
After a while I managed to score a couple of the <a href="http://en.wikipedia.org/wiki/The_Rainbow_(magazine)" target="_blank">Rainbow magazine</a>, and in there were new concepts: 6809 Assembly Language. You could do assembly inline using DATA, basically writing the opcodes yourself in Basic like:<br />
<span style="font-family: Courier New, Courier, monospace;">10 READ A: READ B</span><br />
<span style="font-family: Courier New, Courier, monospace;">15 <span style="white-space: pre-wrap;">POKE &HFFA2,A</span></span><br />
<span style="font-family: Courier New, Courier, monospace;">15 <span style="white-space: pre-wrap;">POKE &HFFA4,B</span></span><br />
<span style="font-family: Courier New, Courier, monospace;">20 DATA 254, 44</span><br />
<br />
This involved writing the assembly language yourself, then finding out the opcodes and feeding them to the DATA instructions. Of course you'd mess one up and then all your program would get lost.<br />
<br />
Did I mention I didn't have a save/load device? The Floppy Drive Kit costed more than the computer back then, and I tried a cassette tape but it would work only about 20% of the time, so I just ended up leaving the CoCo on, and every time I wanted to run a program I had to manually enter it.<br />
<br />
My fondest memory is that one of the Rainbow magazines had a listing for plotting the <a href="http://en.wikipedia.org/wiki/Mandelbrot_set" target="_blank">Mandelbrot Set</a>. It 'only' took about 15 minutes to enter the listing into the computer, then it would take *hours* to plot (you could see every pixel taking seconds). However the explanation in the article, as well as seeing the computer plot it one line at a time was magic.<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">REM PRESS ANY KEY</span><br />
<span style="font-family: Courier New, Courier, monospace;">EXEC 44539</span><br />
<br />
<br />R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com0tag:blogger.com,1999:blog-1979176749314572541.post-12865313700628019552014-03-31T16:13:00.001-04:002014-03-31T16:13:21.658-04:00Skip Visual Studio Debug HeapReminder: Set <span style="background-color: white; color: #333333; font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; font-size: 15px; line-height: 20.790000915527344px;"> </span><span style="background-color: white; color: #333333; font-family: Georgia, Utopia, 'Palatino Linotype', Palatino, serif; font-size: 15px; line-height: 20.790000915527344px;">_NO_DEBUG_HEAP=1 to disable using the crt debug heap.</span>R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com0tag:blogger.com,1999:blog-1979176749314572541.post-58252763570074466042014-01-14T11:23:00.000-05:002014-01-14T11:23:35.924-05:00Functional programming for EngineersBeing an Electronics & Computer Engineering major (not Computer Science), I missed out on the fun of functional programming. Having heard it's such a complete paradigm shift away from imperative programming, I had tried to teach myself Scheme, but didn't have a lot of motivation (for actual practical use).<br />
<br />
Turns out that (while reading <a href="http://www.amazon.com/Modern-Design-Programming-Patterns--Depth-ebook/dp/B00AU3JUHG/" target="_blank">Alexandrescu's Modern C++ Design</a>), template meta-programming is an excellent application! It's indeed a fun, different way of thinking (best for us used to dealing with assembly & C/C++ 99.9999% of the time!).<br />
<br />
Just a month before, I was reading <a href="http://www.drdobbs.com/cpp/programming-without-variables/240161204" target="_blank">Andrew Koenig's Dr Dobbs</a> series and this helped immensely to understand a bunch of concepts on this book. I highly recommend reading these series first, then digging into the book.<br />
<br />
So run, don't walk to broaden your horizons!<br />
<br />R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com0tag:blogger.com,1999:blog-1979176749314572541.post-83252791308518770162013-12-18T09:48:00.001-05:002013-12-18T09:49:34.750-05:00Tip: iOS Memory Bug FixI kept hitting this crash over & over inside malloc (and there was still ~ 100 MB free):<br />
<br />
<span class="match" style="background-color: #fff3b8; box-sizing: border-box; color: #555459; font-family: Lato, sans-serif; font-size: 15px; line-height: 18px;"><b>mach_vm_map</b></span><span style="background-color: #f9fbfd; color: #555459; font-family: Lato, sans-serif; font-size: 15px; line-height: 18px;">(size=<i>*different size each time, < 1 MB*</i>) failed (error code=3)</span><br />
<span style="background-color: #f9fbfd; color: #555459; font-family: Lato, sans-serif; font-size: 15px; line-height: 18px;"> *** error: can't allocate region</span><br />
<span style="background-color: #f9fbfd; color: #555459; font-family: Lato, sans-serif; font-size: 15px; line-height: 18px;"> *** set a breakpoint in malloc_error_break to debug</span><br />
<br />
Turned out to be an issue on iOS 7.0 & 7.0.2; upgrading to 7.0.4 fixed it! Unfortunately the <a href="http://support.apple.com/kb/DL1701" target="_blank">7.0.4 release notes</a> don't go into detail on which bugs were fixed.<br />
<br />R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com0tag:blogger.com,1999:blog-1979176749314572541.post-70682996249039741672013-10-27T20:52:00.001-04:002013-12-18T09:49:01.515-05:00Logitech Harmony One WoesLove my Harmony One; had to update the inputs since I rewired my TV, so tried getting the latest software, all fine and dandy until...<br />
<br />
I updated.<br />
<br />
Remote is now bricked! Goes straight into safe mode! Tried some things from the web: Drain battery, take out, wait a day and install, press OK while booting, press '2' while booting... Nothing.<br />
<br />
I guess I had to reflash... Took me days to find the info, as using the provided software automatically updated to the new version, which keeps bricking the remote (goes into Safe mode always)!<br />
<br />
Until I found: This is the website where you can reflash the firmware!<br />
<a href="http://members.harmonyremote.com/EasyZapper/New/Main.asp?WebProcessAction=Start&ClassId=HarmonyProcess.ProcLogin&RelativePath=ProcLogin%2F&ReturnUrl=%2FEasyZapper%2FUserHome.asp&AccountType=Normal&Error=&UserName=&Password=&BrowserType=Mozilla%2F4.0%20%28compatible%3B%20MSIE%206.0%3B%20Windows%20NT%205.1%3B%20SV1%3B%20.NET%20CLR%201.1.4322%3B%20.NET%20CLR%202.0.50727%29" target="_blank">http://members.harmonyremote.com/</a><br />
<br />
So happy my remote's back!R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com0tag:blogger.com,1999:blog-1979176749314572541.post-78514394867601628832013-10-21T16:25:00.000-04:002013-10-21T16:26:56.250-04:00Upgraded my Galaxy Nexus...Got an <b>LG G2</b>. Really nice phone!<br />
<br />
+ Super fast & snappy, compared to achingly old Galaxy Nexus<br />
+ Nice screen size, 5.2 but doesn't feel huge like a Galaxy Note<br />
+ Battery lasts ~ 2 days, using Navigation+GPS, Wifi, Bluetooth, browsing, couple of games (my Galaxy Nexus dies after ~4 hours after using Nav+GPS with the extended battery).<br />
+- Knock-knock feature works ~70% of the time<br />
- Non-replaceable battery... Wonder when will it start giving out?<br />
- 1920x1080, but seems that the software menu buttons kill off some, Epic Citadel said it was rendering at 1800x1080! Might also be affecting perf, as it averaged 37fps, it shoudl've been very close to 60 fps<br />
- Not a lot of cases available :(<br />
- Verizon changed the back buttons, so cases won't be compatible between AT&T/Verizon models<br />
- Only black on Verizon<br />
<br />
Wired review:<br />
<a href="http://www.wired.com/reviews/2013/10/lg-g2/">http://www.wired.com/reviews/2013/10/lg-g2/</a><br />
<br />R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com0tag:blogger.com,1999:blog-1979176749314572541.post-38750153027849020022013-08-02T18:18:00.005-04:002013-08-05T10:51:40.971-04:00Visual Studio 2012 Tip: Skip stepping into function(s)<div class="MsoNormal">
<a href="http://stackoverflow.com/questions/12550412/has-the-vs2012-nativede-stepover-registry-entry-that-prevents-step-into-for-spec">http://stackoverflow.com/questions/12550412/has-the-vs2012-nativede-stepover-registry-entry-that-prevents-step-into-for-spec</a></div>
<br />
<?xml version="1.0" encoding="utf-8"?><br /><StepFilter xmlns="http://schemas.microsoft.com/vstudio/debugger/natstepfilter/2010"><br /> <Function><Name>boost::.*</Name><Action>NoStepInto</Action></Function><br /> <Function><Name>std::.*</Name><Action>NoStepInto</Action></Function><br /> <Function><Name>FMemory::Malloc</Name><Action>NoStepInto</Action></Function><br /></StepFilter><br />
<br />
<o:p></o:p>Save it into:<br />
<div class="MsoNormal">
<b>C:\Users\</b><i>USERNAME</i><b>\Documents\Visual
Studio 2012\Visualizers\</b><i>SkipStuff</i><b>.natstepfilter</b></div>
<div class="MsoNormal">
<b><br /></b></div>
<div class="MsoNormal">
<b><br /></b></div>
R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com0tag:blogger.com,1999:blog-1979176749314572541.post-89324377242643423182012-12-12T13:43:00.001-05:002012-12-12T18:41:46.465-05:00Visual Studio Quick Tips<br />
<div>
Very quick Visual Studio tips:<br />
<br />
<b>Breakpoints</b></div>
<ul>
<li>To put a breakpoint into any class methods, use <b>Class::*</b> as the breakpoint function</li>
</ul>
<b>Watch Window</b><br />
<ul>
<li>If you have your own type defined in autoexp.dat, you can use the "<b>,!</b>" modifier to skip it</li>
<li>$ENV=0 dumps the environment variables</li>
<li>$CMDLINE=0 dumps the command line</li>
</ul>
<b>Compilation</b><br />
<ul>
</ul>
<div>
<div>
<ul>
<li>If you want a quick way to know the size/offset of your classes, add this compile flag to your cpp file (right-click on cpp file-><i>Properties->Configuration Properties->C/C++->Command Line->Additional Options</i>): <b>/d1reportAllClassLayout</b></li>
</ul>
</div>
</div>
R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com0tag:blogger.com,1999:blog-1979176749314572541.post-72916005032519129662012-03-23T23:54:00.001-04:002012-03-23T23:56:28.957-04:0064 bit migration tips part 2Pointer and structure padding: Fun times!<br />
<br />
Consider a simple structure:<br />
<span style="font-family: 'Courier New', Courier, monospace;">struct SStruct</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">{</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> int m_nCount;</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> int * m_pElements;</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> int m_nMask;</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">};</span><br />
<br />
In 32 bit land,<br />
<span style="font-family: 'Courier New', Courier, monospace;">sizeof(SStruct) == 12;</span><br />
<br />
In 64 bits:<br />
<span style="font-family: 'Courier New', Courier, monospace;">sizeof(SStruct) == 20;</span><br />
<br />
That's because m_pElements is a pointer, which is 8 bytes aligned, so now you have to remember to pad it out if you write it out as binary, or alternatively rejiggle the struct:<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace;">struct SStruct</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">{</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> int * m_pElements;</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> int m_nCount;</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"> int m_nMask;</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">};</span><br />
<br />
<br />
Now in 64 bits:<br />
<span style="font-family: 'Courier New', Courier, monospace;">sizeof(SStruct) == 16;</span><br />
<br />
<br />
How can you write it from a 32 bit tool if you share the structure? Stay tuned...R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com0tag:blogger.com,1999:blog-1979176749314572541.post-40747835386562738072012-03-18T15:33:00.001-04:002012-03-18T15:34:22.287-04:00Migrating to 64 bitsSooner or later you'll find at the crossroads of deciding whether or not switch to 64 bit. If you want to be future proof, do it!<br />
<br />
Migrating our engine to 64 bit has been quite the ride. Here are some tips and recommendations:<br />
<br />
* Make a new configuration off your 32 bit one. Then change the code generation to be x64.<br />
* Temporarily remove all 3rd party libs linking with your project, and #ifdef the code that uses it out with some define. This is usually the most boring part; the goal here is to be able to compile/link first. We'll fix the runtime issues later.<br />
* Once your solution links & compiles, try to run it for kick's sake. And start fixing the errors as you go.<br />
* If you load binary data directly off disk, you'll have to work on each tool that generates binary data and make it work for 64 bit (or gasp! Both 32 & 64 bit!)<br />
* The biggest issue we found during our conversion was pointers and padding. I'll discuss that in another post.<br />
* You might be able to live with having 32 bit tools that generate 64 bit data. The usual problem with this is if you have a struct/class which you write out directly to disk, but there are ways around this.R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com0tag:blogger.com,1999:blog-1979176749314572541.post-74878348236497936432011-07-23T17:56:00.000-04:002011-07-23T17:56:19.528-04:00Droid X FreezingSo I started getting weird/random glitches on my Droid X, where the phone would just freeze. I could press the top button & turn off the screen, but when pressing it again or the home key to unlock, sometimes the bottom row of physical buttons would light up a bit and then turn off, or it would just not do that and keep the screen off.<br />
<br />
Unfortunately I was out of the country so I had no internet or data access (I suspected it had to do with setting it in airplane mode for the first time), so I tried removing the SD card and voila! It stopped freezing.<br />
<br />
But I could take no pictures, or read my kindle books offline (or play all the games in my sd card!) :(<br />
<br />
Coming back I looked into this online and did the following:<br />
1) Backup SD card to PC (worked!)<br />
2) Format SD card from PC (worked!)<br />
3) Copied some folders from backup to SD, put the card back into the phone, turn on and wait for hang...<br />
<br />
So did 3) until I only missed the Music folder with all my MP3, and currently the phone works ok! I now have to go through all the files in the Music folder (about 6 gb) and check for weird issues...<br />
<br />
So definitely a case of either a corrupt filesys or corrupt file (or an MP3 file with bad tags?).R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com0tag:blogger.com,1999:blog-1979176749314572541.post-33828868622372572062011-07-07T20:31:00.000-04:002011-07-07T20:31:38.889-04:00#FailAfter spending quite some time trying to find a solution, gave up and asked <a href="http://stackoverflow.com/questions/6618667/performance-using-d3d10-11-and-mdi-windows">stackoverflow</a>...R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com2tag:blogger.com,1999:blog-1979176749314572541.post-17712038049287682922011-01-24T12:15:00.000-05:002011-01-24T12:15:25.526-05:00Switching phonesOk, I'm going from an old BlackBerry 8703e, to a <a href="http://www.amazonwireless.com/dp/B003UESOGA?_encoding=UTF8&tag=miscadventure-20&linkCode=as2&camp=1789&creative=9325&creativeASIN=B003UESOGA">Motorola DROID X Android Phone (Verizon Wireless)</a><img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=miscadventure-20&l=as2&o=1&a=B003UESOGA" style="border: medium none ! important; margin: 0px ! important;" width="1" />, hopefully I'll see the Android Difference ;)R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com0tag:blogger.com,1999:blog-1979176749314572541.post-39450042286454015722010-11-30T17:23:00.000-05:002010-11-30T17:25:35.540-05:00Finally here! Installation pics of my car stereoIt took a me a while to find the pictures of how the <a href="http://www.amazon.com/Sony-MEX-BT3800U-Receiver-Player-Bluetooth/dp/B0032FOJPM?ie=UTF8&tag=miscadventure-20&link_code=btl&camp=213689&creative=392969" target="_blank">Sony MEX-BT3800U</a><img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=miscadventure-20&l=btl&camp=213689&creative=392969&o=1&a=B0032FOJPM" style="border: medium none ! important; margin: 0px ! important; padding: 0px ! important;" width="1" /> got installed in my Mitsubishi Endeavor, but here they are now!<br />
<br />
Pull from the bottom left side a little bit: <br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCdNyMoP1xTPZ2SjNa9DT8Tk-3ZhVDrjOTg5vIQ49xKLZw45sNN7_ljZYPyluwKdFuNoZ5yjMDDktv-1EC7QAi2lIvJkD1xnz1utlvpjsL2aUl71ce_yi93sf6ELpS67AnTajrFJoD5qw/s1600/P1020655.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCdNyMoP1xTPZ2SjNa9DT8Tk-3ZhVDrjOTg5vIQ49xKLZw45sNN7_ljZYPyluwKdFuNoZ5yjMDDktv-1EC7QAi2lIvJkD1xnz1utlvpjsL2aUl71ce_yi93sf6ELpS67AnTajrFJoD5qw/s320/P1020655.JPG" width="320" /></a></div> Now from the top right side:<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifSF7ljhl3CZCj8U4q86rk5eqSNvcB0bOp6mIqZ1y1BqWKqF-Zi38DcxrjQzpoLVQanl_p1nApde3BuxOMy9oIZqI4AFKpRgkZUYFy0z9C14eAzCD4p7jSaklNPprA7vZkdvxe3RgFOBo/s1600/P1020657.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifSF7ljhl3CZCj8U4q86rk5eqSNvcB0bOp6mIqZ1y1BqWKqF-Zi38DcxrjQzpoLVQanl_p1nApde3BuxOMy9oIZqI4AFKpRgkZUYFy0z9C14eAzCD4p7jSaklNPprA7vZkdvxe3RgFOBo/s320/P1020657.JPG" width="320" /></a></div>Now from the top left:<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqDVYFhA4iTwGJaRvvyVPZCofuX9gz1NVgHJSYKbxy0H8JVQYZEcj_GvsErQWDu7WO9OC6lu55qTk1JjqpccfInPrdTZIcFWiomMbhQsr7fWH-FTfQ5hHM8C2U3wXeFPjT8kTAqS6ZmXE/s1600/P1020656.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqDVYFhA4iTwGJaRvvyVPZCofuX9gz1NVgHJSYKbxy0H8JVQYZEcj_GvsErQWDu7WO9OC6lu55qTk1JjqpccfInPrdTZIcFWiomMbhQsr7fWH-FTfQ5hHM8C2U3wXeFPjT8kTAqS6ZmXE/s320/P1020656.JPG" width="320" /></a></div>At this point it has detached from the dashboard, and you can now pull from the top a little bit:<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisJwKid24ogf_uVLm2PlQ-4dldETNHtAxKJAu_Dk3F7c03hv0W2C87PO16AeEG4MwQp_IifF0KQOdxfYb4otT06WZ0WfUtXirltUEbTXb6U-nH5e40ZDlLy-p_7cknH8o6utFE5HJlhvs/s1600/P1020659.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisJwKid24ogf_uVLm2PlQ-4dldETNHtAxKJAu_Dk3F7c03hv0W2C87PO16AeEG4MwQp_IifF0KQOdxfYb4otT06WZ0WfUtXirltUEbTXb6U-nH5e40ZDlLy-p_7cknH8o6utFE5HJlhvs/s320/P1020659.JPG" width="320" /></a></div>So far so good; now we have to remove that pair of screws you can see on the top, and with it we detach the cover of the clock/fm lcd:<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4zNue2-rjfhEwqaB89OWeA03WhdSXMl2bZSOdUBi9h6GB17spofBxu6y8CfvOSeTYov7IE-NgM5JWwRJkNRP0cLGLIarb6smmPkBaC7G9kIe3KUvo6MNR34XrswWa4uQMld2LoyTaDkw/s1600/P1020660.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4zNue2-rjfhEwqaB89OWeA03WhdSXMl2bZSOdUBi9h6GB17spofBxu6y8CfvOSeTYov7IE-NgM5JWwRJkNRP0cLGLIarb6smmPkBaC7G9kIe3KUvo6MNR34XrswWa4uQMld2LoyTaDkw/s320/P1020660.JPG" width="320" /></a></div>You see those 2 black wires & the one with foam? Now if we look at this from the top, you can see they are attached to the grey metal cover, so manually unplug each one of them from the white plugs:<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjq4gGLvb_BPnWXNPOdUKVFIju2cucW8mrEfVARJq9PX6ouDB-YLdZSXCaSDqYdx0D0bAYL64Krg11pP4H9jUse0h2EdHNVooX84u3d6xpkmO7lleyVNUy5_eubPg7xph-i6QEYzF-Tz7s/s1600/P1020662.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjq4gGLvb_BPnWXNPOdUKVFIju2cucW8mrEfVARJq9PX6ouDB-YLdZSXCaSDqYdx0D0bAYL64Krg11pP4H9jUse0h2EdHNVooX84u3d6xpkmO7lleyVNUy5_eubPg7xph-i6QEYzF-Tz7s/s320/P1020662.JPG" width="320" /></a></div>Ok, so after that, we can fully remove the grey panel!<br />
<div class="separator" style="clear: both; text-align: center;"></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8Dm4HK5E2_LA6z_rVMhFhO93Qeagdi5Z45zExjBL0pTCrB0NOVZ6UGmLzEr1-D5EQ9rZnlOeMNsa8z4wpdDkTxXEUuEa_gyMYoYvCQ5noxifPXgyY4uwNHkJkABLutCCb_sWOSmTSqbE/s1600/P1020664.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8Dm4HK5E2_LA6z_rVMhFhO93Qeagdi5Z45zExjBL0pTCrB0NOVZ6UGmLzEr1-D5EQ9rZnlOeMNsa8z4wpdDkTxXEUuEa_gyMYoYvCQ5noxifPXgyY4uwNHkJkABLutCCb_sWOSmTSqbE/s320/P1020664.JPG" width="320" /></a></div>Missing from this picture is the old stereo, which would be in the center slot; you'd proceed to remove the front 2 screws to take it out, and the ground cable.<br />
<br />
To attach it back, follow the steps in reverse, and push it in the end towards the dashboard.<br />
<br />
Disclaimer: You may burn your vehicle electronics! Detach at your own risk!<br />
<br />
And the final product:<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCluVuGMkPC3pwVYlKiYLV5C06y0g5wuHOoh69opGFbcgJ8usMO36u2HBRkjohsHRXC9hTNWQW8V2_JOdnn9f0_s6vYrUuY3Ah4Bj_XMXhWuqSFEJN3id0rhcLOCPZzUDeq1b-0gjq4I8/s1600/P1020652.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCluVuGMkPC3pwVYlKiYLV5C06y0g5wuHOoh69opGFbcgJ8usMO36u2HBRkjohsHRXC9hTNWQW8V2_JOdnn9f0_s6vYrUuY3Ah4Bj_XMXhWuqSFEJN3id0rhcLOCPZzUDeq1b-0gjq4I8/s320/P1020652.JPG" width="320" /></a></div>R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com2tag:blogger.com,1999:blog-1979176749314572541.post-53997940127878488842010-11-10T17:16:00.000-05:002010-11-13T17:46:07.960-05:00Super Mario All-StarsWaiting for it... Free shipping!<br />
<br />
<a href="http://www.amazon.com/dp/B0049DYNNO?tag=miscadventure-20&camp=213761&creative=393545&linkCode=bpl&creativeASIN=B0049DYNNO&adid=1T81CHHRWZ00AQPAAS5C&">Link...</a><br />
<br />
<br />
<iframe src="http://rcm.amazon.com/e/cm?t=miscadventure-20&o=1&p=8&l=bpl&asins=B0049DYNNO&fc1=000000&IS2=1<1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;"align="left" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com0tag:blogger.com,1999:blog-1979176749314572541.post-77701303789025066582010-08-14T19:45:00.000-04:002010-08-14T19:45:48.108-04:00Motherboard upgradeSeems I've been getting a lot of random freezes on Win 7 x64; I'll blame it on the motherboard, a <a href="http://www.amazon.com/Gigabyte-GA-P35-DS3L-Core2-Channels-Motherboard/dp/B000U8YO2W?ie=UTF8&tag=miscadventure-20&link_code=btl&camp=213689&creative=392969" target="_blank">GA-P35-DS3L</a><img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=miscadventure-20&l=btl&camp=213689&creative=392969&o=1&a=B000U8YO2W" style="border: medium none ! important; margin: 0px ! important; padding: 0px ! important;" width="1" />, so I'll be switching to a <a href="http://www.amazon.com/Gigabyte-Core-DDR2-1366-Motherboard-GA-EP45-UD3L/dp/B001KEMJ9U?ie=UTF8&tag=miscadventure-20&link_code=btl&camp=213689&creative=392969" target="_blank">GA-EP45-UD3L</a><img alt="" border="0" height="1" src="http://www.assoc-amazon.com/e/ir?t=miscadventure-20&l=btl&camp=213689&creative=392969&o=1&a=B001KEMJ9U" style="border: medium none ! important; margin: 0px ! important; padding: 0px ! important;" width="1" /> instead. At this point who knows why it broke down...R Calocahttp://www.blogger.com/profile/15408750277652548588noreply@blogger.com0