SSE Shader Graphs
Total Page:16
File Type:pdf, Size:1020Kb
A P P E N D I X A ■ ■ ■ SSE Shader Graphs The Strumpy Shader Editor (SSE) is a flow graph-style editor for making shaders in Unity. It is currently free and can be found in the Unity Asset Store. You can connect directly to the Asset Store from the Window menu inside your Unity project. You can also find different versions of the SSE in the Showcase section of the Unity forum in case you are not using the current Unity build. The SSE BetterLightmap Shader Graph The BetterLightmap shader allows you to blend in just the right amount of emissive with the lightmap and lets you have glossiness and specular for a more realistic lightmapped solution. Figure A-1 shows how the Diffuse component combines diffuse color, a lightmap, and a regular texture. Note the use of the MeshUV node to specify the UV2 mapping channel. This shader can be used on the temple and other main structural objects by selecting their material version appended with a 1. In other words, the Temple Outer material uses a Legacy Lightmap shader while Temple Outer 1 uses the BetterLightmap shader. Both materials use the same lightmap and texture map 939 APPENDIX A ■ SSE SHADER GRAPHS Figure A-1. The SSE BetterLightmap shader graph The SSE ReflectiveAlpha Shader Graph The ReflectiveAlpha shader (Figure A-2) allows you to combine a normal map, alpha channel, and a cube map for reflection. Note the use of the Advanced Shadow Pass to incorporate the opacity information into shadows. This shader is used in the Ledge Fringe object’s material inside the temple. 940 APPENDIX A ■ SSE SHADER GRAPHS Figure A-2. The SSE ReflectiveAlpha shader graph The SSE ReflectiveCutout Shader Graph The ReflectiveCutout shader (Figure A-3) also allows you to combine a normal map, alpha channel, and a cube map for reflection. By subtracting the value of the range node, 0 to 1, from the texture’s alpha channel value, 0 to 1 (black to white), the resulting value will be anywhere from -1 to 1. In the Clip component, any value below 0 is shown as fully transparent. Anything above is fully opaque. In this shader, the outline of the alpha part will be crisper and will appear to sparkle since it doesn’t anti-alias like the alpha blended version. It has the advantage of being rendered in the Geometry pass and is written to the Z buffer. It also needs the Advanced Shadow Pass to incorporate the opacity information into shadows. This shader can be used as an alternative in the Ledge Fringe object’s material inside the temple. Try adjusting the Clamp range to change the clipping amount. 941 APPENDIX A ■ SSE SHADER GRAPHS Figure A-3. The SSE ReflectiveCutout shader graph 942 A P P E N D I X B ■ ■ ■ Key Codes Key codes returned by Event.keyCode. These map directly to a physical key on the keyboard. Use lower case: Input.GetKeyDown("i"), Input.GetKey ("escape"), Input.GetKeyDown("f1") Values None Not assigned (never pressed) Backspace Backspace key Delete Forward delete key Tab Tab keyrt Clear Clear key Return Return key Pause Pause on PC machines Escape Escape key Space Space key Keypad0 Numeric keypad 0 Keypad1 Numeric keypad 1 Keypad2 Numeric keypad 2 Keypad3 Numeric keypad 3 Keypad4 Numeric keypad 4 Keypad5 Numeric keypad 5 Keypad6 Numeric keypad 6 Keypad7 Numeric keypad 7 Keypad8 Numeric keypad 8 Keypad9 Numeric keypad 9 KeypadPeriod Numeric keypad . KeypadDivide Numeric keypad / KeypadMultiply Numeric keypad * 943 APPENDIX B ■ KEY CODES Values KeypadMinus Numeric keypad - KeypadPlus Numeric keypad + KeypadEnter Numeric keypad enter KeypadEquals Numeric keypad = UpArrow Up arrow key DownArrow Down arrow key RightArrow Right arrow key LeftArrow Left arrow key Insert Insert key key Home Home key End End key PageUp Page up key PageDown Page down key F1 F1 function key F2 F2 function key F3 F3 function key F4 F4 function key F5 F5 function key F6 F6 function key F7 F7 function key F8 F8 function key F9 F9 function key F10 F10 function key F11 F11 function key F12 F12 function key F13 F13 function key F14 F14 function key F15 F15 function key Alpha0 The 0 key on the top of the alphanumeric keyboard. Alpha1 The 1 key on the top of the alphanumeric keyboard. Alpha2 The 2 key on the top of the alphanumeric keyboard. 944 APPENDIX B ■ KEY CODES Values Alpha3 The 3 key on the top of the alphanumeric keyboard. Alpha4 The 4 key on the top of the alphanumeric keyboard. Alpha5 The 5 key on the top of the alphanumeric keyboard. Alpha6 The 6 key on the top of the alphanumeric keyboard. Alpha7 The 7 key on the top of the alphanumeric keyboard. Alpha8 The 8 key on the top of the alphanumeric keyboard. Alpha9 The 9 key on the top of the alphanumeric keyboard. Exclaim Exclaim key DoubleQuote Double quote key Hash Hash key Dollar Dollar sign key Ampersand Ampersand key Quote Quote key LeftParen Left Parent key RightParen Right Parent key Asterisk Asterisk key Plus Plus key Comma Comma key (,) Minus Minus key (-) Period Period key (.) Slash Slash key (/) Colon Colon key (,) Semicolon Semicolon key (;) Less Less key (<) Equals Equals key (=) Greater Greater key (>) Question Question mark key (?) At At key LeftBracket Left bracket key Backslash Backslash key RightBracket Backslash key 945 APPENDIX B ■ KEY CODES Values Caret Caret key Underscore Underscore key (_) BackQuote Back quote key A a key B b key C c key D d key E e key F f key G g key H h key I i key J j key K k key L l key M m key N n key O o key P p key Q q key R r key S s key T t key U u key V v key W w key X x key Y y key Z z key Numlock Numlock key CapsLock Capslock key 946 APPENDIX B ■ KEY CODES Values ScrollLock Scroll lock key RightShift Right Shift key LeftShift Left shift key RightControl Right Control key LeftControl Left Control key RightAlt Right Alt key LeftAlt Left Alt key LeftApple Left Apple key LeftWindows Left Windows key RightApple Right Apple key RightWindows Right Windows key AltGr Alt Gr key Help Help key Print Print key SysReq Sys Req key Break Break key Menu Menu key Mouse0 First (primary) mouse button Mouse1 Second (secondary) mouse button Mouse2 Third mouse button Mouse3 Fourth mouse button Mouse4 Fifth mouse button Mouse5 Sixth mouse button Mouse6 Seventh mouse button 947 A P P E N D I X C ■ ■ ■ Final Sequence 1: Player picks TrunkOpening with Topi Fruit Icon • Metadata: • Thunder audio • SparklesFalling prefab • Calls DoTheJob() in: • TreeEffects.js triggers Final Group’s end game animation: o Animate windZone o Point Trunk Blue position, Intensity and color o Point Standing Stones Intensity and color o Directional light intensity o Blackout opacity animation o Calls ExtraTasks() event from Final Group’s TreeTasks.js • Hide/show tree trunk and topi fruit • Activate tree and process metadata, OneTaskRemaining • CameraMatchData.js Sends new targets Triggers camera match 2: Player picks Tree of Life with Crowbar with Sleeve Icon, new Hanging Topi Fruit prefab appears 3: Pick Hanging Topi Fruit with default cursor: • Metadata • Calls DoTheJob() on: 949 APPENDIX C ■ FINAL SEQUENCE • CameraMatchData.js (on Point Trunk Blue)– uses Point Trunk Blue as Target Look and TargetTrunkOpening as Target Pos • FinalTask.js on Main Camera: Set ‘end’ flag to true (prevent mouseover, etc) Turn off pointer layer for inventory icon Trigger win sound clip from fXSource (this will be Point Trunk Blue) Point Trunk Blue holds SynthUp Play camera’s Field of view Change animation, pull back Play the camera’s audio clip, Temple Roll credits 950 ■ ■ ■ Index ■Special Characters & materials for, 341–355 chest, 348–352 Numbers flower, 352–355 #Sizes and Visibility in edit pane, 196 keys, 342–348 % operator, 846 and shadows, 355–361 // Require a character controller line, 198 messages related to, 437–438 //object metadata section, 627 using FBX Importer, 323–341 '_Color' property, 670 complex hierarchies in, 337–338 2 Í 3 Split layout, 51 importing individual objects, 331–336 2D object handling, 539–543 parenting in, 338–341 3D objects, 83–91 transforming individual objects, 336–337 handling object visibility, 587–599 actionMsg variable, 501 colliders, 595–598 ActionObject tag, 555, 850 developing non-keyframed fades, 592– actionObject variable, 615–616 593 actions, message text for, 475–504 processing no-match cursors, 598–599 activating message, 496–500 side effects of changes, 593–595 adding audio, 482–483 mapping, 85–91 adding helpful information, 502–504 meshes dynamic display time for, 500–502 overview, 83 and dynamic fonts, 492–496 sub-objects of, 83–85 loading start-up values, 488–492 processing animation, 484–488 using states, 481–482 ■A Add Current option, 286 action messages, 612–616 Add Detail Mesh option, 162 action objects Add Grass Texture option, 160 adding Sound F/X for, 375–380 Add Keyframe button, 393, 397, 524 and Animation Editor, 383–395 Add Layer menu item, 359, 505 animation of, 368–375 Add Terrain Texture dialog, 133 accessing Store in Root, 371–375 Add to Inventory action, 539 changing imported animations, 395–400 Add Tree dialog, 137 triggering for another object, 400–403 AddToInventory function, 541, 553–554, 577– two-state, 380–382 578, 608–609 characters and, 934–935 Advanced option, 257 colliders for, 361–367 adventure games importing, 309–323 decline of, 20–22 limitations of, 404 formats for, 26–28 951 ■ INDEX character, 26–27 triggering for another object, 400–403 characteristics of, 27–28 two-state, 380–382 design considerations for first person, 28 in virtual worlds, 20 first person, 26 Animation button, 526 history of, 4–7 Animation Clips folder, 385, 396, 449, 524 graphical nature of, 4–6 Animation Delay parameter, 440 LucasArts titles, 6 Animation dialog box, 526 real-time environments, 6–7 Animation Editor, 383–395 human characteristics appealed to by, 23–24 animation events, 809–810 modern successes, 22–23 Animation field, 336 real time vs.