{"id":3714,"date":"2015-04-06T00:24:40","date_gmt":"2015-04-05T21:24:40","guid":{"rendered":"http:\/\/unitycoder.com\/blog\/?p=3714"},"modified":"2015-09-08T00:23:00","modified_gmt":"2015-09-07T21:23:00","slug":"doom-style-billboard-shader","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2015\/04\/06\/doom-style-billboard-shader\/","title":{"rendered":"Doom Style Billboard Shader"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3715\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2015\/04\/06\/doom-style-billboard-shader\/doom_billboard_shader_unity5_1\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2015\/04\/doom_billboard_shader_unity5_1.jpg?fit=680%2C384&amp;ssl=1\" data-orig-size=\"680,384\" 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=\"doom_billboard_shader_unity5_1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2015\/04\/doom_billboard_shader_unity5_1.jpg?fit=680%2C384&amp;ssl=1\" class=\"alignnone size-full wp-image-3715\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2015\/04\/doom_billboard_shader_unity5_1.jpg?resize=680%2C384\" alt=\"doom_billboard_shader_unity5_1\" width=\"680\" height=\"384\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2015\/04\/doom_billboard_shader_unity5_1.jpg?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2015\/04\/doom_billboard_shader_unity5_1.jpg?resize=300%2C169&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/p>\n<p>Testing Doom style billboard shader, where you can look sprite from different angles, still not completely finished but enough for testing..<\/p>\n<p>* Note: I have no idea how the doom billboards work, just looking for similar style<\/p>\n<p><strong>Related forum post:<\/strong> <a title=\"http:\/\/forum.unity3d.com\/threads\/relative-position-for-changing-2d-graphics-in-3d-environment.307086\/\" href=\"http:\/\/forum.unity3d.com\/threads\/relative-position-for-changing-2d-graphics-in-3d-environment.307086\/\" target=\"_blank\">http:\/\/forum.unity3d.com\/threads\/relative-position-for-changing-2d-graphics-in-3d-environment.307086\/<\/a><\/p>\n<p><strong>WebGL player:<\/strong><br \/>\n*coming later*<\/p>\n<p><strong>Sources:<\/strong><br \/>\n* Shader still has few problems (like overlapping other billboards, could be optimized\/cleaned up etc), feel free to post improvements here or to github<br \/>\n* Unity 5.1 used<br \/>\n<a title=\"https:\/\/github.com\/unitycoder\/DoomStyleBillboardTest\" href=\"https:\/\/github.com\/unitycoder\/DoomStyleBillboardTest\" target=\"_blank\">https:\/\/github.com\/unitycoder\/DoomStyleBillboardTest<\/a><\/p>\n<p>&#8212;<\/p>\n<p><strong>Updates:<\/strong><br \/>\n&#8211; 08.09.2015: Added animated frames test<\/p>\n<p>&#8212;<\/p>\n<p><strong>Resources:<\/strong><br \/>\n&#8211; Getting viewdir in shader: <a title=\"http:\/\/forum.unity3d.com\/threads\/viewdir-up-vector.173549\/\" href=\"http:\/\/forum.unity3d.com\/threads\/viewdir-up-vector.173549\/\" target=\"_blank\">http:\/\/forum.unity3d.com\/threads\/viewdir-up-vector.173549\/<\/a><br \/>\n&#8211; Should actually check how they do it in Unity Daggerfall : <a title=\"http:\/\/www.dfworkshop.net\/?cat=17\" href=\"http:\/\/www.dfworkshop.net\/?cat=17\" target=\"_blank\">http:\/\/www.dfworkshop.net\/?cat=17<\/a><\/p>\n<p>&#8212;<\/p>\n<p><strong>Image#2:<\/strong> Dynamic batching seems to work<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2015\/04\/doomspritebatching1.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3916\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2015\/04\/06\/doom-style-billboard-shader\/doomspritebatching1\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2015\/04\/doomspritebatching1.jpg?fit=933%2C530&amp;ssl=1\" data-orig-size=\"933,530\" 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=\"doomspritebatching1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2015\/04\/doomspritebatching1.jpg?fit=933%2C530&amp;ssl=1\" class=\"alignnone size-medium wp-image-3916\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2015\/04\/doomspritebatching1-300x170.jpg?resize=300%2C170\" alt=\"doomspritebatching1\" width=\"300\" height=\"170\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2015\/04\/doomspritebatching1.jpg?resize=300%2C170&amp;ssl=1 300w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2015\/04\/doomspritebatching1.jpg?w=933&amp;ssl=1 933w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>(click to view)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Testing Doom style billboard shader, where you can look sprite from different angles, still not completely finished but enough for testing.. * Note: I have no idea how the doom billboards work, just looking for similar style Related forum post: http:\/\/forum.unity3d.com\/threads\/relative-position-for-changing-2d-graphics-in-3d-environment.307086\/ WebGL player: *coming later* [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3715,"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_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":[727,726,725,729,14,728,357],"class_list":["post-3714","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-shaders","category-unity3d","tag-angle","tag-billboard","tag-doom","tag-frame","tag-shader","tag-sheet","tag-sprite"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2015\/04\/doom_billboard_shader_unity5_1.jpg?fit=680%2C384&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-XU","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/3714","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=3714"}],"version-history":[{"count":7,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/3714\/revisions"}],"predecessor-version":[{"id":3957,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/3714\/revisions\/3957"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/3715"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=3714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=3714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=3714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}