{"id":4135,"date":"2015-12-21T02:54:11","date_gmt":"2015-12-20T23:54:11","guid":{"rendered":"http:\/\/unitycoder.com\/blog\/?p=4135"},"modified":"2015-12-21T02:55:42","modified_gmt":"2015-12-20T23:55:42","slug":"matrix-playground-shader","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2015\/12\/21\/matrix-playground-shader\/","title":{"rendered":"Matrix Playground Shader"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"4136\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2015\/12\/21\/matrix-playground-shader\/matrix_playground_shader_unity\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2015\/12\/matrix_playground_shader_unity.gif?fit=405%2C259&amp;ssl=1\" data-orig-size=\"405,259\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"matrix_playground_shader_unity\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2015\/12\/matrix_playground_shader_unity.gif?fit=405%2C259&amp;ssl=1\" class=\"alignnone size-full wp-image-4136\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2015\/12\/matrix_playground_shader_unity.gif?resize=405%2C259\" alt=\"matrix_playground_shader_unity\" width=\"405\" height=\"259\" \/><\/p>\n<p>Finally decided to try shader matrices.. (because <a href=\"https:\/\/github.com\/unitycoder\/DoomStyleBillboardTest\/issues\" target=\"_blank\">having issues<\/a> with custom billboard shader)<\/p>\n<p>Doing Translate, Scale, Rotations with matrix operations seems quite simple actually!<\/p>\n<p>Would had been totally lost without these two links:<br \/>\n<a href=\"http:\/\/www.codinglabs.net\/article_world_view_projection_matrix.aspx\" target=\"_blank\">http:\/\/www.codinglabs.net\/article_world_view_projection_matrix.aspx<\/a><br \/>\n<a href=\"http:\/\/www.gamedev.net\/topic\/610115-solved-rotation-deforming-mesh-opengl-es-20\/#entry4859756\" target=\"_blank\">http:\/\/www.gamedev.net\/topic\/610115-solved-rotation-deforming-mesh-opengl-es-20\/#entry4859756<\/a><\/p>\n<p><strong>How to use the shader:<\/strong><br \/>\n&#8211; Get the source below, copy to your project<br \/>\n&#8211; Create new material, assign this shader to that material<br \/>\n&#8211; Create default box 3D object, assign the material to that<br \/>\n&#8211; Try adjusting the shader values on that material<\/p>\n<p><strong>Current shader source:<\/strong> <em>*Annoying how github gist breaks the formatting.. click the filename below the source to view in github<br \/>\n<\/em><\/p>\n<style>.gist table { margin-bottom: 0; }<\/style>\n<div style=\"tab-size: 8\" id=\"gist29191421\" class=\"gist\">\n<div class=\"gist-file\" translate=\"no\" data-color-mode=\"light\" data-light-theme=\"light\">\n<div class=\"gist-data\">\n<div class=\"js-gist-file-update-container js-task-list-container\">\n<div id=\"file-matrixplayground-shader\" class=\"file my-2\">\n<div itemprop=\"text\"\n      class=\"Box-body p-0 blob-wrapper data type-shaderlab  \"\n      style=\"overflow: auto\" tabindex=\"0\" role=\"region\"\n      aria-label=\"MatrixPlayGround.shader content, created by unitycoder on 11:37PM on December 20, 2015.\"\n    ><\/p>\n<div class=\"js-check-hidden-unicode js-blob-code-container blob-code-content\">\n<p>  <template class=\"js-file-alert-template\"><\/p>\n<div data-view-component=\"true\" class=\"flash flash-warn flash-full d-flex flex-items-center\">\n  <svg aria-hidden=\"true\" data-component=\"Octicon\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg><br \/>\n    <span><br \/>\n      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.<br \/>\n      <a class=\"Link--inTextBlock\" href=\"https:\/\/github.co\/hiddenchars\" target=\"_blank\">Learn more about bidirectional Unicode characters<\/a><br \/>\n    <\/span><\/p>\n<div data-view-component=\"true\" class=\"flash-action\">        <a href=\"{{ revealButtonHref }}\" data-view-component=\"true\" class=\"btn-sm btn\">    Show hidden characters<br \/>\n<\/a>\n<\/div>\n<\/div>\n<p><\/template><br \/>\n<template class=\"js-line-alert-template\"><br \/>\n  <span aria-label=\"This line has hidden Unicode characters\" data-view-component=\"true\" class=\"line-alert tooltipped tooltipped-e\"><br \/>\n    <svg aria-hidden=\"true\" data-component=\"Octicon\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" data-view-component=\"true\" class=\"octicon octicon-alert\">\n    <path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"><\/path>\n<\/svg><br \/>\n<\/span><\/template><\/p>\n<table data-hpc class=\"highlight tab-size js-file-line-container\" data-tab-size=\"4\" data-paste-markdown-skip data-tagsearch-path=\"MatrixPlayGround.shader\">\n<tr>\n<td id=\"file-matrixplayground-shader-L1\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"1\"><\/td>\n<td id=\"file-matrixplayground-shader-LC1\" class=\"blob-code blob-code-inner js-file-line\">\/\/ Matrix PlayGround Shader &#8211; UnityCoder.com<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L2\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"2\"><\/td>\n<td id=\"file-matrixplayground-shader-LC2\" class=\"blob-code blob-code-inner js-file-line\">\/\/ References:<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L3\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"3\"><\/td>\n<td id=\"file-matrixplayground-shader-LC3\" class=\"blob-code blob-code-inner js-file-line\">\/\/ Matrices http:\/\/www.codinglabs.net\/article_world_view_projection_matrix.aspx<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L4\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"4\"><\/td>\n<td id=\"file-matrixplayground-shader-LC4\" class=\"blob-code blob-code-inner js-file-line\">\/\/ Rotation: http:\/\/www.gamedev.net\/topic\/610115-solved-rotation-deforming-mesh-opengl-es-20\/#entry4859756<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L5\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"5\"><\/td>\n<td id=\"file-matrixplayground-shader-LC5\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L6\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"6\"><\/td>\n<td id=\"file-matrixplayground-shader-LC6\" class=\"blob-code blob-code-inner js-file-line\">Shader &quot;UnityCoder\/MatrixPlayground&quot;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L7\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"7\"><\/td>\n<td id=\"file-matrixplayground-shader-LC7\" class=\"blob-code blob-code-inner js-file-line\">{<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L8\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"8\"><\/td>\n<td id=\"file-matrixplayground-shader-LC8\" class=\"blob-code blob-code-inner js-file-line\">\tProperties<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L9\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"9\"><\/td>\n<td id=\"file-matrixplayground-shader-LC9\" class=\"blob-code blob-code-inner js-file-line\">\t{<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L10\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"10\"><\/td>\n<td id=\"file-matrixplayground-shader-LC10\" class=\"blob-code blob-code-inner js-file-line\">\t\t_MainTex (&quot;Texture&quot;, 2D) = &quot;white&quot; {}<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L11\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"11\"><\/td>\n<td id=\"file-matrixplayground-shader-LC11\" class=\"blob-code blob-code-inner js-file-line\">\t\t_tX (&quot;TranslateX&quot;, float) = 0<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L12\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"12\"><\/td>\n<td id=\"file-matrixplayground-shader-LC12\" class=\"blob-code blob-code-inner js-file-line\">\t\t_tY (&quot;TranslateY&quot;, float) = 0<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L13\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"13\"><\/td>\n<td id=\"file-matrixplayground-shader-LC13\" class=\"blob-code blob-code-inner js-file-line\">\t\t_tZ (&quot;TranslateZ&quot;, float) = 0<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L14\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"14\"><\/td>\n<td id=\"file-matrixplayground-shader-LC14\" class=\"blob-code blob-code-inner js-file-line\">\t\t_sX (&quot;ScaleX&quot;, float) = 1<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L15\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"15\"><\/td>\n<td id=\"file-matrixplayground-shader-LC15\" class=\"blob-code blob-code-inner js-file-line\">\t\t_sY (&quot;ScaleY&quot;, float) = 1<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L16\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"16\"><\/td>\n<td id=\"file-matrixplayground-shader-LC16\" class=\"blob-code blob-code-inner js-file-line\">\t\t_sZ (&quot;ScaleZ&quot;, float) = 1<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L17\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"17\"><\/td>\n<td id=\"file-matrixplayground-shader-LC17\" class=\"blob-code blob-code-inner js-file-line\">\t\t_rX (&quot;RotateX&quot;, float) = 0<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L18\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"18\"><\/td>\n<td id=\"file-matrixplayground-shader-LC18\" class=\"blob-code blob-code-inner js-file-line\">\t\t_rY (&quot;RotateY&quot;, float) = 0<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L19\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"19\"><\/td>\n<td id=\"file-matrixplayground-shader-LC19\" class=\"blob-code blob-code-inner js-file-line\">\t\t_rZ (&quot;RotateZ&quot;, float) = 0<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L20\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"20\"><\/td>\n<td id=\"file-matrixplayground-shader-LC20\" class=\"blob-code blob-code-inner js-file-line\">\t}<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L21\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"21\"><\/td>\n<td id=\"file-matrixplayground-shader-LC21\" class=\"blob-code blob-code-inner js-file-line\">\tSubShader<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L22\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"22\"><\/td>\n<td id=\"file-matrixplayground-shader-LC22\" class=\"blob-code blob-code-inner js-file-line\">\t{<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L23\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"23\"><\/td>\n<td id=\"file-matrixplayground-shader-LC23\" class=\"blob-code blob-code-inner js-file-line\">\t\tTags { &quot;RenderType&quot;=&quot;Opaque&quot; }<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L24\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"24\"><\/td>\n<td id=\"file-matrixplayground-shader-LC24\" class=\"blob-code blob-code-inner js-file-line\">\t\t\/\/Cull Off<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L25\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"25\"><\/td>\n<td id=\"file-matrixplayground-shader-LC25\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L26\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"26\"><\/td>\n<td id=\"file-matrixplayground-shader-LC26\" class=\"blob-code blob-code-inner js-file-line\">\t\tPass<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L27\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"27\"><\/td>\n<td id=\"file-matrixplayground-shader-LC27\" class=\"blob-code blob-code-inner js-file-line\">\t\t{<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L28\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"28\"><\/td>\n<td id=\"file-matrixplayground-shader-LC28\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tCGPROGRAM<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L29\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"29\"><\/td>\n<td id=\"file-matrixplayground-shader-LC29\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t#pragma vertex vert<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L30\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"30\"><\/td>\n<td id=\"file-matrixplayground-shader-LC30\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t#pragma fragment frag<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L31\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"31\"><\/td>\n<td id=\"file-matrixplayground-shader-LC31\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L32\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"32\"><\/td>\n<td id=\"file-matrixplayground-shader-LC32\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t#include &quot;UnityCG.cginc&quot;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L33\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"33\"><\/td>\n<td id=\"file-matrixplayground-shader-LC33\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L34\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"34\"><\/td>\n<td id=\"file-matrixplayground-shader-LC34\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tstruct appdata<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L35\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"35\"><\/td>\n<td id=\"file-matrixplayground-shader-LC35\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t{<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L36\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"36\"><\/td>\n<td id=\"file-matrixplayground-shader-LC36\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tfloat4 vertex : POSITION;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L37\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"37\"><\/td>\n<td id=\"file-matrixplayground-shader-LC37\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tfloat2 uv : TEXCOORD0;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L38\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"38\"><\/td>\n<td id=\"file-matrixplayground-shader-LC38\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t};<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L39\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"39\"><\/td>\n<td id=\"file-matrixplayground-shader-LC39\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L40\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"40\"><\/td>\n<td id=\"file-matrixplayground-shader-LC40\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tstruct v2f<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L41\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"41\"><\/td>\n<td id=\"file-matrixplayground-shader-LC41\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t{<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L42\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"42\"><\/td>\n<td id=\"file-matrixplayground-shader-LC42\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tfloat2 uv : TEXCOORD0;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L43\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"43\"><\/td>\n<td id=\"file-matrixplayground-shader-LC43\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tUNITY_FOG_COORDS(1)<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L44\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"44\"><\/td>\n<td id=\"file-matrixplayground-shader-LC44\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tfloat4 vertex : SV_POSITION;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L45\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"45\"><\/td>\n<td id=\"file-matrixplayground-shader-LC45\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t};<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L46\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"46\"><\/td>\n<td id=\"file-matrixplayground-shader-LC46\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L47\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"47\"><\/td>\n<td id=\"file-matrixplayground-shader-LC47\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tsampler2D _MainTex;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L48\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"48\"><\/td>\n<td id=\"file-matrixplayground-shader-LC48\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tfloat4 _MainTex_ST;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L49\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"49\"><\/td>\n<td id=\"file-matrixplayground-shader-LC49\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L50\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"50\"><\/td>\n<td id=\"file-matrixplayground-shader-LC50\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tfloat _tX,_tY,_tZ; <\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L51\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"51\"><\/td>\n<td id=\"file-matrixplayground-shader-LC51\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tfloat _sX,_sY,_sZ;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L52\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"52\"><\/td>\n<td id=\"file-matrixplayground-shader-LC52\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tfloat _rX,_rY,_rZ;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L53\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"53\"><\/td>\n<td id=\"file-matrixplayground-shader-LC53\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L54\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"54\"><\/td>\n<td id=\"file-matrixplayground-shader-LC54\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tv2f vert (appdata v)<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L55\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"55\"><\/td>\n<td id=\"file-matrixplayground-shader-LC55\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t{<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L56\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"56\"><\/td>\n<td id=\"file-matrixplayground-shader-LC56\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tv2f o;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L57\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"57\"><\/td>\n<td id=\"file-matrixplayground-shader-LC57\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L58\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"58\"><\/td>\n<td id=\"file-matrixplayground-shader-LC58\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tfloat4x4 translateMatrix = float4x4(1,\t0,\t0,\t_tX,<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L59\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"59\"><\/td>\n<td id=\"file-matrixplayground-shader-LC59\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\t\t\t\t\t\t\t \t\t0,\t1,\t0,\t_tY,<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L60\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"60\"><\/td>\n<td id=\"file-matrixplayground-shader-LC60\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\t\t\t\t\t  \t\t\t\t0,\t0,\t1,\t_tZ,<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L61\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"61\"><\/td>\n<td id=\"file-matrixplayground-shader-LC61\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\t\t\t\t\t  \t\t\t\t0,\t0,\t0,\t1);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L62\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"62\"><\/td>\n<td id=\"file-matrixplayground-shader-LC62\" class=\"blob-code blob-code-inner js-file-line\">\t<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L63\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"63\"><\/td>\n<td id=\"file-matrixplayground-shader-LC63\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tfloat4x4 scaleMatrix \t= float4x4(_sX,\t0,\t0,\t0,<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L64\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"64\"><\/td>\n<td id=\"file-matrixplayground-shader-LC64\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\t\t\t\t\t\t\t \t\t0,\t_sY,0,\t0,<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L65\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"65\"><\/td>\n<td id=\"file-matrixplayground-shader-LC65\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\t\t\t\t  \t\t\t\t\t0,\t0,\t_sZ,0,<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L66\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"66\"><\/td>\n<td id=\"file-matrixplayground-shader-LC66\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\t\t\t\t  \t\t\t\t\t0,\t0,\t0,\t1);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L67\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"67\"><\/td>\n<td id=\"file-matrixplayground-shader-LC67\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L68\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"68\"><\/td>\n<td id=\"file-matrixplayground-shader-LC68\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tfloat angleX = radians(_rX);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L69\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"69\"><\/td>\n<td id=\"file-matrixplayground-shader-LC69\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tfloat c = cos(angleX);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L70\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"70\"><\/td>\n<td id=\"file-matrixplayground-shader-LC70\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tfloat s = sin(angleX);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L71\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"71\"><\/td>\n<td id=\"file-matrixplayground-shader-LC71\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tfloat4x4 rotateXMatrix\t= float4x4(\t1,\t0,\t0,\t0,<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L72\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"72\"><\/td>\n<td id=\"file-matrixplayground-shader-LC72\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\t\t\t\t\t\t\t \t\t0,\tc,\t-s,\t0,<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L73\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"73\"><\/td>\n<td id=\"file-matrixplayground-shader-LC73\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\t\t\t\t  \t\t\t\t\t0,\ts,\tc,\t0,<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L74\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"74\"><\/td>\n<td id=\"file-matrixplayground-shader-LC74\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\t\t\t\t  \t\t\t\t\t0,\t0,\t0,\t1);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L75\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"75\"><\/td>\n<td id=\"file-matrixplayground-shader-LC75\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L76\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"76\"><\/td>\n<td id=\"file-matrixplayground-shader-LC76\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tfloat angleY = radians(_rY);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L77\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"77\"><\/td>\n<td id=\"file-matrixplayground-shader-LC77\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tc = cos(angleY);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L78\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"78\"><\/td>\n<td id=\"file-matrixplayground-shader-LC78\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\ts = sin(angleY);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L79\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"79\"><\/td>\n<td id=\"file-matrixplayground-shader-LC79\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tfloat4x4 rotateYMatrix\t= float4x4(\tc,\t0,\ts,\t0,<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L80\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"80\"><\/td>\n<td id=\"file-matrixplayground-shader-LC80\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\t\t\t\t\t\t\t \t\t0,\t1,\t0,\t0,<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L81\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"81\"><\/td>\n<td id=\"file-matrixplayground-shader-LC81\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\t\t\t\t  \t\t\t\t\t-s,\t0,\tc,\t0,<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L82\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"82\"><\/td>\n<td id=\"file-matrixplayground-shader-LC82\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\t\t\t\t  \t\t\t\t\t0,\t0,\t0,\t1);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L83\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"83\"><\/td>\n<td id=\"file-matrixplayground-shader-LC83\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L84\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"84\"><\/td>\n<td id=\"file-matrixplayground-shader-LC84\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tfloat angleZ = radians(_rZ);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L85\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"85\"><\/td>\n<td id=\"file-matrixplayground-shader-LC85\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tc = cos(angleZ);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L86\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"86\"><\/td>\n<td id=\"file-matrixplayground-shader-LC86\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\ts = sin(angleZ);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L87\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"87\"><\/td>\n<td id=\"file-matrixplayground-shader-LC87\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tfloat4x4 rotateZMatrix\t= float4x4(\tc,\t-s,\t0,\t0,<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L88\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"88\"><\/td>\n<td id=\"file-matrixplayground-shader-LC88\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\t\t\t\t\t\t\t \t\ts,\tc,\t0,\t0,<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L89\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"89\"><\/td>\n<td id=\"file-matrixplayground-shader-LC89\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\t\t\t\t  \t\t\t\t\t0,\t0,\t1,\t0,<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L90\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"90\"><\/td>\n<td id=\"file-matrixplayground-shader-LC90\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\t\t\t\t\t  \t\t\t\t\t0,\t0,\t0,\t1);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L91\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"91\"><\/td>\n<td id=\"file-matrixplayground-shader-LC91\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L92\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"92\"><\/td>\n<td id=\"file-matrixplayground-shader-LC92\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L93\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"93\"><\/td>\n<td id=\"file-matrixplayground-shader-LC93\" class=\"blob-code blob-code-inner js-file-line\">  \t\t\t\tfloat4 localVertexPos = v.vertex;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L94\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"94\"><\/td>\n<td id=\"file-matrixplayground-shader-LC94\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L95\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"95\"><\/td>\n<td id=\"file-matrixplayground-shader-LC95\" class=\"blob-code blob-code-inner js-file-line\">  \t\t\t\t\/\/ NOTE: the order matters, try scaling first before translating, different results<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L96\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"96\"><\/td>\n<td id=\"file-matrixplayground-shader-LC96\" class=\"blob-code blob-code-inner js-file-line\">  \t\t\t\tfloat4 localTranslated = mul(translateMatrix,localVertexPos);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L97\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"97\"><\/td>\n<td id=\"file-matrixplayground-shader-LC97\" class=\"blob-code blob-code-inner js-file-line\">  \t\t\t\tfloat4 localScaledTranslated = mul(localTranslated,scaleMatrix);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L98\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"98\"><\/td>\n<td id=\"file-matrixplayground-shader-LC98\" class=\"blob-code blob-code-inner js-file-line\">  \t\t\t\tfloat4 localScaledTranslatedRotX = mul(localScaledTranslated,rotateXMatrix);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L99\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"99\"><\/td>\n<td id=\"file-matrixplayground-shader-LC99\" class=\"blob-code blob-code-inner js-file-line\">  \t\t\t\tfloat4 localScaledTranslatedRotXY = mul(localScaledTranslatedRotX,rotateYMatrix);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L100\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"100\"><\/td>\n<td id=\"file-matrixplayground-shader-LC100\" class=\"blob-code blob-code-inner js-file-line\">  \t\t\t\tfloat4 localScaledTranslatedRotXYZ = mul(localScaledTranslatedRotXY,rotateZMatrix);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L101\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"101\"><\/td>\n<td id=\"file-matrixplayground-shader-LC101\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L102\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"102\"><\/td>\n<td id=\"file-matrixplayground-shader-LC102\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\to.vertex = mul(UNITY_MATRIX_MVP, localScaledTranslatedRotXYZ);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L103\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"103\"><\/td>\n<td id=\"file-matrixplayground-shader-LC103\" class=\"blob-code blob-code-inner js-file-line\">\n<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L104\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"104\"><\/td>\n<td id=\"file-matrixplayground-shader-LC104\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\to.uv = TRANSFORM_TEX(v.uv, _MainTex);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L105\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"105\"><\/td>\n<td id=\"file-matrixplayground-shader-LC105\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\treturn o;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L106\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"106\"><\/td>\n<td id=\"file-matrixplayground-shader-LC106\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t}<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L107\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"107\"><\/td>\n<td id=\"file-matrixplayground-shader-LC107\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L108\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"108\"><\/td>\n<td id=\"file-matrixplayground-shader-LC108\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tfixed4 frag (v2f i) : SV_Target<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L109\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"109\"><\/td>\n<td id=\"file-matrixplayground-shader-LC109\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t{<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L110\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"110\"><\/td>\n<td id=\"file-matrixplayground-shader-LC110\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\tfixed4 col = tex2D(_MainTex, i.uv);<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L111\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"111\"><\/td>\n<td id=\"file-matrixplayground-shader-LC111\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t\treturn col;<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L112\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"112\"><\/td>\n<td id=\"file-matrixplayground-shader-LC112\" class=\"blob-code blob-code-inner js-file-line\">\t\t\t}<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L113\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"113\"><\/td>\n<td id=\"file-matrixplayground-shader-LC113\" class=\"blob-code blob-code-inner js-file-line\">\t\t\tENDCG<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L114\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"114\"><\/td>\n<td id=\"file-matrixplayground-shader-LC114\" class=\"blob-code blob-code-inner js-file-line\">\t\t}<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L115\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"115\"><\/td>\n<td id=\"file-matrixplayground-shader-LC115\" class=\"blob-code blob-code-inner js-file-line\">\t}<\/td>\n<\/tr>\n<tr>\n<td id=\"file-matrixplayground-shader-L116\" class=\"blob-num js-line-number js-blob-rnum\" data-line-number=\"116\"><\/td>\n<td id=\"file-matrixplayground-shader-LC116\" class=\"blob-code blob-code-inner js-file-line\">}<\/td>\n<\/tr>\n<\/table>\n<\/div><\/div>\n<\/p><\/div>\n<\/div><\/div>\n<div class=\"gist-meta\">\n        <a href=\"https:\/\/gist.github.com\/unitycoder\/30c5abdb9720ea699ad3\/raw\/87c8d9797ea688bbd4a1a8e03e6ffa8b766fceb2\/MatrixPlayGround.shader\" style=\"float:right\" class=\"Link--inTextBlock\">view raw<\/a><br \/>\n        <a href=\"https:\/\/gist.github.com\/unitycoder\/30c5abdb9720ea699ad3#file-matrixplayground-shader\" class=\"Link--inTextBlock\"><br \/>\n          MatrixPlayGround.shader<br \/>\n        <\/a><br \/>\n        hosted with &#10084; by <a class=\"Link--inTextBlock\" href=\"https:\/\/github.com\">GitHub<\/a>\n      <\/div>\n<\/p><\/div>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Finally decided to try shader matrices.. (because having issues with custom billboard shader) Doing Translate, Scale, Rotations with matrix operations seems quite simple actually! Would had been totally lost without these two links: http:\/\/www.codinglabs.net\/article_world_view_projection_matrix.aspx http:\/\/www.gamedev.net\/topic\/610115-solved-rotation-deforming-mesh-opengl-es-20\/#entry4859756 How to use the shader: &#8211; Get the source below, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4136,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[13,3],"tags":[747,835,651,837,14,836,33],"class_list":["post-4135","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-shaders","category-unity3d","tag-math","tag-matrix","tag-rotate","tag-scale","tag-shader","tag-translate","tag-vertex"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2015\/12\/matrix_playground_shader_unity.gif?fit=405%2C259&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-14H","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/comments?post=4135"}],"version-history":[{"count":2,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4135\/revisions"}],"predecessor-version":[{"id":4138,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4135\/revisions\/4138"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/4136"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=4135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=4135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=4135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}